FEE module initialization auxiliary method and device, equipment and medium

The flash controller updates the traversal register status and traverses sectors after powering on the chip to determine the data storage status, which solves the problem of slow initialization speed of FEE modules, realizes a faster initialization process, and improves chip performance.

CN118939185APending Publication Date: 2024-11-12TONGXIN MICROELECTRONICS TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410927288.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

During the initialization process, the FEE module determines the data storage status by reading each sector in the flash memory, resulting in a slow initialization speed and affecting chip performance.

Method used

The flash controller updates the traversal register status flag after powering on the chip, and traverses each sector to determine the data storage status, sets the flags in the sector status register, and passes them to the hardware to execute, and completes initialization directly based on the register flag.

Benefits of technology

It saves time to read sector data storage status, speeds up the initialization speed of FEE modules, and improves chip performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939185A_ABST
    Figure CN118939185A_ABST
Patent Text Reader

Abstract

The invention discloses an FEE module initialization auxiliary method and device, equipment and a medium. The method comprises the steps that after a chip is powered on, a state flag in a flash memory traversal register is updated to be a second traversal state flag; traversing each sector in the flash memory, determining a data storage state of each sector, setting a sector state flag of each sector in a sector state register, and updating a state flag in a flash memory traversal register to a third traversal state flag after the setting process is completed, and enabling the FEE module to complete initialization according to the state flag and the sector state flag of each sector. According to the embodiment of the invention, each sector in the flash memory can be automatically traversed through the flash memory controller, the data storage state of each sector is determined, and the sector state flag in the register is set, so that the time of determining the data storage state of each sector by reading each sector in the flash memory by an FEE module is saved, and the initialization speed of the FEE module is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a FEE module initialization auxiliary method, device, equipment and medium. Background Art

[0002] AUTomotive Open System Architecture (AUTOSAR) is an open and standardized software architecture for the field of automotive electronics technology. The chip used for vehicle control is usually built based on AUTOSAR. The chip will contain AUTOSAR modules such as Flash EEPROMEmulation (FEE) module, Microcontroller Unit (MCU) module, and Watchdog (WDG) module. AUTOSAR stipulates that the FEE module must provide a "virtual" unlimited number of erase cycles for the upper layer. The FEE module is used to manage the flash memory of the chip. The flash memory of the chip consists of multiple banks. Each block consists of multiple sectors. Each sector consists of multiple pages. Each page consists of multiple bytes. During the operation of the chip, the FEE module can write the data that needs to be stored in the flash memory to the available pages in the available sectors in the flash memory, thereby storing the data. In order to improve the utilization of the chip's storage space, the FEE module generally stores all sectors in a block before switching to the next block to continue storing data. After the chip is powered on, the FEE module is initialized to determine the data storage status of each sector, and then, based on the data storage status of each sector, determines the sector used to store the last written data before the last power failure, and then determines the next page to which data can be written and determines each sector used to store previously written data.

[0003] In the related art, the commonly used FEE module initialization scheme is: after receiving the initialization instruction sent by the software, the FEE module determines the data storage status of each sector by reading each sector in the flash memory, and then determines the sector used to store the last written data before the last power failure based on the data storage status of each sector, and then determines the next page to which data can be written and determines each sector used to store the previously written data. The FEE module initialization scheme in the related art requires the FEE module to determine the data storage status of each sector by reading each sector in the flash memory during the initialization process, which consumes a lot of time, resulting in a slow initialization speed of the FEE module and affecting chip performance. Summary of the invention

[0004] The present invention provides a FEE module initialization auxiliary method, device, equipment and medium to solve the problem that the FEE module initialization scheme in the related art requires the FEE module to determine the data storage status of each sector by reading each sector in the flash memory during the initialization process, which consumes a lot of time, resulting in slow FEE module initialization speed and affecting chip performance.

[0005] According to one aspect of the present invention, a FEE module initialization auxiliary method is provided, which is applied to a flash memory controller, and includes:

[0006] After the chip is powered on, the status flag in the flash memory traversal register is updated from the first traversal status flag to the second traversal status flag;

