Data management method and device, computer device and storage medium

CN120196556BActive Publication Date: 2026-10-30DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311793695.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-23
Publication Date
2026-10-30
Estimated Expiration
2043-12-23

AI Technical Summary

Technical Problem

[0004]然而,传统的OTP数据管理方法中,简单的数据分区熔断,分区索引造成大量的存储空间的浪费,降低OTP的查询性能,进而,降低了OTP的数据管理效率

Benefits of technology

[0054]上述数据管理方法、装置、计算机设备、存储介质和计算机程序产品,获取待存储数据,并基于预设的存储规则以及逐比特位熔断写入方式,将所述待存储数据逐比特位写入至所述存储区域的目标存储位置,进行熔断处理;基于所述目标存储位置,以及预设的索引值中比特位与所述存储区域的存储位置的对应关系,确定所述目标存储位置的待存储数据对应的目标索引值;基于所述存储规则,将所述目标索引值存储至所述索引区域的目标索引存储位置。采用本方法,通过逐比特位熔断写入方式,以更小的写入颗粒度进行数据写入,避免简单分区写入造成的存储空间的浪费。并且,基于索引值中比特位与存储区域的存储位置的对应关系,确定存储区域中每一比特位上的待存储数据对应的目标索引值,进而,将目标索引值存储至索引区域的目标索引位置,以实现通过目标索引值快速查询待存储数据,提高了一次性可编程存储器的数据管理效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196556B_ABST
    Figure CN120196556B_ABST
Patent Text Reader

Abstract

The application relates to a data management method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining to-be-stored data, and writing the to-be-stored data into a target storage position of a storage area bit by bit based on a preset storage rule and a bit-by-bit fuse writing mode to perform a fuse processing; determining a target index value corresponding to the to-be-stored data of the target storage position based on the target storage position and a preset correspondence between bit positions in the index value and storage positions of the storage area; and storing the target index value into a target index storage position of an index area based on the storage rule. The method can improve the data management efficiency of one-time programmable memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory technology, and in particular to a data management method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the continuous development of information technology, more and more information systems have added multi-factor authentication functions for security reasons. There are various solutions to implement multi-factor authentication, and OTP (One-Time Programmable) is one of the simpler solutions.

[0003] In traditional OTP data management methods, data is written in a partitioned manner, either by partition, or by byte or even word. Once each region is used up, the storage structure in the memory is physically shut down to ensure that the written data cannot be modified. Then, the written data can be retrieved through partition address mapping.

[0004] However, in traditional OTP data management methods, simple data partitioning and circuit breaking, and partition indexes result in a large waste of storage space, reduce OTP query performance, and consequently reduce OTP data management efficiency. Summary of the Invention

[0005] Therefore, it is necessary to provide a data management method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0006] In a first aspect, this application provides a data management method applied to a one-time programmable memory, the one-time programmable memory being pre-configured with an index area and a storage area, the method comprising:

[0007] The data to be stored is obtained, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location of the storage area, and the circuit breaker process is performed.

[0008] Based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, the target index value corresponding to the data to be stored at the target storage location is determined.

[0009] Based on the storage rules, the target index value is stored in the target index storage location of the index region.

[0010] In this embodiment, a bit-by-bit fuse-based write method is used to write data with smaller write granularity, avoiding the waste of storage space caused by simple partition writes and improving the utilization rate of OTP storage space. Furthermore, based on the correspondence between bits in the index value and the storage location of the storage area, the target index value corresponding to the data to be stored on each bit in the storage area is determined. Then, the target index value is stored in the target index location of the index area, enabling fast querying of the data to be stored through the target index value, thus improving the data management efficiency of the one-time programmable memory.

[0011] In one embodiment, the storage region includes multiple storage sub-regions. The step of writing the data to be stored bit by bit to the target storage location in the storage region based on preset storage rules and a bit-by-bit circuit breaker writing method, and performing circuit breaker processing, includes:

[0012] Based on the storage rule of storing from low storage sub-intervals to high storage sub-intervals, the first free storage sub-interval in the storage area is queried from low to high and used as the target storage sub-interval.

[0013] The data to be stored is written bit by bit to the target storage location of the target storage sub-interval, and a circuit breaker is performed after each bit of the data to be stored is written.

