NVM data storage method
By dividing the NVM address area into a data storage area and a storage address recording area, and adopting a loop mechanism and a verification mechanism, the problems of low NVM data storage efficiency and time-consuming address search are solved, and more efficient address search and storage are achieved.
Patent Information
- Application Number
- CN202510555180.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, NVM has low data storage efficiency in the field of aeronautical electromechanical and mechanical, and it takes too long to find the current storage address and is not very accurate.
The NVM address area is divided into a data storage area and a storage address recording area. The data storage area is stored according to a loop mechanism and returns to the starting address when stored at the end address; the storage address record area grouped and recorded the current storage address and checked. The address that passed the verification is a valid address. If no valid address is found, the starting address will be taken. If multiple valid addresses are taken, the latest or flipped small address will be taken.
Shorten the time to find address, improve the accuracy and storage efficiency of address data.
Smart Images

Figure CN120491894A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of aviation electromechanical technology and relates to a NVM data storage method. Background Art
[0002] NVM is the abbreviation of non-volatile memory. NVM data can be accessed directly through addresses, which makes read and write operations more convenient. In addition, the stored data in NVM is not lost after power failure. It has a wide range of application prospects. In the field of aviation electromechanical technology, NVM is increasingly used for data storage.
[0003] At present, when NVM is used for data storage in the field of aviation electromechanical, the method of storing data from the starting address of NVM is adopted. Each time storage is performed, storage starts from a fixed address. This method will cause the original memory data of NVM to be overwritten, and the storage efficiency is low. In order to improve storage efficiency, a circular method is often used for NVM data storage, that is, the storage address is continuously moved backward, and when the storage reaches the end address, it returns to the starting address for storage. The circular storage method requires real-time update and recording of the current storage address. Each time the power is turned on, the latest storage address in the entire memory of NVM needs to be queried, and then data can be stored. The current method for finding the current storage address is the polling search method, which is to search the entire memory address of NVM from the starting address. When an empty address is found, it is the current storage address. This method takes a long time to poll the address and has low search efficiency, resulting in low NVM data storage efficiency. Summary of the Invention
[0004] Purpose of the Invention
[0005] The present invention provides a NVM data storage method, which aims to solve the problems of low NVM storage efficiency, long time consumption and low accuracy in searching the current storage address, and provides a practical solution to the above problems.
[0006] Technical Solution
[0007] The present invention provides a method for storing NVM data, which divides the NVM address area into two storage areas: a data storage area and a storage address recording area. The data storage area stores periodic or trigger event information data, while the storage address recording area records the current storage address data of the data storage area. The data storage area stores data in a circular mechanism, returning to the starting address for storage when the last address is stored. The storage address recording system records the current storage address data in a circular manner by differentiating the address groups. Each address record group includes address data and a check code. The address data is checked and calculated, and the check code is recorded. Address data that passes the check is considered a valid address. During data storage, the current storage address is recorded in real time in the storage address recording area.
[0008] Furthermore, when no valid address is found, the storage start address is taken.
[0009] Furthermore, when there are multiple valid addresses, the latest address data is taken as the current storage address.
[0010] Furthermore, when an address flip occurs among multiple valid addresses, the smaller address after the flip is taken as the current storage address.
[0011] Further implementation steps are as follows:
[0012] Step 1: After the product is powered on, the software starts running, searches for the current storage address in the storage address record area, reads 10 sets of address data, verifies each set of address data, updates the valid address data if the verification passes, and increases the number of valid address data by 1;
[0013] Further, step 2: when the number of valid addresses is 0 and no valid address is found, the starting address is taken as the current storage address; when there are multiple valid addresses, the latest address data is taken as the current storage address; when an address flip occurs in the valid address data, the smaller address after the flip is taken as the current storage address;
[0014] Furthermore, in step 3: after finding the current storage address, the software runs periodically to determine in real time whether the conditions for triggering data storage (such as the expiration of the cycle time or the occurrence of a fault trigger) are met. If the storage conditions are met, the system status information is stored in the data storage area. The current storage address is moved backward. If the address data exceeds the end address, the current storage address is updated to the starting address. After updating the current storage address, the check code of the storage address data is calculated, and the address data and the check code are stored simultaneously in the address recording area.
[0015] Furthermore, step 4: the software runs periodically, and the current data storage ends when the current product is powered off, otherwise a real-time query is performed to determine whether data storage is triggered.
[0016] The beneficial effects of this application are:
[0017] The NVM storage method shortens the address search time, ensures the validity of address search data, improves the accuracy of address data, and greatly improves the NVM storage data efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Flowchart for NVM data storage. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the implementation of the present invention clearer, the technical solutions in the embodiments of the present invention will be described in more detail below in conjunction with the embodiments of the present invention. In the examples, the same or similar reference numerals throughout represent the same or similar originals or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, not all of the embodiments. The embodiments described below by reference are illustrative and intended to be used to explain the present invention, and should not be understood as limiting the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The following is a detailed description in conjunction with the embodiments of the present invention.
[0020] The following is combined with Figure 1 The present invention is described in further detail.
[0021] To address the problems of low NVM storage efficiency, long search times, and low accuracy in finding the current storage address, a NVM data storage method is provided. The method divides the NVM into a data storage area and a storage address recording area. The data storage area stores periodic or trigger event information data, while the storage address recording area records the current storage address data in the data storage area. The data storage area stores data in a circular mechanism, returning to the starting address for storage when the last address is stored. The storage address recording records the current storage address data in a circular manner, with each group of address records including address data and a check code. The address data is checked and calculated, and the check code is recorded. Address data that passes the check is considered a valid address. If no valid address is found, the storage starting address is used. If multiple valid addresses are found, the latest address data is used as the current storage address. If an address flip occurs among multiple valid addresses, the smaller address after the flip is used as the current storage address. During data storage, the current storage address is recorded in real time in the storage address recording area. This NVM storage method shortens the address search time, ensures the validity of the address search data, improves the accuracy of the address data, and greatly improves the efficiency of NVM data storage.
[0022] NVM stands for non-volatile memory. Data in NVM can be accessed directly by address, offering convenient read and write operations. Furthermore, stored data in NVM persists even after a power outage, making it a promising candidate for widespread application. NVM is increasingly being used for data storage in aerospace electromechanical technology. Traditionally, NVM storage in this field began at a fixed address, which overwrote existing NVM memory and resulted in low storage efficiency. To improve storage efficiency, a circular approach is often used for NVM data storage, where the storage address is continuously shifted backwards, returning to the starting address when the last address is reached. This circular approach requires real-time recording of the current storage address. Each time the power is turned on, the entire NVM memory is queried for the latest storage address before continuing to store data. Currently, a polling method is used to find the current storage address. This method searches the entire NVM memory from the starting address, finding an empty address as the current storage address. This method is time-consuming and inefficient, resulting in low NVM data storage efficiency.
[0023] The present invention provides an NVM data storage method, which divides the NVM into a data storage area and a storage address recording area. The data storage area stores periodic or trigger event information data, and the storage address recording area records the current storage address data of the data storage area in this area. The data storage area stores data according to a circular mechanism, and when the storage reaches the end address, it returns to the starting address for storage; the storage address record records the current storage address data in a circular manner by distinguishing several groups of addresses, each group of address records includes address data and a check code, and the address data is checked and calculated and the check code is recorded. The address data that passes the check is the valid address. When no valid address is found, the storage starting address is taken. When there are multiple valid addresses, the latest address data is taken as the current storage address. When an address flip occurs in multiple valid addresses, the smaller address after the flip is taken as the current storage address. During the data storage process, the current storage address is recorded in the storage address recording area in real time.
[0024] Implementation Examples
[0025] See attached Figure 1 ,
[0026] In one embodiment of the present invention, the NVM storage includes two storage areas: a data storage area and a storage address recording area. The data storage area stores periodic or trigger event information data, and the storage address recording area records the current storage address data of the data storage area.
[0027] In a certain embodiment of the present invention, the data storage area stores data according to a circular mechanism, and when the storage reaches the end address, it returns to the starting address for storage.
[0028] In a certain implementation case of the present invention, the storage address record is divided into several groups of addresses to cyclically record the current storage address data, thereby improving the reliability of the storage address.
[0029] In a certain embodiment of the present invention, each set of address records includes address data and a check code. The address data is checked and calculated and the check code is recorded to ensure the validity of the address data.
[0030] In a certain embodiment of the present invention, the storage address records are divided into 10 groups, and the address data of each group of address records occupies 4 bytes and the check code occupies 2 bytes.
[0031] In a certain embodiment of the present invention, the address data of the storage address recording area is verified as follows: the address data is first low and then high, and the sum of the four bytes is inverted and added with 1.
[0032] In a certain embodiment of the present invention, when the software is running, the NVM data storage address is searched in the storage address record area, and the address data that passes the verification is a valid address.
[0033] In a certain implementation case of the present invention, when no valid address is found, the storage start address is taken; when there are multiple valid addresses, the latest address data is taken as the current storage address; when address flip occurs among multiple valid addresses, the smaller address after flip is taken as the current storage address.
[0034] In a certain implementation case of the present invention, after the current storage address is found, the data storage area starts to store data at the current storage address, and during the data storage process, the current storage address is recorded in the storage address recording area in real time.
[0035] In addition, unless otherwise defined, the technical or scientific terms used in the description of this application should have the ordinary meanings understood by those of ordinary skill in the art to which this application belongs. The words "upper," "lower," "left," "right," "center," "vertical," "horizontal," "inner," and "outer" used in the description of this application are only used to indicate relative directions or positional relationships, and do not imply that the device or component must have a specific orientation, be constructed, or operate in a specific orientation. When the absolute position of the described object changes, its relative positional relationship may also change accordingly. Therefore, they should not be understood as limitations on this application. The words "first," "second," "third," and similar terms used in the description of this application are used only for descriptive purposes to distinguish different components and should not be understood to indicate or imply relative importance. The words "one," "an," or "the" used in the description of this application should not be understood as absolute limitations on quantity, but should be understood as meaning the presence of at least one. The words "include" or "comprises" used in the description of this application mean that the element or object listed before the word includes the elements or objects listed after the word and their equivalents, but does not exclude other elements or objects.
[0036] In addition, it should be noted that, unless otherwise clearly stipulated and limited, the words "install", "connect", "connect" and similar terms used in the description of this application should be understood in a broad sense. For example, the connection can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, an indirect connection through an intermediate medium, or a connection between two components. Technical personnel in the field can understand their specific meanings in this application according to the specific circumstances.
[0037] The above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Within the spirit and principles of the present invention, any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention, any modification, equivalent replacement, improvement, etc. made should be included in the scope of protection of the present invention.
Claims
1. A NVM data storage method, characterized in that: The NVM address area is divided into two storage areas: a data storage area and a storage address recording area; the data storage area stores cycle or trigger event information data, and the storage address recording area records the current storage address data of the data storage area in this area; The data storage area stores data according to a circular mechanism, and returns to the starting address for storage when the storage reaches the end address; the storage address record is divided into several groups of addresses to cyclically record the current storage address data. Each group of address records includes address data and a check code. The address data is checked and calculated and the check code is recorded; the address data that passes the check is a valid address, and the current storage address is recorded in the storage address record area in real time during the data storage process.
2. The method according to claim 1, wherein If no valid address is found, the storage start address is taken.
3. The method according to claim 1, wherein When there are multiple valid addresses, the latest address data is taken as the current storage address.
4. The method according to claim 1, wherein When address flip occurs among multiple valid addresses, the smaller address after flip is taken as the current storage address.
5. The method according to claim 1, wherein The implementation steps are as follows: Step 1: After the product is powered on, the software starts running, searches for the current storage address in the storage address record area, reads 10 groups of address data, verifies each group of address data, updates the valid address data when the verification is passed, and increases the number of valid address data by 1.
6. The method according to claim 5, wherein Step 2: When the number of valid addresses is 0, no valid address is found, and the starting address is taken as the current storage address. When there are multiple valid addresses, the latest address data is taken as the current storage address. When address flip occurs in the valid address data, the smaller address after flip is taken as the current storage address.
7. The method according to claim 6, wherein Step 3: After finding the current storage address, the software runs cyclically to determine in real time whether the conditions for triggering data storage are met. When the storage conditions are met, the system status information is stored in the data storage area. The current storage address moves backward. When it is determined that the address data exceeds the tail address, the current storage address is updated to the starting address. After updating the current storage address, the check code of the storage address data is calculated, and the address data and the check code are stored in the address record area at the same time.
8. The method according to claim 7, wherein Step 4: The software runs periodically. The data storage ends when the current product is powered off. Otherwise, a real-time query is performed to determine whether data storage is triggered.