[0007] Traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

[0008] According to another aspect of the present invention, there is provided a FEE module initialization auxiliary device, which is configured in a flash memory controller and includes:

[0009] A flag update module, used for updating the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag after the chip is powered on;

[0010] A flag setting module is used to traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to a third traversal status flag, so that the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0012] at least one processor;

[0013] and a memory communicatively coupled to the at least one processor;

[0014] The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the FEE module initialization auxiliary method described in any embodiment of the present invention.

[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the FEE module initialization auxiliary method described in any embodiment of the present invention when executed.

[0016] In the technical solution of the embodiment of the present invention, after the chip is powered on, the flash memory controller updates the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag, and then traverses each sector in the flash memory to determine the data storage status of each sector, and sets the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, updates the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes the initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register. The technical solution of the embodiment of the present invention solves the problem that the FEE module initialization solution in the related art requires the FEE module to determine the data storage status of each sector by reading each sector in the flash memory during the initialization process, which consumes a lot of time, resulting in a slow initialization speed of the FEE module and affecting the chip performance. The technical solution of the embodiment of the present invention can automatically traverse each sector in the flash memory through the flash memory controller after the chip is powered on, determine the data storage status of each sector, and set the sector status flag in the register used to characterize the data storage status of each sector according to the data storage status of each sector, thereby handing over the operation of traversing each sector in the flash memory and determining the data storage status of each sector to the hardware for execution, so that the FEE module can directly determine the data storage status of each sector according to the sector status flag of each sector in the register during the initialization process, and then determine the data write position before the last power failure, the writable page in each sector and the data storage sector according to the data storage status of each sector, thereby completing the initialization, saving the time for the FEE module to determine the data storage status of each sector by reading each sector in the flash memory, accelerating the initialization speed of the FEE module, and ensuring chip performance.

[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of a FEE module initialization auxiliary method provided in an embodiment of the present invention.

[0020] Figure 2 A schematic diagram of the structure of a flash memory provided by an embodiment of the present invention.

[0021] Figure 3 A schematic diagram of the structure of a flash memory traversal register provided by an embodiment of the present invention.

[0022] Figure 4 A schematic diagram of the structure of a sector in which the data storage state is no data is provided in an embodiment of the present invention.

[0023] Figure 5 A schematic diagram of a structure of a sector in which a data storage state is data is provided in an embodiment of the present invention.

[0024] Figure 6 A structural schematic diagram of a sector in which a data storage state is an ECC error is provided in an embodiment of the present invention.

[0025] Figure 7 A schematic diagram of the structure of a sector status register provided by an embodiment of the present invention.

[0026] Figure 8 A structural schematic diagram of a FEE module initialization auxiliary device provided in an embodiment of the present invention.

[0027] Fig. 9 A schematic diagram of the structure of an electronic device for implementing the FEE module initialization auxiliary method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "target", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprise", "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 The present invention provides a flowchart of a FEE module initialization auxiliary method. This embodiment is applicable to the case of completing the initialization process of the FEE module in the chip. The method can be executed by a flash memory controller. Figure 1 As shown, the method includes:

[0032] Step 101: After the chip is powered on, the status flag in the flash memory traversal register is updated from the first traversal status flag to the second traversal status flag.

[0033] Optionally, the flash memory of the chip is a memory device, which is a non-volatile memory. The flash memory of the chip can retain data for a long time even without current supply. The storage characteristics of the flash memory of the chip are equivalent to a hard disk. Figure 2 A schematic diagram of the structure of a flash memory provided by an embodiment of the present invention. The flash memory is composed of multiple banks. Each bank is composed of multiple sectors. Each sector is composed of multiple pages. Each page is composed of multiple bytes. A sector or page can be the smallest erasable unit of the flash memory.

[0034] Optionally, the flash memory controller can be a controller provided in the chip for traversing each sector in the flash memory and determining the data storage status of each sector. The FEE module can be a module provided in the chip for managing the flash memory of the chip. During the operation of the chip, the FEE module can write the data that needs to be stored in the flash memory into the available pages in the available sectors in the flash memory, thereby storing the data. After the chip is powered on, the FEE module needs to be initialized to determine the data storage status of each sector, and then determine the sector used to store the last written data before the last power failure based on the data storage status of each sector, and then determine the next page where data can be written and determine the sectors used to store the previously written data.

[0035] Optionally, the flash memory traversal register may be a register set in the chip for storing status flags and other data related to the flash memory controller. The status flag in the flash memory traversal register may be a credential information for representing whether the flash memory controller has completed traversing each sector in the flash memory, determining the data storage status of each sector, and setting the sector status flag of each sector in the sector status register according to the data storage status of each sector. The status flag in the flash memory traversal register may be a first traversal status flag, a second traversal status flag, or a third traversal status flag. The first traversal status flag may be credential information for representing that the flash memory controller has not started the setting process. The second traversal status flag may be credential information for representing that the flash memory controller is in the process of setting. The third traversal status flag may be credential information for representing that the flash memory controller has completed the setting process. In the initial state, the status flag in the flash memory traversal register is the first traversal status flag. Exemplarily, the first traversal status flag is 00, the second traversal status flag is 01, and the third traversal status flag is 11.

[0036] Optionally, in a specific example, Figure 3 A schematic diagram of a flash memory traversal register provided by an embodiment of the present invention. The flash memory traversal register is a 32-bit register. Bits 0 and 1 of the flash memory traversal register are used to store a status flag.

[0037] Optionally, after the chip is powered on, the flash memory controller updates the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag, so that other modules or devices can determine that the flash memory controller is in the setup process based on the second traversal status flag in the flash memory traversal register.

[0038] Optionally, the sector status register may be a register set in the chip for storing sector status flags of each sector. The sector status flag of each sector may be credential information for characterizing the data storage status of the sector. The data storage status of the sector may be data, no data, or an error correction code (ECC) error. The data storage status of the sector is data, which means that one or more pages in the sector store data, the sector has been used, data is stored in the sector, and the stored data is not damaged data. Damaged data may be data that cannot be read due to abnormal power failure or hardware damage. The data storage status of the sector is no data, which means that no data is stored in each page in the sector, the sector is empty, and no data is stored in the sector. The data storage status of the sector is ECC error, which means that one or more pages in the sector store data, the sector has been used, data is stored in the sector, and damaged data exists in the stored data. The sector status flag of each sector may be a first sector status flag, a second sector status flag, or a third sector status flag. The first sector status flag may be credential information for characterizing that the data storage state of the sector is data-containing. The second sector status flag may be credential information for characterizing that the data storage state of the sector is data-free. The third sector status flag may be credential information for characterizing that the data storage state of the sector is ECC error-existing. In the initial state, the sector status flag of the sector is the second sector status flag. Exemplarily, the first sector status flag is 01, the second sector status flag is 00, and the third sector status flag is 11.

[0039] Optionally, in a specific example, Figure 4 A schematic diagram of a structure of a sector with no data in a data storage state provided by an embodiment of the present invention. The sector is composed of 25 pages. No data is stored in each page in the sector, the sector is empty, and no data is stored in the sector.

[0040] Optionally, in a specific example, Figure 5 A schematic diagram of a structure of a sector with data in a data storage state provided by an embodiment of the present invention. The sector is composed of 25 pages. Three pages in the sector store data, the sector has been used, data is stored in the sector, and the stored data is not damaged data.

[0041] Optionally, in a specific example, Figure 6 A schematic diagram of a structure of a sector in which a data storage state is an ECC error is provided for an embodiment of the present invention. The sector is composed of 25 pages. Seven pages in the sector store data, the sector has been used, data is stored in the sector, and the data stored in one of the seven pages storing data is damaged data.

[0042] Optionally, in a specific example, Figure 7 A schematic diagram of the structure of a sector status register provided by an embodiment of the present invention. The flash memory of the chip contains a total of 16 sectors: the first sector, the second sector, the third sector, the fourth sector, the fifth sector, the sixth sector, the seventh sector, the eighth sector, the ninth sector, the tenth sector, the eleventh sector, the twelfth sector, the thirteenth sector, the fourteenth sector, the fifteenth sector, and the sixteenth sector. The sector status register is a 32-bit register. The 0th and 1st bits of the flash memory traversal register are used to store the sector status flag of the first sector. The 2nd and 3rd bits of the flash memory traversal register are used to store the sector status flag of the second sector. The 4th and 5th bits of the flash memory traversal register are used to store the sector status flag of the third sector. The 6th and 7th bits of the flash memory traversal register are used to store the sector status flag of the fourth sector. The 8th and 9th bits of the flash memory traversal register are used to store the sector status flag of the fifth sector. The 10th and 11th bits of the flash memory traversal register are used to store the sector status flag of the sixth sector. The 12th and 13th bits of the flash traverse register are used to store the sector status flag of the seventh sector. The 14th and 15th bits of the flash traverse register are used to store the sector status flag of the eighth sector. The 16th and 17th bits of the flash traverse register are used to store the sector status flag of the ninth sector. The 18th and 19th bits of the flash traverse register are used to store the sector status flag of the tenth sector. The 20th and 21st bits of the flash traverse register are used to store the sector status flag of the eleventh sector. The 22nd and 23rd bits of the flash traverse register are used to store the sector status flag of the twelfth sector. The 24th and 25th bits of the flash traverse register are used to store the sector status flag of the thirteenth sector. The 26th and 27th bits of the flash traverse register are used to store the sector status flag of the fourteenth sector. The 28th and 29th bits of the flash traverse register are used to store the sector status flag of the fifteenth sector. Bits 30 and 31 of the flash traversal register are used to store the sector status flag of the sixteenth sector.

[0043] Step 102, traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

[0044] Optionally, traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, including: traverse each sector in the flash memory in ascending order of the sector number, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector.

[0045] Optionally, the number of each sector can be a pre-set digital number for uniquely identifying the sector. The numbers of different sectors are different. The flash memory controller can sort the sectors in order of the numbers of each sector from small to large, start processing from the sector ranked first, determine the data storage status of the sector, and set the sector status flag of the corresponding sector in the sector status register according to the data storage status of the sector. Then the flash memory controller processes the sector ranked next, determines the data storage status of the sector, and sets the sector status flag of the corresponding sector in the sector status register according to the data storage status of the sector. And so on, until the flash memory controller processes the sector ranked last, determines the data storage status of the sector, and sets the sector status flag of the corresponding sector in the sector status register according to the data storage status of the sector, the flash memory controller can determine that the processing of each sector is completed and the setting process is completed.

[0046] Optionally, the data storage status of each sector is determined, and according to the data storage status of each sector, the sector status flag of each sector in the sector status register is set, including: performing the following operations for each sector in the flash memory: checking whether data is stored in each page in the sector and whether the data stored in the page storing the data is readable; if data is stored in at least one page in the sector and the data stored in each page storing the data is readable, then determining that the data storage status of the sector is that there is data, and setting the sector status flag of the sector in the sector status register to the first sector status flag.

[0047] Optionally, after checking whether data is stored in each page in the sector and whether the data stored in the page storing data is readable, it also includes: if no data is stored in each page in the sector, determining that the data storage status of the sector is no data, and setting the sector status flag of the sector in the sector status register to the second sector status flag.

[0048] Optionally, after checking whether data is stored in each page in the sector and whether the data stored in the page storing the data is readable, it also includes: if data is stored in at least one page in the sector, and the data stored in the target page in each page storing the data is unreadable, then determining that the data storage status of the sector is that there is an ECC error, and setting the sector status flag of the sector in the sector status register to a third sector status flag.

[0049] Optionally, whether the data stored in the page is readable may refer to whether the data stored in the page can be read by the flash memory controller. The data stored in the page is readable may refer to that the data stored in the page can be read by the flash memory controller. The data stored in the page is unreadable may refer to that the data stored in the page cannot be read by the flash memory controller. Generally, if the data stored in the page is unreadable, it indicates that the data stored in the page is damaged data. The target page in each page storing data is one or more pages in each page storing data.

[0050] Optionally, for each sector in the flash memory of the chip, the flash memory controller can check whether data is stored in each page in the sector and whether the data stored in the page storing data is readable. If data is stored in at least one page in the sector and the data stored in each page storing data is readable, it indicates that data is stored in one or more pages in the sector, the sector has been used, there is data stored in the sector, and the stored data is not damaged data. Then, it can be determined that the data storage state of the sector is data, and the sector status flag of the sector in the sector status register is set to the first sector status flag. If no data is stored in each page in the sector, it indicates that the sector is empty and no data is stored in the sector. Then, it can be determined that the data storage state of the sector is no data, and the sector status flag of the sector in the sector status register is set to the second sector status flag. If data is stored in at least one page in the sector, and the data stored in the target page in each page storing data is unreadable, it indicates that data is stored in one or more pages in the sector, the sector has been used, data is stored in the sector, and damaged data exists in the stored data. It can be determined that the data storage status of the sector is that there is an ECC error, and the sector status flag of the sector in the sector status register is set to the third sector status flag.

[0051] Optionally, after the setup process is completed, the flash memory controller updates the status flag in the flash memory traversal register to a third traversal status flag, so that other modules or devices can determine that the flash memory controller has completed the setup process based on the third traversal status flag in the flash memory traversal register.

[0052] Optionally, the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, including: after receiving the initialization instruction, the FEE module reads the status flag in the flash memory traversal register; if the read status flag is the third traversal status flag, the FEE module reads the sector status flag of each sector in the sector status register, and determines the data write position before the last power failure, the writable pages in each sector and the data storage sector according to the sector status flags of each sector, thereby completing the initialization.

[0053] Optionally, after receiving the initialization instruction, the FEE module reads the status flag in the flash memory traversal register. The initialization instruction may be an instruction for instructing the FEE module to start initialization. The initialization instruction may be sent to the FEE module by software set in the chip for controlling the initialization of each module. If the read status flag is the third traversal status flag, indicating that the flash memory controller has completed the setup process, the FEE module reads the sector status flag of each sector in the sector status register, and determines the data write position before the last power failure, the writable pages in each sector, and the data storage sector according to the sector status flag of each sector, thereby completing the initialization.

[0054] Optionally, the data write position before the last power outage, the writable pages in each sector, and the data storage sector are determined according to the sector status flags of each sector, including: the FEE module determines the data storage status of each sector according to the sector status flags of each sector in the sector status register; the FEE module determines the data write position before the last power outage, the writable pages in each sector, and the data storage sector according to the data storage status of each sector.

[0055] Optionally, the FEE module determines the data storage status of each sector according to the sector status flag of each sector in the sector status register, including: performing the following operations for each sector in the flash memory: the FEE module reads the sector status flag of the sector from the sector status register; if the sector status flag read by the FEE module is the first sector status flag, it is determined that the data storage status of the sector is that there is data; if the sector status flag read by the FEE module is the second sector status flag, it is determined that the data storage status of the sector is that there is no data; if the sector status flag read by the FEE module is the third sector status flag, it is determined that the data storage status of the sector is that there is an ECC error.

[0056] Optionally, the data write location before the last power failure may refer to the sector used to store the data written last time before the last power failure. The writable page in each sector may refer to the next page where data can be written. The data storage sector in each sector may refer to each sector used to store previously written data.

[0057] Optionally, usually, the data write location before the last power failure is the sector with the smallest number among all sectors whose data storage status is that there is data or there is an ECC error. The writable page in each sector is the page with the smallest number among all sectors whose data storage status is that there is no data. The data storage sector in each sector is all sectors whose data storage status is that there is data or there is an ECC error. The number of each page in the sector can be a pre-set digital number for uniquely identifying the page. The numbers of different pages in the sector are different.

[0058] Optionally, the FEE module determines the data write position before the last power outage, the writable pages in each sector, and the data storage sectors based on the data storage status of each sector, including: the FEE module determines the sector with the smallest number among all sectors whose data storage status is that there is data or there is an ECC error as the data write position before the last power outage; the FEE module determines the page with the smallest number among the sector with the smallest number among all sectors whose data storage status is that there is no data as the writable page in each sector; the FEE module determines all sectors whose data storage status is that there is data or there is an ECC error as the data storage sector in each sector.

[0059] Thus, the FEE module determines the data writing position before the last power failure, the writable pages in each sector, and the data storage sector according to the sector status flags of each sector.

[0060] Optionally, the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, and further includes: if the read status flag is the first traversal status flag or the second traversal status flag, the FEE module re-reads the sector status flag of each sector in the sector status register after waiting for a preset time. If the read status flag is the first traversal status flag or the second traversal status flag, indicating that the flash memory controller has not started the setting process or the flash memory controller is in the process of setting, the FEE module re-reads the sector status flag of each sector in the sector status register after waiting for a preset time.

[0061] Optionally, after receiving the initialization instruction, it also includes: if the reception time of the initialization instruction reaches the target time, and the latest read status flag is the first traversal status flag or the second traversal status flag, outputting an error message.

[0062] Optionally, the preset duration and the target duration may be two preset durations in the FEE module. The target duration is greater than the preset duration.

[0063] Optionally, the reception duration of the initialization instruction may refer to the duration between the current moment and the moment when the initialization instruction is received. After receiving the initialization instruction, the FEE module records the moment when the initialization instruction is received, and then monitors the reception duration of the initialization instruction. If the FEE module monitors that the reception duration of the initialization instruction reaches the target duration, and the latest read status flag is the first traversal status flag or the second traversal status flag, an error message is output.

[0064] Optionally, the error information may be information for prompting the flash memory controller that the setting process has not been completed for a long time. Outputting the error information includes: feeding back the error information to the software that sends the initialization instruction.

[0065] Optionally, after outputting the error information, the FEE module can continue to wait for the flash memory controller to complete the setup process, and can also directly determine the data storage status of each sector by reading each sector in the flash memory, and then determine the data write position before the last power outage, the writable pages in each sector, and the data storage sector based on the data storage status of each sector, thereby completing the initialization.

[0066] In the technical solution of the embodiment of the present invention, after the chip is powered on, the flash memory controller updates the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag, and then traverses each sector in the flash memory to determine the data storage status of each sector, and sets the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, updates the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes the initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register. The technical solution of the embodiment of the present invention solves the problem that the FEE module initialization solution in the related art requires the FEE module to determine the data storage status of each sector by reading each sector in the flash memory during the initialization process, which consumes a lot of time, resulting in a slow initialization speed of the FEE module and affecting the chip performance. The technical solution of the embodiment of the present invention can automatically traverse each sector in the flash memory through the flash memory controller after the chip is powered on, determine the data storage status of each sector, and set the sector status flag in the register used to characterize the data storage status of each sector according to the data storage status of each sector, thereby handing over the operation of traversing each sector in the flash memory and determining the data storage status of each sector to the hardware for execution, so that the FEE module can directly determine the data storage status of each sector according to the sector status flag of each sector in the register during the initialization process, and then determine the data write position before the last power failure, the writable page in each sector and the data storage sector according to the data storage status of each sector, thereby completing the initialization, saving the time for the FEE module to determine the data storage status of each sector by reading each sector in the flash memory, accelerating the initialization speed of the FEE module, and ensuring chip performance.

[0067] Optionally, in a specific example, the flash memory of the chip includes 64 sectors. The time for the FEE module in the chip to read a sector to determine the data storage state of the sector is about 200 microseconds, and the time for the FEE module to determine the data storage state of each sector by reading each sector in the flash memory is about 12.8 milliseconds.

[0068] Embodiment 2

[0069] Figure 8 The structure diagram of a FEE module initialization auxiliary device provided by an embodiment of the present invention is shown in FIG. The device can be configured in a flash memory controller. Figure 8 As shown, the device includes: a flag updating module 201 and a flag setting module 202.

[0070] Among them, the flag update module 201 is used to update the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag after the chip is powered on; the flag setting module 202 is used to traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes the initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

[0071] In the technical solution of the embodiment of the present invention, after the chip is powered on, the status flag in the flash memory traversal register is updated from the first traversal status flag to the second traversal status flag, and then the sectors in the flash memory are traversed to determine the data storage status of each sector, and the sector status flags of each sector in the sector status register are set according to the data storage status of each sector, and after the setting process is completed, the status flag in the flash memory traversal register is updated to the third traversal status flag, so that the FEE module completes the initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register. The technical solution of the embodiment of the present invention solves the problem that the FEE module initialization solution in the related art requires the FEE module to determine the data storage status of each sector by reading each sector in the flash memory during the initialization process, which consumes a lot of time, resulting in a slow initialization speed of the FEE module and affecting the chip performance. The technical solution of the embodiment of the present invention can automatically traverse each sector in the flash memory through the flash memory controller after the chip is powered on, determine the data storage status of each sector, and set the sector status flag in the register used to characterize the data storage status of each sector according to the data storage status of each sector, thereby handing over the operation of traversing each sector in the flash memory and determining the data storage status of each sector to the hardware for execution, so that the FEE module can directly determine the data storage status of each sector according to the sector status flag of each sector in the register during the initialization process, and then determine the data write position before the last power failure, the writable page in each sector and the data storage sector according to the data storage status of each sector, thereby completing the initialization, saving the time for the FEE module to determine the data storage status of each sector by reading each sector in the flash memory, accelerating the initialization speed of the FEE module, and ensuring chip performance.

[0072] In an optional implementation of an embodiment of the present invention, optionally, the flag setting module 202 is specifically used to: traverse each sector in the flash memory in order of the sector number from small to large, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector.

[0073] In an optional implementation of an embodiment of the present invention, optionally, when the flag setting module 202 performs the operation of determining the data storage status of each sector and setting the sector status flag of each sector in the sector status register according to the data storage status of each sector, it is specifically used to: perform the following operations for each sector in the flash memory: check whether data is stored in each page in the sector and whether the data stored in the page storing the data is readable; if data is stored in at least one page in the sector and the data stored in each page storing the data is readable, then determine that the data storage status of the sector is that there is data, and set the sector status flag of the sector in the sector status register to the first sector status flag.

[0074] In an optional implementation of an embodiment of the present invention, optionally, the flag setting module 202 is also used to: if no data is stored in each page in the sector, determine that the data storage status of the sector is no data, and set the sector status flag of the sector in the sector status register to the second sector status flag.

[0075] In an optional implementation of an embodiment of the present invention, optionally, the flag setting module 202 is also used for: if data is stored in at least one page in the sector, and the data stored in the target page in each page storing the data is unreadable, then determining that the data storage status of the sector is that there is an ECC error, and setting the sector status flag of the sector in the sector status register to a third sector status flag.

[0076] In an optional implementation of an embodiment of the present invention, optionally, the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, including: after receiving the initialization instruction, the FEE module reads the status flag in the flash memory traversal register; if the read status flag is the third traversal status flag, the FEE module reads the sector status flag of each sector in the sector status register, and determines the data write position before the last power failure, the writable pages in each sector and the data storage sector according to the sector status flags of each sector, thereby completing the initialization.

[0077] In an optional implementation of an embodiment of the present invention, optionally, the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, and also includes: if the read status flag is the first traversal status flag or the second traversal status flag, the FEE module waits for a preset period of time and then re-reads the sector status flag of each sector in the sector status register.

[0078] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0079] The above-mentioned FEE module initialization auxiliary device can execute the FEE module initialization auxiliary method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the FEE module initialization auxiliary method.

[0080] Embodiment 3

[0081] Fig. 9 The structural diagram of the electronic device 10 that can be used to implement the FEE module initialization auxiliary method of the embodiment of the present invention is shown. The components shown herein, their connections and relationships, and their functions are only for example, and are not intended to limit the implementation of the present invention described and / or required herein.

[0082] like Fig. 9 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program built from the storage unit 18 to the random access memory (RAM) 13. In the random access memory (RAM) 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the read-only memory (ROM) 12 and the random access memory (RAM) 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0083] A number of components in the electronic device 10 are connected to an input / output (I / O) interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0084] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the FEE module initialization auxiliary method.