[0014] In this embodiment, data writing management is performed on the data to be stored by using preset storage rules and a bit-by-bit circuit breaker writing method. The bit-by-bit writing method reduces the granularity of data writing, avoids the waste of OTP storage space, and thus improves the OTP data storage performance.

[0015] In one embodiment, determining the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between bits in the preset index value and the storage location of the storage area includes:

[0016] A circuit breaker query is performed from the low storage sub-interval to the high storage sub-interval to determine the target storage location of the data to be stored in the target storage sub-interval of the storage area; the target storage location is the target storage sub-interval.

[0017] Based on the target storage sub-interval and the correspondence between the bits in the preset index value and the storage sub-interval, a target index value is generated to characterize the valid stored data stored in the target storage sub-interval.

[0018] In this embodiment, based on the correspondence between the bits in the index value and the storage sub-intervals of the storage area, the target index value corresponding to the data to be stored is determined. Then, the target index value is stored in the target index position of the index area to enable quick querying of the data to be stored through the target index value, thereby improving the data management efficiency of the one-time programmable memory.

[0019] In one embodiment, the method further includes:

[0020] In response to the addition of new data to be stored, the original data to be stored is destroyed.

[0021] New data to be stored is acquired, and based on preset storage rules and a bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to a new target storage location in the storage area, and circuit breaker processing is performed.

[0022] In this embodiment, the original data to be stored that has already been written into the storage space is destroyed to ensure the unique validity of the new data to be stored that is newly written into the storage space. Thus, it is ensured that each index value points to usable data to be stored.

[0023] In one embodiment, the method further includes:

[0024] In response to the addition of new data to be stored, retrieve the new data to be stored;

[0025] Based on preset storage rules and a bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to the new target storage location in the storage area for circuit breaker processing.

[0026] The step of determining the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between bits in the preset index value and the storage location of the storage area includes:

[0027] Based on the new target storage location of the new data to be stored, and the correspondence between the bits in the preset index value and the storage location of the storage area, a new target index value corresponding to the data to be stored at the new target storage location is determined.

[0028] In this embodiment, by writing new data to be stored to a new target storage location in the storage area, a new target index value is generated, while the original data to be stored and its corresponding target index value are retained. During data queries, the latest version and the original version of the data to be stored can be retrieved based on different index values, ensuring the rollback capability of the stored data.

[0029] In one embodiment, after storing the target index value to the target index storage location of the index region based on the storage rules, the method further includes:

[0030] Based on the target index value and the correspondence between each bit contained in the target index value and the storage sub-interval in the storage space, data is stored in the target storage sub-interval corresponding to the target bit in each storage sub-interval of the storage area.

[0031] The target bit is the bit in the target index value used to represent the storage of valid data.

[0032] In this embodiment, the target index value allows for rapid location of stored data within the storage space, enabling fast querying of stored data within the target storage sub-range. This, in turn, improves the efficiency of OTP data management.

[0033] In one embodiment, the method further includes:

[0034] Obtain the index value within the indexed region, and perform operations on the index value bit by bit based on a preset calculation algorithm to obtain the calculation result;

[0035] Based on the calculation results, the storage area occupancy result is determined;

[0036] When the storage area occupancy result is that all storage sub-areas contained in the storage area are occupied, information indicating that the one-time programmable memory cannot support data addition is output.

[0037] In this embodiment, the index value of the index area is processed bitwise using a preset calculation algorithm to obtain the current OTP storage area occupancy result. Then, based on the storage area occupancy result, it is determined whether new data to be stored can be written. This achieves pre-detection of whether data can be successfully written, improving the efficiency of data management in OTP.

[0038] Secondly, this application also provides a data management device, which is applied to a one-time programmable memory, the one-time programmable memory being pre-configured with an index area and a storage area, including:

[0039] The acquisition and writing module is used to acquire the data to be stored, and write the data to be stored bit by bit to the target storage location of the storage area based on the preset storage rules and the bit-by-bit circuit breaker writing method, and perform circuit breaker processing.

[0040] The determining module is used to determine the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area;

[0041] A storage module is used to store the target index value to the target index storage location of the index region based on the storage rules.

[0042] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0043] The data to be stored is obtained, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location of the storage area, and the circuit breaker process is performed.

[0044] Based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, the target index value corresponding to the data to be stored at the target storage location is determined.

[0045] Based on the storage rules, the target index value is stored in the target index storage location of the index region.

[0046] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0047] The data to be stored is obtained, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location of the storage area, and the circuit breaker process is performed.

[0048] Based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, the target index value corresponding to the data to be stored at the target storage location is determined.

[0049] Based on the storage rules, the target index value is stored in the target index storage location of the index region.

[0050] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0051] The data to be stored is obtained, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location of the storage area, and the circuit breaker process is performed.

[0052] Based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, the target index value corresponding to the data to be stored at the target storage location is determined.

[0053] Based on the storage rules, the target index value is stored in the target index storage location of the index region.

[0054] The aforementioned data management method, apparatus, computer equipment, storage medium, and computer program product acquire data to be stored and, based on preset storage rules and a bit-by-bit circuit breaker write method, write the data to be stored bit by bit to the target storage location of the storage area, performing circuit breaker processing; based on the target storage location and the correspondence between bits in the preset index value and storage locations in the storage area, determine the target index value corresponding to the data to be stored at the target storage location; and based on the storage rules, store the target index value in the target index storage location of the index area. This method, through a bit-by-bit circuit breaker write method, performs data writing with smaller write granularity, avoiding the waste of storage space caused by simple partition writing. Furthermore, based on the correspondence between bits in the index value and storage locations in the storage area, the target index value corresponding to the data to be stored at each bit in the storage area is determined, and then the target index value is stored in the target index location of the index area, enabling fast querying of the data to be stored through the target index value, thus improving the data management efficiency of the one-time programmable memory. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a flowchart illustrating a data management method in one embodiment;

[0057] Figure 2 This is a flowchart illustrating the bit-by-bit writing circuit breaker steps in one embodiment;

[0058] Figure 3 This is a flowchart illustrating the steps for generating the target index value in one embodiment;

[0059] Figure 4 This is a schematic diagram illustrating the correspondence between storage areas and index areas in the OTP storage space in another embodiment;

[0060] Figure 5 A flowchart illustrating a method for writing new data to be stored in one embodiment;

[0061] Figure 6 A flowchart illustrating another novel method for writing data to be stored in one embodiment;

[0062] Figure 7 This is a schematic diagram of a process for calculating storage space usage in one embodiment;

[0063] Figure 8 This is a structural block diagram of a data management device in one embodiment;

[0064] Figure 9 This is an internal structural diagram of a computer device in one embodiment;

[0065] Figure 10 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0067] In one embodiment, such as Figure 1 As shown, a data management method is provided. This embodiment illustrates the application of this method to a one-time programmable memory (OTP). The OTP memory can be integrated into either a terminal device or a server. On a terminal device, the OTP memory can be part of a hardware security module (HSM) to store critical data such as unique identifiers and encryption keys, ensuring that this data is not stolen or tampered with by malicious software or attackers. Simultaneously, the OTP memory can also serve as a firmware anti-tampering measure, preventing software from being tampered with, modified, or damaged. On a server, the OTP memory can be part of an authentication server to store user authentication information, such as mobile SMS verification codes, HOTP (Hash-Based One-Time Password), or TOTP (Time-Based One-Time Password), providing a more secure and reliable authentication mechanism. Whether on a terminal device or a server, the OTP memory can provide important data protection and security functions, helping users ensure the security and integrity of their private data. This embodiment does not limit the execution device of the OTP. In this embodiment, the method includes the following steps:

[0068] Step 102: Obtain the data to be stored, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, write the data to be stored bit by bit to the target storage location in the storage area and perform circuit breaker processing.

[0069] In implementation, One-Time Programmable Memory (OTP) stores data such as chip calibration parameters, unique identifiers, and keys within its storage space. Therefore, when data needs to be solidified or data security improved, data can be stored in the OTP storage space. Specifically, the OTP storage space is pre-configured into storage areas and index areas. The OTP acquires the data to be stored and, based on preset storage rules and a bit-by-bit fuse-based write method, writes the data bit by bit to the target storage location within the storage area. Once the data for a given bit has been written, the fuse is triggered.

[0070] Step 104: Based on the target storage location and the correspondence between bits in the preset index value and storage locations in the storage area, determine the target index value corresponding to the data to be stored at the target storage location.