[0085] In some embodiments, the FEE module initialization assistance method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via a read-only memory (ROM) 12 and / or a communication unit 19. When the computer program is built into a random access memory (RAM) 13 and executed by the processor 11, one or more steps of the FEE module initialization assistance method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the FEE module initialization assistance method in any other appropriate manner (e.g., by means of firmware).

[0086] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0087] The computer program for implementing the FEE module initialization auxiliary method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the computer program, when executed by the processor, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or completely on a remote machine or server.

[0088] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0089] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0090] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0091] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0092] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0093] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A FEE module initialization auxiliary method, characterized in that: Used in flash memory controllers, including: After the chip is powered on, the status flag in the flash memory traversal register is updated from the first traversal status flag to the second traversal status flag; Traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to the third traversal status flag, so that the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

2. The FEE module initialization auxiliary method according to claim 1, characterized in that: Traversing each sector in the flash memory, determining the data storage status of each sector, and setting the sector status flag of each sector in the sector status register according to the data storage status of each sector, including: According to the order of the numbers of each sector from small to large, the sectors in the flash memory are traversed in turn to determine the data storage status of each sector, and the sector status flag of each sector in the sector status register is set according to the data storage status of each sector.

3. The FEE module initialization auxiliary method according to claim 1, characterized in that: Determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, including: For each sector in the flash memory, perform the following operations: Check whether data is stored in each page in the sector and whether the data stored in the page storing data is readable; If data is stored in at least one page in the sector and the data stored in each page storing data is readable, the data storage state of the sector is determined to be data present, and the sector state flag of the sector in the sector state register is set to the first sector state flag.