[0071] In implementation, the circuit breaker position in the storage area is detected. This circuit breaker position is the target storage location of the data to be stored, meaning that data is being written at the current circuit breaker position. In the pre-configured index value construction rules, each bit in the index value corresponds to a storage sub-interval in the storage area. Therefore, there is a preset correspondence between the bits in the index value and the storage locations in the storage area, i.e., a correspondence between the bits in the index value and the storage sub-intervals in the storage area. Based on the target storage location (and its corresponding target storage sub-interval) and the preset correspondence between the bits in the index value and the storage locations in the storage area, OTP determines the target index value corresponding to the data to be stored at the target storage location. This target index value is used for data retrieval of the data to be stored.

[0072] Step 106: Based on the storage rules, store the target index value to the target index storage location in the index area.

[0073] In practice, based on the target index value corresponding to the determined data to be stored, OTP stores the target index value to the target index storage location in the index area according to the storage rule.

[0074] In the aforementioned data management method, a bit-by-bit fuse-based write approach is used to write data with finer granularity, avoiding the storage space waste caused by simple partition writing and improving the utilization rate of OTP storage space. Furthermore, based on the correspondence between bits in the index value and the storage location of the storage area, the target index value corresponding to the data to be stored on each bit in the storage area is determined. Then, the target index value is stored in the target index location of the index area, enabling fast retrieval of the data to be stored through the target index value, thus improving the data management efficiency of the one-time programmable memory.

[0075] In an exemplary embodiment, the OTP's storage space is pre-divided into multiple parts (represented by sections). Based on these parts, it is further divided into an index region and a storage region. The storage region contains multiple sub-storage areas, such as... Figure 2 As shown, in step 102, based on preset storage rules and a bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location in the storage area. The specific process for circuit breaker processing includes steps 202 to 206. Among them:

[0076] Step 202: Based on the storage rule of storing from low storage sub-intervals to high storage sub-intervals, the first free storage sub-interval in the storage area is queried from low to high and used as the target storage sub-interval.

[0077] In implementation, when new data is written, the writing priority is from low to high storage sub-intervals, following the storage rule of storing data sequentially from low to high storage sub-intervals. Taking an OTP storage space divided into 64 sections as an example, each section is 32 bytes, and each section has corresponding numbering information (0-64). Section 0 serves as an index area, used to store the index information of the data to be stored. Sections 1-63 form the storage area, used to store the data to be stored. Furthermore, sections 1-63 within the storage area can also be referred to as storage sub-intervals within the storage area; that is, section 1 is the first storage sub-interval in the storage area, and so on, with section 63 being the 63rd storage sub-interval. The section numbering information from low to high corresponds to the order in which the storage sub-intervals are written according to the storage rule. Therefore, when storing data, OTP searches for unused storage locations across multiple storage sub-intervals. When the first storage sub-interval is found from low to high resolution, it is designated as the target storage sub-interval for storing the data. For example, during the process of traversing sections 1-63 from low to high resolution, if section 3 is found and is unused, then section 3 is selected as the target storage sub-interval for storing the data.

[0078] Optionally, the data to be stored may include, but is not limited to, calibration parameters, unique identifiers, keys, etc., for chips, sensors, etc. This application does not limit this.

[0079] Step 204: Write the data to be stored bit by bit to the target storage location of the target storage sub-interval, and perform circuit breaking after each bit of data to be stored is written.

[0080] In practice, OTP uses a bit-by-bit circuit breaker writing method, which performs circuit breaker processing every time a bit of data to be stored is written into the target storage sub-interval.

[0081] In this embodiment, data writing management is performed on the data to be stored by using preset storage rules and a bit-by-bit circuit breaker writing method. The bit-by-bit writing method reduces the granularity of data writing, avoids the waste of OTP storage space, and thus improves the OTP data storage performance.

[0082] In one exemplary embodiment, such as Figure 3As shown, the specific processing steps in step 104, which determine the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, include steps 302 to 306.

[0083] in:

[0084] Step 302: Perform circuit breaker query from low storage sub-interval to high storage sub-interval to determine the target storage location of the data to be stored in the target storage sub-interval of the storage area.

[0085] The target storage location is the target storage sub-interval.

[0086] In implementation, the index region in the OTP storage space can be represented by a DATAINDEX. The index values ​​contained in this DATAINDEX correspond to the storage location of the data to be stored (represented by DATA). Therefore, when the data to be stored is written and circuit breaking is completed in the storage region, OTP can perform circuit breaking queries from the lower storage sub-interval to the higher storage sub-interval, discovering a new circuit breaking bit. This new circuit breaking bit is the target storage location of the data to be stored in the target storage sub-interval of the storage region. Furthermore, based on the determined target storage location of the data to be stored, the corresponding index value can be generated.

[0087] Step 304: Based on the target storage sub-interval and the correspondence between bits in the preset index value and the storage sub-interval, generate a target index value to characterize the valid stored data stored in the target storage sub-interval.

[0088] In implementation, within the OTP storage space, the index area (DATAINDEX) is divided into multiple index intervals based on the different data types of the data to be stored. The bits of each index interval, i.e., the bits of the index value stored in each index interval, correspond to the storage location within the storage sub-interval. Therefore, OTP generates a target index value representing the valid stored data corresponding to the target storage sub-interval, based on the target storage location of the data to be stored within the storage area and the pre-defined correspondence between the bits in the index value and the storage sub-interval. This target index value enables fast retrieval of the data to be stored.

[0089] Specifically, such as Figure 4As shown, continuing with the example of a storage space containing 64 sections in the above embodiment, section 0 serves as the index area DATA INDEX, which is 32 bytes in size. DATA INDEX contains four index intervals, DATA1INDEX to DATA4INDEX, each used to store the index value of data of a specific data type. Each index interval corresponds to 8 bytes. Each byte is 8 bits, so each index interval corresponds to 64 bits. Therefore, the 64 bits in each index interval can be one-to-one corresponded to sections 0-63 in the storage area. For example, DATA1INDEX occupies bytes 0-7 of the index area, with each byte corresponding to 8 bits. Thus, the DATA1INDEX index interval can be one-to-one corresponded to sections 0-63 (storage sub-intervals) in the storage area. When a bit in this index interval is set to 1, it indicates that valid storage data is stored in the target storage sub-interval within the corresponding storage area. Therefore, after determining the target storage sub-interval of the data to be stored, based on this correspondence, it is possible to reversely determine which bit in the index value corresponding to the data to be stored is set to 1 (the remaining bits are set to 0), and generate the target index value representing the storage of valid data in the target storage sub-interval.

[0090] Optionally, when the index information of DATAINDEX cannot meet the data type requirements for storing data, the number of index information contained in DATAINDEX can be increased. This application embodiment does not limit the number of index information in the index area.

[0091] In this embodiment, based on the correspondence between the bits in the index value and the storage sub-intervals of the storage area, the target index value corresponding to the data to be stored is determined. Then, the target index value is stored in the target index position of the index area to enable quick querying of the data to be stored through the target index value, thereby improving the data management efficiency of the one-time programmable memory.

[0092] In the process of data management, different versions of a particular piece of data can be stored separately in the OTP storage space, or the original data to be stored can be destroyed to ensure the validity of the updated version. This application provides processing methods for these two different data management approaches, as detailed below:

[0093] Method 1, in an exemplary embodiment, such as Figure 5 As shown, the method also includes:

[0094] Step 502: In response to the addition of new data to be stored, the original data to be stored is destroyed.

[0095] In implementation, OTP responds to the addition of new data to be stored by destroying the original data to be stored. Specifically, in response to the addition of new data to be stored, OTP sets all data in the storage area where the original data to be stored was written to to 1, thereby destroying the original data to be stored.

[0096] Step 504: Obtain new data to be stored, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, write the new data to be stored bit by bit to the new target storage location in the storage area and perform circuit breaker processing.

[0097] In implementation, new data to be stored is acquired, and based on preset storage rules and a bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to a new target storage location in the storage area, and circuit breaker processing is performed. The storage rule is sequential storage from lower storage sub-intervals to higher storage sub-intervals. Specifically, the storage process of the new data to be stored is similar to the storage process of the original data to be stored described in the above embodiments, and will not be repeated here. After the new data to be stored is written and the circuit breaker is broken, the OTP regenerates the index value corresponding to the new data to be stored, so that all index values ​​in the OTP correspond to valid data to be stored (i.e., usable data to be stored).

[0098] In this embodiment, the original data to be stored that has already been written into the storage space is destroyed to ensure the unique validity of the new data to be stored that is newly written into the storage space. Thus, it is ensured that each index value points to usable data to be stored.