4. The FEE module initialization auxiliary method according to claim 3, characterized in that: After checking whether data is stored in each page in the sector and whether the data stored in the page storing data is readable, the following further includes: If no data is stored in each page in the sector, it is determined that the data storage state of the sector is no data, and the sector state flag of the sector in the sector state register is set to a second sector state flag.

5. The FEE module initialization auxiliary method according to claim 3, characterized in that: After checking whether data is stored in each page in the sector and whether the data stored in the page storing data is readable, the following further includes: If data is stored in at least one page in the sector, and the data stored in the target page in each page storing data is unreadable, the data storage status of the sector is determined to be an ECC error, and the sector status flag of the sector in the sector status register is set to the third sector status flag.

6. The FEE module initialization auxiliary method according to claim 1, characterized in that: The FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, including: After receiving the initialization instruction, the FEE module reads the status flag in the flash memory traversal register; If the read status flag is the third traversal status flag, the FEE module reads the sector status flags of each sector in the sector status register, and determines the data write position before the last power failure, the writable pages in each sector and the data storage sector according to the sector status flags of each sector, thereby completing initialization.

7. The FEE module initialization auxiliary method according to claim 6, characterized in that: The FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register, and further includes: If the read status flag is the first traversal status flag or the second traversal status flag, the FEE module waits for a preset time period and then re-reads the sector status flags of each sector in the sector status register.

8. A FEE module initialization auxiliary device, characterized in that: Configured in the flash memory controller, including: A flag update module, used for updating the status flag in the flash memory traversal register from the first traversal status flag to the second traversal status flag after the chip is powered on; A flag setting module is used to traverse each sector in the flash memory, determine the data storage status of each sector, and set the sector status flag of each sector in the sector status register according to the data storage status of each sector, and after the setting process is completed, update the status flag in the flash memory traversal register to a third traversal status flag, so that the FEE module completes initialization according to the status flag in the flash memory traversal register and the sector status flag of each sector in the sector status register.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the FEE module initialization auxiliary method described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the FEE module initialization auxiliary method described in any one of claims 1-7 when executed.