[0099] Method Two: In an exemplary embodiment, different versions of the data to be stored are not destroyed; that is, the original data to be stored is retained, thus enabling multiple versions of the data to be stored to exist in the OTP storage space. Figure 6 As shown, the method also includes:

[0100] Step 602: In response to the operation of adding new data to be stored, obtain the new data to be stored.

[0101] The new data to be stored is an updated version of the original data to be stored.

[0102] In practice, when a new version of the data to be stored (i.e., the original data to be stored) already exists in the OTP's storage space, the user can trigger an operation to add the new data to be stored. In response to the addition operation, OTP does not destroy the original data to be stored beforehand, but directly obtains the new data to be stored.

[0103] Step 604: Based on the preset storage rules and the bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to the new target storage location in the storage area to perform circuit breaker processing.

[0104] In implementation, OTP, based on preset storage rules and a bit-by-bit circuit breaker writing method, writes the new data to be stored bit by bit to a new target storage location in the storage area, performing circuit breaker processing. The method of writing this new data to be stored is similar to the storage process of the original data to be stored described in the above embodiments, and will not be repeated here. Therefore, the OTP storage space contains two different versions of the data to be stored.

[0105] Further, in step 104, based on the target storage location and the correspondence between bits in the preset index value and storage locations in the storage area, the target index value corresponding to the data to be stored at the target storage location is determined, including:

[0106] Step 606: Based on the new target storage location of the new data to be stored and the correspondence between bits in the preset index value and storage locations of storage areas, determine the new target index value corresponding to the data to be stored at the new target storage location.

[0107] In implementation, OTP determines the new target index value corresponding to the data to be stored at the new target storage location based on the new target storage location where the new data to be stored is written, and the correspondence between bits in the preset index value and storage locations in the storage area (i.e., the correspondence between bits in the index value and storage sub-intervals in the storage area). The process of determining this target index value is similar to the process of determining the target index value of the data to be stored described in the above embodiments, and will not be repeated here. Thus, different versions of the data to be stored corresponding to different index values ​​are stored in the OTP storage space. Therefore, the latest version and the original version (also known as the historical version) of the data to be stored can be found through each circuit breaker bit in different index values.

[0108] In this embodiment, by writing new data to be stored to a new target storage location in the storage area, a new target index value is generated, while the original data to be stored and its corresponding target index value are retained. During data queries, the latest version and the original version of the data to be stored can be retrieved based on different index values, ensuring the rollback capability of the stored data.

[0109] In one exemplary embodiment, after step 104, the OTP storage space can also perform data queries, i.e., data queries using index values. The method further includes:

[0110] Step 108: Based on the target index value and the correspondence between each bit contained in the target index value and the storage sub-intervals in the storage space, determine the target storage sub-interval corresponding to the target bit in each storage sub-interval of the storage area to store the data.

[0111] The target bit is the bit in the target index value used to represent the stored valid data.

[0112] In implementation, the bits corresponding to valid stored data in the target index value are set to 1. Therefore, OTP can locate stored data in the OTP storage space based on the target bits (i.e., the bits set to 1) in the target index value and the correspondence between each bit in the target index value and the storage sub-intervals in the storage space. It can then query the stored data in the target storage sub-interval corresponding to the target index value within the storage area, thus achieving fast data retrieval.

[0113] In this embodiment, the target index value allows for rapid location of stored data within the storage space, enabling fast querying of stored data within the target storage sub-range. This, in turn, improves the efficiency of OTP data management.

[0114] In one exemplary embodiment, such as Figure 7 As shown, the method also includes:

[0115] Step 702: Obtain the index value within the index area, and perform operations on the index value according to the bit position based on the preset operation algorithm to obtain the operation result.

[0116] In implementation, since the data to be stored in each section of the DATA storage area is written sequentially from low to high, and each bit in the index value has a one-to-one correspondence with each storage sub-section of the storage area, OTP obtains all index values ​​within the index area and performs an OR operation on all index values ​​in the current DATA INDEX (index area) bit by bit to obtain the result. This result reflects the storage area occupancy. Specifically, the result is represented as 2. n -1, (n = 1, 2, 3, ..., 63), where n reflects the current storage space occupancy.

[0117] Step 704: Based on the calculation results, determine the storage area occupancy results.

[0118] In implementation, OTP determines the storage area occupancy result, i.e., the storage area occupancy status, based on the calculation results. For example, if the calculation result determines n to be 5, it means that when the DATA storage area is arranged from low to high, sections 1 to 5 are all occupied. If n is 63, it means that all space in the DATA storage area from section 1 to 63 is occupied.

[0119] Step 706: When the storage area occupancy result is that all the storage sub-areas contained in the storage area are occupied, output information indicating that the one-time programmable memory cannot support the increase of data.

[0120] In implementation, when new data to be stored is written, the storage area occupancy result is detected to determine whether there is still available storage space. If the storage area is written from low to high, and the storage area occupancy result indicates that section 63 is also occupied (i.e., sections 0-63 are all occupied), then this OTP can no longer support the writing operation of the data to be stored, and outputs information indicating that the One-Time Programmable Memory (OTP) cannot support the addition of data.

[0121] In this embodiment, the index value of the index area is processed bitwise using a preset calculation algorithm to obtain the current OTP storage area occupancy result. Then, based on the storage area occupancy result, it is determined whether new data to be stored can be written. This achieves pre-detection of whether data can be successfully written, improving the efficiency of data management in OTP.

[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0123] Based on the same inventive concept, this application also provides a data management device for implementing the data management method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data management device embodiments provided below can be found in the limitations of the data management method described above, and will not be repeated here.

[0124] In one exemplary embodiment, such as Figure 8 As shown, a data management device is provided, including: an acquisition and writing module 801, a determination module 802, and a storage module 803, wherein:

[0125] The write module 801 is used to acquire the data to be stored and, based on the preset storage rules and the bit-by-bit circuit breaker writing method, write the data to be stored bit by bit to the target storage location in the storage area and perform circuit breaker processing.

[0126] The determining module 802 is used to determine the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area.

[0127] Storage module 803 is used to store the target index value to the target index storage location of the index area based on storage rules.

[0128] In an exemplary embodiment, the storage area includes multiple storage sub-areas. The write module 801 is specifically used to retrieve the first free storage sub-area from low to high based on the storage rules for storage from low to high storage sub-areas in the storage area, and to use it as the target storage sub-area.

[0129] The data to be stored is written bit by bit to the target storage location in the target storage sub-range, and a circuit breaker is applied after each bit of data to be stored is written.

[0130] In one exemplary embodiment, the determining module 802 is specifically used to perform a circuit breaker query from the low storage sub-interval to the high storage sub-interval to determine the target storage location of the data to be stored in the target storage sub-interval of the storage area; the target storage location is the target storage sub-interval.

[0131] Based on the target storage sub-interval and the correspondence between bits in the preset index value and the storage sub-interval, a target index value is generated to characterize the valid stored data stored in the target storage sub-interval.

[0132] In one exemplary embodiment, the device 800 further includes:

[0133] The destruction module is used to destroy the original data to be stored in response to the addition of new data to be stored.

[0134] The first write module is used to acquire new data to be stored, and based on preset storage rules and a bit-by-bit circuit breaker writing method, write the new data to be stored bit by bit to a new target storage location in the storage area, and perform circuit breaker processing.

[0135] In one exemplary embodiment, the device 800 further includes:

[0136] The retrieval module is used to retrieve new data to be stored in response to the addition operation of new data to be stored.

[0137] The second write module is used to write new data to be stored bit by bit to a new target storage location in the storage area based on preset storage rules and a bit-by-bit circuit breaker write method, and to perform circuit breaker processing.

[0138] The determination module 802 is specifically used to determine the new target index value corresponding to the data to be stored at the new target storage location based on the new target storage location of the new data to be stored and the correspondence between the bits in the preset index value and the storage location of the storage area.

[0139] In one exemplary embodiment, the device 800 further includes:

[0140] The query determination module is used to determine the data to be stored in the target storage sub-interval corresponding to the target bit in each storage sub-interval of the storage area, based on the target index value and the correspondence between each bit contained in the target index value and the storage sub-interval in the storage space.

[0141] The target bit is the bit in the target index value used to represent the stored valid data.

[0142] In one exemplary embodiment, the device 800 further includes:

[0143] The acquisition and calculation module is used to acquire the index value in the index area, and perform calculations on the index value according to the bit position based on the preset calculation algorithm to obtain the calculation result;

[0144] The result determination module is used to determine the storage area occupancy result based on the calculation result;

[0145] The output module is used to output information indicating that the one-time programmable memory cannot support data addition when the storage area occupancy result is that all storage sub-areas contained in the storage area are occupied.

[0146] Each module in the aforementioned data management device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0147] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data to be stored. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a data management method.

[0148] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data management method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0149] Those skilled in the art will understand that Figure 10The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0150] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0151] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0152] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0153] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0154] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0155] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0156] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data management method, characterized in that, The method is applied to a one-time programmable memory, which is pre-configured with an index area and a storage area. The method includes: The data to be stored is obtained, and based on the preset storage rules and the bit-by-bit circuit breaker writing method, the data to be stored is written bit by bit to the target storage location of the storage area, and the circuit breaker process is performed. Based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area, the target index value corresponding to the data to be stored at the target storage location is determined. Based on the storage rules, the target index value is stored in the target index storage location of the index region; The storage area comprises multiple storage sub-areas, and the storage rule is to write sequentially from the first free storage sub-area of ​​the lower storage sub-area to the higher storage sub-area.

2. The method according to claim 1, characterized in that, The method, based on preset storage rules and a bit-by-bit circuit breaker write approach, writes the data to be stored bit by bit to the target storage location in the storage area, performing circuit breaker processing, including: Based on the storage rule of storing from low storage sub-intervals to high storage sub-intervals, the first free storage sub-interval in the storage area is queried from low to high and used as the target storage sub-interval. The data to be stored is written bit by bit to the target storage location of the target storage sub-interval, and a circuit breaker is performed after each bit of the data to be stored is written.

3. The method according to claim 1 or 2, characterized in that, The step of determining the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between bits in the preset index value and the storage location of the storage area includes: A circuit breaker query is performed from the low storage sub-interval to the high storage sub-interval to determine the target storage location of the data to be stored in the target storage sub-interval of the storage area; the target storage location is the target storage sub-interval. Based on the target storage sub-interval and the correspondence between the bits in the preset index value and the storage sub-interval, a target index value is generated to characterize the valid stored data stored in the target storage sub-interval.

4. The method according to claim 1, characterized in that, The method further includes: In response to the addition of new data to be stored, the original data to be stored is destroyed. New data to be stored is acquired, and based on preset storage rules and a bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to a new target storage location in the storage area, and circuit breaker processing is performed.

5. The method according to claim 1, characterized in that, The method further includes: In response to the addition of new data to be stored, retrieve the new data to be stored; Based on preset storage rules and a bit-by-bit circuit breaker writing method, the new data to be stored is written bit by bit to the new target storage location in the storage area for circuit breaker processing. The step of determining the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between bits in the preset index value and the storage location of the storage area includes: Based on the new target storage location of the new data to be stored, and the correspondence between the bits in the preset index value and the storage location of the storage area, a new target index value corresponding to the data to be stored at the new target storage location is determined.

6. The method according to claim 1, characterized in that, After storing the target index value to the target index storage location of the index region based on the storage rules, the method further includes: Based on the target index value and the correspondence between each bit contained in the target index value and the storage sub-intervals in the storage area, data is stored in the target storage sub-interval corresponding to the target bit in each storage sub-interval of the storage area. The target bit is the bit in the target index value used to represent the storage of valid data.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the index value within the indexed region, and perform operations on the index value bit by bit based on a preset calculation algorithm to obtain the calculation result; Based on the calculation results, the storage area occupancy result is determined; When the storage area occupancy result is that all storage sub-areas contained in the storage area are occupied, information indicating that the one-time programmable memory cannot support data addition is output.

8. A data management device, characterized in that, The device is applied to a one-time programmable memory, the one-time programmable memory being pre-configured with an index area and a storage area, and the device includes: The acquisition and writing module is used to acquire the data to be stored, and write the data to be stored bit by bit to the target storage location of the storage area based on the preset storage rules and the bit-by-bit circuit breaker writing method, and perform circuit breaker processing. The determining module is used to determine the target index value corresponding to the data to be stored at the target storage location based on the target storage location and the correspondence between the bits in the preset index value and the storage location of the storage area; A storage module is used to store the target index value to the target index storage location of the index region based on the storage rules. The storage area comprises multiple storage sub-areas, and the storage rule is to write sequentially from the first free storage sub-area of ​​the lower storage sub-area to the higher storage sub-area.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data programming verification method and device of one-time programmable memory

    CN116230060A

  • Updating data in a one-time programmable data storage device

    US8294940B1