Data storage management methods, devices and storage media

The three-tier management model solves the problems of resource consumption and storage requirements in the storage management of IoT devices, and achieves efficient data storage management and wide applicability.

CN119668491BActive Publication Date: 2025-10-31BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311228437.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-10-31
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

In the business scenarios of IoT devices, there is a lack of software components that can achieve effective storage management, low resource consumption, and meet the basic storage requirements of IoT products.

Method used

A three-tier management model (based on storage buckets, storage partitions, and storage bits) is adopted. The target area of ​​physical storage space is determined by the storage index, the status identifier of the data header is parsed, data operations are performed, and the management model is updated.

Benefits of technology

It achieves efficient data storage management, meets the storage requirements of IoT products, can cover a wide range of usage scenarios, and consumes few resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668491B_ABST
    Figure CN119668491B_ABST
Patent Text Reader

Abstract

This disclosure relates to a data storage management method, apparatus, and storage medium, belonging to the field of software storage technology. The method includes: establishing a three-level management model based on storage buckets, storage partitions, and storage bits. Each storage bucket corresponds to a basic storage unit in the physical storage space of the storage medium, each storage bucket includes several storage partitions, and each storage partition includes multiple storage bits. The three-level management model is responsible for the effective management of the storage space. This three-level management model effectively manages the physical storage space of the storage medium, resulting in high data storage management efficiency, meeting the basic storage requirements of IoT products, and covering a wide range of application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of software storage technology, and in particular to a data storage management method, apparatus and storage medium. Background Technology

[0002] While software storage technology is relatively mature in the field of related technologies, there is a lack of software components that can achieve effective storage management, consume few resources, meet the basic storage requirements of IoT products, and cover a wide range of usage scenarios in the business scenarios of IoT (Internet of Things) devices. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a data storage management method, apparatus and storage medium.

[0004] According to a first aspect of the present disclosure, a data storage management method is provided, comprising:

[0005] In response to receiving a data operation request, the system requests or obtains a storage index corresponding to the business data involved in the data operation request; wherein the storage index is used to indicate the location information of the business data in the management model; wherein the management model is a three-level management model based on storage buckets, storage partitions, and storage bits, each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium, each storage bucket includes several storage partitions, and each storage partition includes eight storage bits;

[0006] Based on the storage index, determine the target storage area corresponding to the business data in the physical storage space;

[0007] Obtain the data header of the target storage area, parse the data header, and obtain the status identifier; wherein, the storage format of the business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the data validity of the current storage area;

[0008] Based on the status identifier, perform the data operation corresponding to the data operation request, and update the management model.

[0009] In some implementations, the method further includes:

[0010] In response to receiving a storage space configuration request, a physical storage space request is sent to the storage medium;

[0011] Receive the storage configuration table returned by the storage medium based on the physical storage space application, load the storage configuration table to associate the management model with the physical storage space of the storage medium.

[0012] In some implementations, the data operation request includes a data write request, and the response of requesting a storage index upon receiving the data operation request includes:

[0013] In response to receiving the data write request, it is determined whether there are any idle resources in the TLB; wherein the TLB is used to record the occupancy status of the storage buckets, storage partitions and storage bits of the management model; wherein the occupancy status is used to indicate whether it is occupied;

[0014] If there are idle resources in the TLB, confirm the storage index of the idle resources.

[0015] In some implementations, performing the data operation corresponding to the data operation request based on the status identifier includes:

[0016] Based on the status identifier, determine whether the target storage area is being written to for the first time;

[0017] If the target storage area is being written to for the first time, the business data involved in the data write request will be directly written to the target storage area.

[0018] If the target storage area is not being written to for the first time, all business data in the target storage area will be copied to memory; and invalid data in the target storage area will be cleaned up according to the status flag.

[0019] The business data involved in the data write request is written to the logical address in memory to generate the entire block of business data;

[0020] Erase the data in the basic storage unit to which the target storage area of ​​the storage medium belongs, and write the entire block of business data to the storage medium; and update the management model.

[0021] In some implementations, the data operation request includes a data read request, and before performing the data operation corresponding to the data operation request based on the status identifier, the method further includes:

[0022] Based on the storage index, it is confirmed whether the target business data corresponding to the storage index exists in the cache; wherein, the cache stores hot data, and the hot data includes business data stored in a linked list format based on access time;

[0023] If the target business data corresponding to the storage index is confirmed to exist in the cache, the target business data is returned.

[0024] In some implementations, performing the data operation corresponding to the data operation request based on the status identifier includes:

[0025] Verify the validity of the data based on the status identifier in the data header;

[0026] If the data validity verification passes, the data body is read to obtain the target business data;

[0027] Calculate the first checksum of the target business data, and verify whether the first checksum is consistent with the second checksum in the data header;

[0028] If the first checksum matches the second checksum in the data header, the target business data is returned, and the target business data is updated in the cache.

[0029] In some implementations, the method further includes:

[0030] If the first checksum is inconsistent with the second checksum in the data header, modify the status identifier in the data header;

[0031] If the data in the backup partition of the target storage area is verified to be correct, perform an incremental data synchronization operation on the backup partition;

[0032] After the incremental synchronization operation is completed, the target storage area and the backup partition are switched to primary / backup mode.

[0033] In some implementations, the data operation request includes a data deletion request, and the step of performing the data operation corresponding to the data operation request based on the status identifier includes:

[0034] Modify the status flag of the data header.

[0035] In some implementations, the data operation request includes a data modification request, and the step of performing the data operation corresponding to the data operation request based on the status identifier includes:

[0036] Modify the status flag of the data header;

[0037] Apply for a new storage index and write the business data involved in the data modification request into the target storage area corresponding to the new storage index.

[0038] In some implementations, the method further includes:

[0039] In response to triggering the serialization process, each basic storage unit in the storage medium is read cyclically;

[0040] Verify data validity based on the status identifier in the data header of each basic storage unit;

[0041] If the data validity verification passes, the management model and the fast table are updated based on the status identifier in the data header.

[0042] According to a second aspect of the present disclosure, a data storage management apparatus is provided, comprising:

[0043] An index acquisition module is used to respond to a received data operation request by applying for a storage index or acquiring a storage index corresponding to the business data involved in the data operation request; wherein, the storage index is used to indicate the location information of the business data in the management model; wherein, the management model is a three-level management model based on storage buckets, storage partitions, and storage bits, each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium, each storage bucket includes several storage partitions, and each storage partition includes eight storage bits;

[0044] The region determination module is used to determine the target storage region corresponding to the business data in the physical storage space based on the storage index.

[0045] The region status acquisition module is used to acquire the data header of the target storage region, parse the data header, and acquire the status identifier; wherein, the storage format of the business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the data validity of the current storage region;

[0046] The data operation module is used to perform the data operation corresponding to the data operation request based on the status identifier, and update the management model.

[0047] In some implementations, the apparatus further includes a configuration loading module for:

[0048] In response to receiving a storage space configuration request, a physical storage space request is sent to the storage medium;

[0049] Receive the storage configuration table returned by the storage medium based on the physical storage space application, load the storage configuration table to associate the management model with the physical storage space of the storage medium.

[0050] In some implementations, the data operation request includes a data write request, and the index acquisition module is specifically used for:

[0051] In response to receiving the data write request, it is determined whether there are any idle resources in the TLB; wherein the TLB is used to record the occupancy status of the storage buckets, storage partitions and storage bits of the management model; wherein the occupancy status is used to indicate whether it is occupied;

[0052] If there are idle resources in the TLB, confirm the storage index of the idle resources.

[0053] In some implementations, the index acquisition module is further used for:

[0054] If there are no free resources in the TLB, the system determines whether there are unaccessed storage areas in the physical storage space based on the access flag.

[0055] If there are no unaccessed storage areas in the physical storage space, determine whether there are any free storage areas in the physical storage space;

[0056] If there is no free storage area in the physical storage space, determine the storage area in the physical storage space that has not been accessed for the longest time.

[0057] Obtain the storage index of the storage region in the physical storage space that has not been accessed for the longest time.

[0058] In some implementations, the data manipulation module is specifically used for:

[0059] Based on the status identifier, determine whether the target storage area is being written to for the first time;

[0060] If the target storage area is being written to for the first time, the business data involved in the data write request will be directly written to the target storage area.

[0061] If the target storage area is not being written to for the first time, all business data in the target storage area will be copied to memory; and invalid data in the target storage area will be cleaned up according to the status flag.

[0062] The business data involved in the data write request is written to the logical address in memory to generate the entire block of business data;

[0063] Erase the data in the basic storage unit to which the target storage area of ​​the storage medium belongs, and write the entire block of business data to the storage medium; and update the management model.

[0064] In some implementations, the data operation request includes a data read request, and the data operation module is further configured to:

[0065] Based on the storage index, it is confirmed whether the target business data corresponding to the storage index exists in the cache; wherein, the cache stores hot data, and the hot data includes business data stored in a linked list format based on access time;

[0066] If the target business data corresponding to the storage index is confirmed to exist in the cache, the target business data is returned.

[0067] In some implementations, the data manipulation module is further used for:

[0068] If it is confirmed that the target business data corresponding to the storage index does not exist in the cache, the validity of the data is verified based on the status identifier in the data header;

[0069] If the data validity verification passes, the data body is read to obtain the target business data;

[0070] Calculate the first checksum of the target business data, and verify whether the first checksum is consistent with the second checksum in the data header;

[0071] If the first checksum matches the second checksum in the data header, the target business data is returned, and the target business data is updated in the cache.

[0072] In some implementations, the data manipulation module is further used for:

[0073] If the first checksum is inconsistent with the second checksum in the data header, modify the status identifier in the data header;

[0074] If the data in the backup partition of the target storage area is verified to be correct, perform an incremental data synchronization operation on the backup partition;

[0075] After the incremental synchronization operation is completed, the target storage area and the backup partition are switched to primary / backup mode.

[0076] In some implementations, the data operation request includes a data deletion request, and the data operation module is further configured to:

[0077] Modify the status flag of the data header.

[0078] In some implementations, the data operation request includes a data modification request, and the data operation module is further configured to:

[0079] Modify the status flag of the data header;

[0080] Apply for a new storage index and write the business data involved in the data modification request into the target storage area corresponding to the new storage index.

[0081] In some implementations, the apparatus further includes a serialization module for:

[0082] In response to triggering the serialization process, each basic storage unit in the storage medium is read cyclically;

[0083] Verify data validity based on the status identifier in the data header of each basic storage unit;

[0084] If the data validity verification passes, the management model and the fast table are updated based on the status identifier in the data header.

[0085] According to a third aspect of the present disclosure, a server is provided, comprising:

[0086] At least one processor; and

[0087] A memory communicatively connected to the at least one processor; wherein,

[0088] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the data storage management method described in the first aspect above.

[0089] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, comprising:

[0090] The storage medium stores a computer program, which, when executed by a processor, implements the data storage management method described in the first aspect above.

[0091] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0092] The three-tier management model effectively manages the physical storage space of the storage medium, resulting in high data storage management efficiency, meeting the basic storage requirements of IoT products, and covering a wide range of usage scenarios.

[0093] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0094] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0095] Figure 1 This is an application scenario for data storage management.

[0096] Figure 2 This is a flowchart illustrating a data storage management method according to an exemplary embodiment.

[0097] Figure 3This is a schematic diagram based on an exemplary management model.

[0098] Figure 4 This is a storage management diagram based on an exemplary management model.

[0099] Figure 5 This is a schematic diagram illustrating the partitioning of physical storage space according to an example.

[0100] Figure 6 This is a schematic diagram illustrating the storage format of business data as shown in an example.

[0101] Figure 7 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment.

[0102] Figure 8 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment.

[0103] Figure 9 This is a schematic diagram based on an exemplary fast watch.

[0104] Figure 10 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment.

[0105] Figure 11 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment.

[0106] Figure 12 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment.

[0107] Figure 13 This is a block diagram illustrating a data storage management device according to an exemplary embodiment.

[0108] Figure 14 This is a block diagram illustrating an apparatus according to an exemplary embodiment. Detailed Implementation

[0109] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0110] Although software storage technology has matured, there is a lack of software components in IoT device business scenarios that consume few resources, meet the basic storage requirements of IoT products, and can cover a wide range of usage scenarios.

[0111] like Figure 1 As shown, IoT devices need to have a certain data storage capacity, and the appropriate storage medium, such as flash memory chips, should be selected according to product requirements. In the absence of a file system, it is necessary to implement read and write functions for specific business data on the storage medium.

[0112] Figure 2 This is a flowchart illustrating a data storage management method according to an exemplary embodiment. This data storage management method can be used in electronic devices such as physical network devices, for example... Figure 2 As shown, it includes the following steps.

[0113] In step S201, in response to receiving a data operation request, a storage index is requested or the storage index corresponding to the business data involved in the data operation request is obtained; wherein, the storage index is used to indicate the location information of the business data in the management model; wherein, the management model is a three-level management model based on storage buckets, storage areas, and storage locations, each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium, each storage bucket includes several storage areas, and each storage area includes eight storage locations.

[0114] The data storage management method in this embodiment is implemented by a physical network device.

[0115] First, it should be noted that the management model in this embodiment is a three-level management model, which is a three-level management model built on bucket, area and location, and is used to achieve effective management of the physical storage space of the storage medium.

[0116] Taking flash memory chips as an example, the management of flash memory media is outsourced to a three-tier management model, such as... Figure 3 As shown, each storage unit of the storage medium corresponds to the largest granularity bucket in the management model. Further dividing the bucket into several areas not only facilitates finer-grained storage resource management but also enables efficient access to the storage medium at the byte-bit level. Further dividing the area into eight locations allows full utilization of the eight bits of a single byte to manage and maintain the physical storage space of the storage medium.

[0117] The storage capacity for business data can be increased by dynamically expanding the number of buckets, and the size of a single fixed-length data storage space can be adjusted by dynamically adjusting the number of areas. The management model supports expansion where the physical storage space is not contiguous, but the logical space is contiguous.

[0118] Loading the physical storage space of the storage medium into the management model establishes the association between the physical storage space and the management model. In other words, it establishes a correspondence between the triples (bucket, area, location) in the management model and the physical addresses of the physical storage space on the storage medium. Each triple (bucket, area, location) uniquely identifies a specific storage location on the storage medium. After loading the physical storage space of the storage medium into the management model, the management model uniformly maintains the ownership, address space, and usage of the physical storage space.

[0119] Each location in the management model carries a status flag, an access flag, and an operation time, such as... Figure 4 As shown, status flags are used to indicate whether a storage unit is currently occupied: for example, bit 0 indicates it is not occupied, and bit 1 indicates it is occupied. To improve efficiency, data deletion only modifies the occupancy flag; only data in occupied storage units is actually valid. Idle data will be cleaned up during media erasure. The specific data deletion process is described later. Access flags are used to indicate whether a storage unit has been written to: for example, bit 0 indicates it has not been written to, and bit 1 indicates it has been written to. Due to the write characteristics of the storage medium, bits that have already been written cannot be modified repeatedly. If writing is necessary, the storage medium must be erased first. To avoid write amplification, writing will be prioritized to unaccessed storage areas based on the access flags. The recorded operation time is used to meet data access sorting scenarios or scenarios that overwrite the oldest data.

[0120] It should also be noted that in related technologies, the physical storage space of the storage medium is not divided, or the division is chaotic. This embodiment effectively divides the physical storage space (i.e., storage resources) of the storage medium.

[0121] As one implementation method, the physical storage space of the storage medium is effectively divided based on preset partitioning criteria. These criteria can include, but are not limited to, business types. Effective partitioning of the physical storage space of the storage medium can cover a wide range of usage scenarios.

[0122] As an example, a bucket is used as the smallest unit for allocating storage resources, and a complete request is allocated to a specific business unit. Buckets of the same type are logically contiguous, but may not be contiguous in actual physical addresses. This ensures linear operations between memory and logic, as well as the independence of the address space of the storage medium.

[0123] Taking flash memory chips as an example, such as Figure 5 As shown, the physical storage space is statically partitioned in the flash memory's storage configuration table (flash map), and the storage configuration table can be expanded.

[0124] Similar businesses (e.g.) Figure 3 The address spaces of Class A, Class B, and Class C storage media are not physically contiguous, but are logically contiguous. This not only facilitates the expansion of subsequent data storage space, but also protects the address space of the storage medium from unauthorized access.

[0125] Taking a certain flash memory chip as an example, with 4K as the basic storage unit, the first and second 4K storage areas can be allocated to service A, the third 4K storage area to service B, and the sixth 4K storage area back to service A. For service A, the actual physical address space of the storage medium is not contiguous. However, the logical addresses mapped to the management model are contiguous.

[0126] The partitioned physical storage space can be automatically loaded into the management model, establishing a relationship between the physical storage space and the management model. The management model can then uniformly maintain the ownership, address space, and usage of the physical storage space.

[0127] In this embodiment, the management model receives a data operation request from the application and obtains a storage index. The location information of business data within the management model can be obtained through the storage index, and then mapped to a storage area in the storage medium based on this location information. As one implementation, the storage index is used to establish a mapping relationship between the logical ID of the business data generated by the application and the management model. The storage index is a sequence number that uniquely identifies a triple in the management model. Here, the logical ID refers to the operation ID.

[0128] It should also be noted that data operation requests can include data write requests, data query requests, data deletion requests, and data modification requests. The method for obtaining the storage index differs depending on the type of data operation request. For example, for a data write request, a storage index for storing the business data to be written can be requested from the management model, and the data to be written can be written to the storage medium based on that storage index. For a data query request, the storage index for the data to be queried needs to be obtained from the management model, and the business data needs to be read from the corresponding storage medium location based on that storage index.

[0129] In step S202, the target storage area corresponding to the business data in the physical storage space is determined based on the storage index.

[0130] After obtaining the storage index, the triples of the management model can be determined based on the storage index, and the target storage area corresponding to the business data in the physical storage space can be determined based on the triples.

[0131] In step S203, the data header of the target storage area is obtained, the data header is parsed, and the status identifier is obtained; wherein, the storage format of business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the validity of the data in the current storage area.

[0132] It should be noted that the storage format of business data in the physical storage area of ​​the storage medium is as follows: Figure 6 As shown, it includes a data header and a data body. Business data will be encapsulated in a fixed storage header (data header), which includes: a status identifier, data length, and a checksum.

[0133] A status flag is used to identify the validity of data in the current region. Persistently storing this status flag field allows for serialization in the memory management model after a device reboot. Multiple status flags are possible; for example, 0xff indicates the current region has never been accessed since the memory media was erased, 0xf0 indicates valid data has been written to the current region, and 0x00 indicates valid data was previously written to the current region but is now invalid. Based on the charging and discharging characteristics of the memory media: bits in the memory media can only be written from 1 to 0, not from 0 to 1; only an erase operation can restore the entire memory media to all 1s. Taking a certain flash memory chip as an example, a complete erase is performed using 4K as the basic storage unit. By using a partial write method based on the status flag's status bits, the entire process of data initialization, data writing, and data deletion is covered. This process avoids write amplification of the memory media, optimizes storage efficiency, and enhances the write lifespan of the memory media.

[0134] Data length is used to indicate the effective data length within a fixed-length data area.

[0135] A checksum is used to calculate a checksum on data, and the result is stored. For example, before reading data, the checksum is calculated again to prevent data tampering or inaccuracy caused by storage media problems.

[0136] This embodiment supports a standard storage format for recording the status information, data length, and checksum of the current storage area.

[0137] In step S204, based on the status identifier, the data operation corresponding to the data operation request is performed, and the management model is updated.

[0138] In this embodiment, data operation requests may include data write requests, data query requests, data deletion requests, data modification requests, etc. For different data operation requests, corresponding data operations are performed. For example, for a data write request, after obtaining the storage index, the data to be written is written to the physical storage space corresponding to the storage medium. For a data query request, after obtaining the storage index, the physical storage space of the business data in the storage medium is determined based on the storage index, and the business data is read.

[0139] It is important to note that after the data operation process is completed, the management model is updated according to the data update status. The physical storage space of the storage medium is managed through the management model, which is highly efficient and consumes few resources.

[0140] The data storage management method of this application embodiment is responsible for the effective management of the physical storage space of the storage medium through a three-level management model. It has high data storage management efficiency, meets the basic storage requirements of IoT products, can cover a wide range of usage scenarios, and consumes few resources.

[0141] The following section explains how to implement the storage configuration of the physical storage space of the storage medium.

[0142] Figure 7 This is a flowchart illustrating a data storage management method according to another exemplary embodiment, such as... Figure 7 As shown, the data storage management method may include the following steps.

[0143] In step S701, in response to receiving a storage space configuration request, a physical storage space application is sent to the storage medium.

[0144] After receiving a storage space configuration request from the application, the management model sends a physical storage space request to the storage medium.

[0145] As mentioned in step S201, the storage medium is effectively partitioned through a storage configuration table. For example, when partitioning according to service type, the storage configuration table details the storage service type and the corresponding physical address in the storage medium. The storage medium can partition its physical storage space according to the physical storage space request sent by the management model, that is, allocate a bucket to the service type to which the storage space configuration request belongs.

[0146] In step S702, the storage configuration table returned by the storage medium based on the physical storage space application is received, and the storage configuration table is loaded to associate the management model with the physical storage space of the storage medium.

[0147] After receiving the storage configuration table from the storage medium, the management model loads the storage configuration table, thus establishing a mapping between the management model and the physical addresses of the storage medium. Once the storage configuration table is loaded, the management model will map each allocated storage unit within the storage medium and manage and maintain those units. Operations on the storage medium by the management model will be performed through the associated physical addresses.

[0148] By implementing this embodiment, the physical storage space of the storage medium can be effectively divided, and the physical storage space can be managed by the management model based on the division results. The management model can uniformly maintain the ownership, address space, usage, etc. of the physical storage space of the storage medium, which can cover a wide range of usage scenarios.

[0149] The following section explains how data write requests are implemented.

[0150] Figure 8 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment, such as... Figure 8 As shown, the data storage management method may include the following steps.

[0151] In step S801, in response to receiving a data write request, a storage index is requested.

[0152] As one implementation method, the process of applying for a storage index includes:

[0153] S1, determine whether there are any free resources in the TLB; where the TLB is used to record the occupancy status of the bucket, area and location in the management model; where the occupancy status is used to indicate whether it is occupied.

[0154] This can be understood as follows: after an application generates data that needs to be stored, it sends a request to the management model to apply for a valid storage index. After receiving the data write request from the application, the management model first applies for a storage index through the TLB (Track Table).

[0155] Among them, such as Figure 9 As shown, the fast dial indicator consists of the following three parts:

[0156] The bucket table is used to determine if there are currently any free buckets. -1 indicates that the current bucket is full, and anything other than -1 indicates that there are available resources in the current bucket. The value in the bucket table represents the available area within the bucket.

[0157] The `area` table is used to determine if there are currently any free areas. -1 indicates that the current area is full, while anything other than -1 indicates that there are available resources in the current area. The values ​​in `area` represent the available locations within the area.

[0158] The location table is used to determine if there are currently any available locations; 0 indicates an available location, and 1 indicates a occupied location.

[0159] Therefore, the confirmed triple (bucket, area, location6) uniquely identifies a specific storage location on the storage medium. Updates to the TLB can be performed using both forward and backward recursion.

[0160] Therefore, the TLB can quickly query the available resources of physical storage space and write data, solving the problem of insufficient access speed for storage operations under certain data volumes and specific access requirements.

[0161] It should also be noted that, as an implementation method, in response to triggering the serialization process, each basic storage unit in the storage medium is read in a loop; the validity of the data is verified based on the status identifier in the data header of each basic storage unit; if the data validity verification passes, the management model and the TLB are updated based on the status identifier in the data header.

[0162] As mentioned above, persistently storing this status flag field allows for the serialization of the memory management model after a device reboot. Specifically, after an IoT device powers on, the data in the storage medium needs to be serialized into memory. By iteratively reading each storage unit of the storage medium, the validity of the data is determined by the data header. The management model is updated based on the status flag in the data header, and the TLB (Transport Time Table) is also updated. After serialization, the management model and TLB are fully restored to their historically usable state. The serialization operation, through backtracking of the persistent data, completes the establishment of the management model and TLB, making subsequent data operations more efficient.

[0163] S2, if there are free resources in the TLB, confirm the storage index of the free resources.

[0164] If a query using the TLB confirms that there are free resources in the physical storage space, the storage index of the free resources is obtained so that new business data can be written based on the storage index.

[0165] Therefore, the TLB can quickly retrieve available resources in the management model, and the TLB will identify the [bucket, area, location] triplet for the free resources used to store new business data.

[0166] S3, when there are no free resources in the TLB, determines whether there are unaccessed storage areas in the physical storage space based on the access flag.

[0167] If no free resources are found when querying the TLB, the management model is traversed directly to find unvisited areas without using the TLB.

[0168] If there are unvisited regions, identify the storage index of the unvisited regions and return that storage index.

[0169] S4. If there are unaccessed storage areas in the physical storage space, confirm the storage index of the unaccessed resources; if there are no unaccessed storage areas in the physical storage space, determine whether there are free storage areas in the physical storage space.

[0170] Without using a TLB (Translation Lookaside Buffer), the system directly determines whether there is a free storage area in the physical storage space based on the status identifier in the data header. If a free storage area is found to exist, the storage index for that free storage area is then identified.

[0171] S5, if there is a free storage area in the physical storage space, confirm the storage index of the free storage area; if there is no free storage area in the physical storage space, determine the storage area in the physical storage space that has not been accessed for the longest time.

[0172] If the physical storage space is confirmed to be full, the area that has not been accessed for the longest time will be used for overwriting.

[0173] S6 retrieves the storage index of the storage region in the physical storage space that has not been accessed for the longest time.

[0174] Based on operation time, the system can retrieve the longest-unaccessed storage region in the physical storage space. It then obtains the storage index of the overwritten region to write new business data. Finally, it overwrites the longest-unaccessed data when the physical storage region reaches its storage saturation.

[0175] This embodiment reduces the problem of short media lifespan caused by frequent media erasure and rewriting by judging idle resources, unaccessed areas after erasure and rewriting, and idle areas one by one.

[0176] Optionally, the data write request includes a request ID. Upon receiving the data write request, the request ID is first validated. If the request ID is valid, subsequent operations such as requesting storage indexes are performed. The request ID can be validated by checking if the address corresponding to the request ID is out of range.

[0177] In step S802, the target storage area corresponding to the business data in the physical storage space is determined based on the storage index.

[0178] After obtaining the [bucket, area, location] triple for available resources to store new business data, the target storage area of ​​the storage medium can be determined based on the mapping relationship between the management model and the storage medium.

[0179] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0180] In step S803, the data header of the target storage area is obtained, the data header is parsed, and the status identifier is obtained.

[0181] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0182] In step S804, based on the status identifier, it is determined whether the target storage area is being written to for the first time.

[0183] In step S805, if the target storage area is being written to for the first time, the business data involved in the data write request is directly written to the target storage area.

[0184] For example, if the status flag is 0xff, it indicates that the current area has never been operated on since the erase and write media was used. This means that the target storage area is being written to for the first time, and the business data will be directly persisted to the target storage area.

[0185] In step S806, if the target storage area is not being written to for the first time, the business data involved in the data write request is written to the target storage area through an indirect write process.

[0186] As one implementation method, the indirect write process includes: copying all the first data in the first basic storage area where the target storage area is located to memory; cleaning up invalid data in the first basic storage area according to the status identifier of the first basic storage area; writing the business data involved in the data write request to memory and combining it with the first data to form a whole block of business data; erasing the data in the first basic storage area and writing the whole block of business data to the first basic storage area of ​​the storage medium; and updating the management model.

[0187] As an example, the target storage area is located in the second 4K storage area of ​​the storage medium. All business data in the second 4K storage area of ​​the storage medium is copied to memory. Invalid data is cleaned up according to the status flag in the data header of the target storage area. Valid data to be written is written to the logical address in memory. Thus, the data previously copied to memory and the data just written to memory generate a single block of valid business data. The second 4K storage area in the storage medium is erased, and the generated single block of valid business data is written to the second 4K storage area of ​​the storage medium. Afterwards, the management model and cache are updated.

[0188] It's important to note that indirect writes are only executed when there is no free space available for direct writing in the allocated physical storage. During indirect writes, previously marked invalid data is cleaned up, thereby freeing up more space available for direct writing. The management model prioritizes allocating storage indexes that can be written to immediately, avoiding further write amplification.

[0189] It's important to note that when erasing an entire storage medium, invalid data is cleaned up. This cleanup action triggers a TLB update, updating the bucket, area, and location corresponding to the erased storage medium to free bucket, free area, and free location. Each erase operation releases available space, but the TLB only needs to ensure that all dimensions of the three-level management are effectively updated.

[0190] It should also be noted that after successfully writing data to the storage index, the TLB needs to be updated to ensure that it can be directly used to request a storage index in the future. The process of updating the TLB includes:

[0191] Check if there is a usable location in the area containing the current storage index. If so, update the location directly. If there is no usable location in the current area, mark the current area as full. Check if there is a usable area in the bucket containing the current storage index. If so, update the area directly. If there is no usable area in the current bucket, mark the current bucket as full. Check if there are any available buckets. If so, update the bucket table directly; otherwise, mark the TLB as full.

[0192] By implementing this embodiment, the free area of ​​the management model can be quickly retrieved through the TLB, thereby quickly determining the data writing area of ​​the storage medium and enabling fast writing of business data to the storage medium.

[0193] The following section explains how data read requests are implemented.

[0194] Figure 10 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment, such as... Figure 10 As shown, the data storage management method may include the following steps.

[0195] In step S1001, in response to receiving a data read request, the storage index corresponding to the business data in the data read request is obtained.

[0196] By using the logical ID of the business data involved in the data read request, the corresponding storage index in the management model can be obtained.

[0197] In some implementations, after obtaining the storage index corresponding to the business data in the data read request, the storage index is verified, and subsequent operations are performed after the verification is successful.

[0198] In step S1002, based on the storage index, it is confirmed whether the target business data corresponding to the storage index exists in the cache; wherein, the cache stores hot data, which includes business data stored in a linked list format based on access time.

[0199] In step S1003, if it is confirmed that the target business data corresponding to the storage index exists in the cache, the target business data is returned.

[0200] This can be understood as follows: after an IoT device powers on, the data in the storage medium is serialized into memory. Therefore, when searching for data using a storage index, the system first checks the cache. If the cache lookup fails, the data is read from the storage medium, and once read successfully, the data is updated in the cache. Because memory is limited, the cached data is always finite, and the data in the cache is defined as hot data. If the accessed data is hit in the cache, the efficiency of data access is improved, device I / O is reduced, and the problem of storage operations not meeting speed requirements under certain data volumes and specific access requirements is solved.

[0201] Hot data is stored in a linked list. Newly added data is placed at the head of the list, and data at the tail is data to be evicted. The linked list has a certain capacity based on memory and business type; data will be evicted when the capacity is full. After data is accessed, it is placed back at the head of the list, updated with the most recently accessed data. The linked list implements the sorting of data operation time in the management model, enabling rapid data overwriting.

[0202] After performing data operations, such as data read, data modification, and data write, the cache needs to be updated, specifically the cached frequently accessed data. This solves the problem of repeatedly overwriting and losing frequently accessed data when the storage is full.

[0203] In step S1004, if it is confirmed that there is no target business data corresponding to the storage index in the cache, the target storage area corresponding to the business data in the physical storage space is determined based on the storage index.

[0204] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0205] In step S1005, the data header of the target storage area is obtained, the data header is parsed, and the status identifier is obtained.

[0206] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0207] In step S1006, the validity of the data is verified based on the status identifier in the data header.

[0208] In step S1007, if the data validity verification passes, the data body is read to obtain the target business data.

[0209] In step S1008, the first checksum of the target business data is calculated, and the first checksum is checked to see if it is consistent with the second checksum in the data header.

[0210] In step S1009, if the first checksum matches the second checksum in the data header, the target business data is returned and the target business data is updated in the cache.

[0211] If the first checksum matches the second checksum in the data header, the data is considered accurate, and the target business data is returned.

[0212] As one implementation, if the first checksum is inconsistent with the second checksum in the data header, the status flag in the data header is modified; if the data in the backup partition of the target storage area is correct, an incremental data synchronization operation is performed on the backup partition; after the incremental synchronization operation is completed, a primary / backup switch operation is performed between the target storage area and the backup partition.

[0213] In essence, to prevent adverse effects from damage to the storage media in the write space or data tampering, some embodiments configure a disaster recovery partition (backup partition or secondary partition) within the basic partition. The disaster recovery partition is the same size as the basic partition (also called the primary partition) to ensure data backup integrity. To avoid low write efficiency, data writing to the disaster recovery partition is not synchronized with the basic partition in real time. The disaster recovery partition is written in two scenarios: the first is during critical events (e.g., device reboot), and the second is during periodic synchronization. Data in the disaster recovery partition may lag behind the basic partition, and in extreme cases, some valid data may be lost. There is a switching scenario between the basic partition and the disaster recovery partition, where their roles are swapped. This achieves data disaster recovery, solving the problems of data tampering or storage failure, and addressing the unrecoverable problems caused by data loss in various scenarios.

[0214] In other words, reading data begins with reading the data header. After parsing the header, the validity of the data is determined based on the status flag. If the data is valid, the data body is read, a checksum is calculated from the data body, and the result is compared with the checksum in the data header. If they match, the data is considered valid and returned. If they don't match, the status flag in the data header is modified to invalidate the data, and subsequent accesses will directly determine the data invalid based on the header. Furthermore, checksum discrepancies are usually caused by incomplete data writing or data tampering. In this case, the current data is considered invalid, and the backup partition is checked for the presence of the data. If it exists, the backup partition data is confirmed to be complete and valid. Based on this process, it can be determined that the primary partition data is abnormal, and a partition switch will be initiated. Since the backup partition data may lag behind the primary partition, an incremental synchronization needs to be performed beforehand. After synchronization is complete, a primary / backup role switch is performed to achieve abnormal recovery.

[0215] By implementing this embodiment, data access efficiency is improved and device I / O is reduced by prioritizing data reading from the cache. If the read data is found in the cache, the efficiency of data access is improved. The validity of data is first determined by a status flag, and data is read only if it is deemed valid. The read data is then verified, further improving both data reading efficiency and accuracy.

[0216] The following section explains how to implement a data deletion request. Figure 11 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment, such as... Figure 11 As shown, the data storage management method may include the following steps.

[0217] In step S1101, in response to receiving a data deletion request, the storage index corresponding to the business data in the data deletion request is obtained.

[0218] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0219] In step S1102, the target storage area corresponding to the business data in the physical storage space is determined based on the storage index.

[0220] In the embodiments of this disclosure, each step can be implemented in any of the ways described in the various embodiments of this disclosure. This disclosure does not limit the implementation of this step and will not elaborate further.

[0221] In step S1103, the data header of the target storage area is obtained, the data header is parsed, and the status identifier is obtained.

[0222] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0223] Before deleting data, you can first check if the data exists. This can be done by reading the status flag in the data header.

[0224] In step S1104, the status flag of the data header is modified.

[0225] When deleting data, only the status bits in the data header are modified, changing the status flag to indicate that the data is invalid, and the management model and cache are updated. Data deletion cannot actually be performed on the original storage area of ​​the physical medium; the data in that original storage area is only truly cleared when the entire area is erased and rewritten.

[0226] By implementing this embodiment, data deletion is achieved by modifying the status flag in the data header rather than actually erasing the data in the corresponding storage medium. This solves the problem of short media lifespan caused by frequent media erasure and writing, and minimizes the cost of deletion operations.

[0227] The following section explains how to implement data modification requests.

[0228] Figure 12 This is a flowchart illustrating a data storage management method according to yet another exemplary embodiment, such as... Figure 12 As shown, the data storage management method may include the following steps.

[0229] In step S1201, in response to receiving a data modification request, the storage index corresponding to the business data in the data modification request is obtained.

[0230] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0231] In step S1202, the target storage area corresponding to the business data in the physical storage space is determined based on the storage index.

[0232] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0233] In step S1203, the data header of the target storage area is obtained, the data header is parsed, and the status identifier is obtained.

[0234] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0235] In step S1204, the status flag of the data header is modified.

[0236] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0237] In step S1205, a new storage index is requested, and the business data involved in the data modification request is written into the target storage area corresponding to the new storage index.

[0238] In the embodiments of this disclosure, this step can be implemented in any of the ways described in the various embodiments of this disclosure. The embodiments of this disclosure do not limit this, nor will they be described in detail.

[0239] This can be understood as follows: data modification cannot actually be performed on the data area in the original storage medium. The least costly operation is to first delete the data, that is, to mark the data as invalid by executing the data deletion process, and then to execute the data writing process to add a new data.

[0240] By implementing this embodiment, the data modification operation is changed to modifying the status flag of the data header before writing the data. This reduces the operational cost of the data modification process, reduces storage fragmentation, and also reduces the number of media erase / write cycles, thus increasing media lifespan.

[0241] Figure 13 This is a block diagram illustrating a data storage management apparatus according to an exemplary embodiment. (Refer to...) Figure 13 The device includes: an index acquisition module 1301, a region determination module 1302, a region status acquisition module 1303, and a data operation module 1304.

[0242] The index acquisition module 1301 is used to respond to a received data operation request by applying for a storage index or acquiring the storage index corresponding to the business data involved in the data operation request. The storage index is used to indicate the location information of the business data in the management model. The management model is a three-level management model based on storage buckets, storage partitions, and storage bits. Each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium. Each storage bucket includes several storage partitions, and each storage partition includes eight storage bits.

[0243] The region determination module 1302 is used to determine the target storage region corresponding to the business data in the physical storage space based on the storage index;

[0244] The region status acquisition module 1303 is used to acquire the data header of the target storage region, parse the data header, and acquire the status identifier; wherein, the storage format of business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the validity of the data in the current storage region;

[0245] The data operation module 1304 is used to perform data operations corresponding to data operation requests based on status identifiers and update the management model.

[0246] In some implementations, the apparatus further includes a configuration loading module 1305, for:

[0247] In response to receiving a storage space configuration request, a physical storage space request is sent to the storage medium;

[0248] Receive the storage configuration table returned by the storage medium based on the physical storage space request, load the storage configuration table, and associate the management model with the physical storage space of the storage medium.

[0249] In some implementations, data operation requests include data write requests. The index retrieval module 1301 is specifically used for:

[0250] In response to receiving a data write request, it determines whether there are any free resources in the TLB; the TLB is used to record the occupancy status of the storage buckets, storage partitions and storage bits in the management model; the occupancy status is used to indicate whether the storage is occupied.

[0251] If there are free resources in the TLB, identify the storage index of the free resources.

[0252] In some implementations, the data operation module 1304 is specifically used for:

[0253] Based on the status identifier, determine whether the target storage area is being written to for the first time;

[0254] If the target storage area is being written to for the first time, the business data involved in the data write request will be written directly to the target storage area.

[0255] If the target storage area is not being written to for the first time, copy all the business data in the target storage area to memory; and clean up invalid data in the target storage area according to the status flag.

[0256] Write the business data involved in the data write request to the logical address in memory to generate the entire block of business data;

[0257] Erase the data in the basic storage unit of the target storage area of ​​the storage medium and write the entire block of business data to the storage medium; and update the management model.

[0258] In some implementations, data operation requests include data read requests, and data operation module 1304 is also used for:

[0259] Based on the storage index, confirm whether the target business data corresponding to the storage index exists in the cache; among which, the cache stores hot data, which includes business data stored in a linked list format based on access time;

[0260] If the target business data corresponding to the storage index is confirmed to exist in the cache, the target business data is returned.

[0261] In some implementations, the data manipulation module 1304 is also used for:

[0262] If it is confirmed that the target business data corresponding to the storage index does not exist in the cache, the validity of the data is verified based on the status identifier in the data header.

[0263] If the data validity verification passes, the data body is read to obtain the target business data;

[0264] Calculate the first checksum of the target business data, and verify whether the first checksum is consistent with the second checksum in the data header;

[0265] If the first checksum matches the second checksum in the data header, return the target business data and update the cache with the target business data.

[0266] In some implementations, the data manipulation module 1304 is also used for:

[0267] If the first checksum is inconsistent with the second checksum in the data header, modify the status flag in the data header;

[0268] If the data in the backup partition of the target storage area is verified to be correct, perform incremental data synchronization operation on the backup partition;

[0269] After the incremental synchronization operation is completed, a primary / backup switch operation will be performed between the target storage area and the backup partition.

[0270] In some implementations, data operation requests include data deletion requests, and data operation module 1304 is also used for:

[0271] Modify the status flag in the data header.

[0272] In some implementations, data operation requests include data modification requests, and data operation module 1304 is also used for:

[0273] Modify the status flag in the data header;

[0274] Apply for a new storage index and write the business data involved in the data modification request into the target storage area corresponding to the new storage index.

[0275] In some implementations, the apparatus also includes a serialization module 1306, used for:

[0276] In response to triggering the serialization process, each basic storage unit in the storage medium is read in a loop.

[0277] Verify data validity based on the status identifier in the header of each basic storage unit;

[0278] If the data validity verification passes, update the management model and the fast table based on the status identifier in the data header.

[0279] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0280] The data storage management device in this application embodiment is responsible for the effective management of the physical storage space of the storage medium through a three-level management model. It has high data storage management efficiency, meets the basic storage requirements of IoT products, can cover a wide range of usage scenarios, and consumes few resources.

[0281] Figure 14 This is a block diagram illustrating an apparatus 1800 for data storage management according to an exemplary embodiment. For example, apparatus 1800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0282] Reference Figure 14 The device 1800 may include one or more of the following components: a processing component 1802, a memory 1804, a power component 1806, a multimedia component 1808, an audio component 1810, an input / output (I / O) interface 1812, a sensor component 1814, and a communication component 1816.

[0283] Processing component 1802 typically controls the overall operation of device 1800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1802 may include one or more processors 1820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1802 may include one or more modules to facilitate interaction between processing component 1802 and other components. For example, processing component 1802 may include a multimedia module to facilitate interaction between multimedia component 1808 and processing component 1802.

[0284] Memory 1804 is configured to store various types of data to support the operation of device 1800. Examples of this data include instructions for any application or method operating on device 1800, contact data, phonebook data, messages, pictures, videos, etc. Memory 1804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0285] The power supply component 1806 provides power to the various components of the device 1800. The power supply component 1806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 1800.

[0286] Multimedia component 1808 includes a screen that provides an output interface between device 1800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1808 includes a front-facing camera and / or a rear-facing camera. When device 1800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0287] Audio component 1810 is configured to output and / or input audio signals. For example, audio component 1810 includes a microphone (MIC) configured to receive external audio signals when device 1800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1804 or transmitted via communication component 1816. In some embodiments, audio component 1810 also includes a speaker for outputting audio signals.

[0288] I / O interface 1812 provides an interface between processing component 1802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0289] Sensor assembly 1814 includes one or more sensors for providing status assessments of various aspects of device 1800. For example, sensor assembly 1814 may detect the on / off state of device 1800, the relative location of components, such as the display and keypad of device 1800, changes in position of device 1800 or a component of device 1800, the presence or absence of user contact with device 1800, the orientation or acceleration / deceleration of device 1800, and temperature changes of device 1800. Sensor assembly 1814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0290] Communication component 1816 is configured to facilitate wired or wireless communication between device 1800 and other devices. Device 1800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0291] In an exemplary embodiment, the apparatus 1800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0292] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1804 including instructions, which can be executed by a processor 1820 of the device 1800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0293] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0294] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A data storage management method, characterized in that, include: In response to receiving a data operation request, the system requests or obtains a storage index corresponding to the business data involved in the data operation request; wherein the storage index is used to indicate the location information of the business data in the management model; wherein the management model is a three-level management model based on storage buckets, storage partitions, and storage bits, each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium, each storage bucket includes several storage partitions, and each storage partition includes eight storage bits; Based on the storage index, determine the target storage area corresponding to the business data in the physical storage space; Obtain the data header of the target storage area, parse the data header, and obtain the status identifier; wherein, the storage format of the business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the data validity of the current storage area; Based on the status identifier, perform the data operation corresponding to the data operation request, and update the management model.

2. The data storage management method according to claim 1, characterized in that, The method further includes: In response to receiving a storage space configuration request, a physical storage space request is sent to the storage medium; Receive the storage configuration table returned by the storage medium based on the physical storage space application, load the storage configuration table to associate the management model with the physical storage space of the storage medium.

3. The data storage management method according to claim 1 or 2, characterized in that, The data operation request includes a data write request, and the response to receiving the data operation request includes requesting a storage index; including: In response to receiving the data write request, it is determined whether there are any idle resources in the TLB; wherein the TLB is used to record the occupancy status of the storage buckets, storage partitions and storage bits of the management model; wherein the occupancy status is used to indicate whether it is occupied; If there are idle resources in the TLB, confirm the storage index of the idle resources.

4. The data storage management method according to claim 3, characterized in that, The step of performing the data operation corresponding to the data operation request based on the status identifier includes: Based on the status identifier, determine whether the target storage area is being written to for the first time; If the target storage area is being written to for the first time, the business data involved in the data write request will be directly written to the target storage area. If the target storage area is not being written to for the first time, all the first data in the first basic storage area where the target storage area is located is copied to memory; and invalid data in the first basic storage area is cleaned up according to the status flag of the first basic storage area. Write the business data involved in the data write request into memory, combine it with the first data to form a whole block of business data; and erase the data in the first basic storage area. Write the entire block of business data to the first basic storage area of ​​the storage medium; and update the management model.

5. The data storage management method according to claim 1, characterized in that, The data operation request includes a data read request. Before executing the data operation corresponding to the data operation request based on the status identifier, the process further includes: Based on the storage index, it is confirmed whether the target business data corresponding to the storage index exists in the cache; wherein, the cache stores hot data, and the hot data includes business data stored in a linked list format based on access time; If the target business data corresponding to the storage index is confirmed to exist in the cache, the target business data is returned.

6. The data storage management method according to claim 5, characterized in that, The step of performing the data operation corresponding to the data operation request based on the status identifier includes: Verify the validity of the data based on the status identifier in the data header; If the data validity verification passes, the data body is read to obtain the target business data; Calculate the first checksum of the target business data, and verify whether the first checksum is consistent with the second checksum in the data header; If the first checksum matches the second checksum in the data header, the target business data is returned, and the target business data is updated in the cache.

7. The data storage management method according to claim 6, characterized in that, The method further includes: If the first checksum is inconsistent with the second checksum in the data header, modify the status identifier in the data header; If the data in the backup partition of the target storage area is verified to be correct, perform an incremental data synchronization operation on the backup partition; After the incremental synchronization operation is completed, the target storage area and the backup partition are switched to primary / backup mode.

8. The data storage management method according to claim 1, characterized in that, The data operation request includes a data deletion request. The step of performing the data operation corresponding to the data operation request based on the status identifier includes: Modify the status flag of the data header.

9. The data storage management method according to claim 4, characterized in that, The data operation request includes a data modification request. The step of performing the data operation corresponding to the data operation request based on the status identifier includes: Modify the status flag of the data header; Apply for a new storage index and write the business data involved in the data modification request into the target storage area corresponding to the new storage index.

10. The data storage management method according to claim 3, characterized in that, The method further includes: In response to triggering the serialization process, each basic storage unit in the storage medium is read cyclically; Verify data validity based on the status identifier in the data header of each basic storage unit; If the data validity verification passes, the management model and the fast table are updated based on the status identifier in the data header.

11. A data storage management device, characterized in that, include: An index acquisition module is used to respond to a received data operation request by applying for a storage index or acquiring a storage index corresponding to the business data involved in the data operation request; wherein, the storage index is used to indicate the location information of the business data in the management model; wherein, the management model is a three-level management model based on storage buckets, storage partitions, and storage bits, each storage bucket corresponds to a basic storage unit of the physical storage space of the storage medium, each storage bucket includes several storage partitions, and each storage partition includes eight storage bits; The region determination module is used to determine the target storage region corresponding to the business data in the physical storage space based on the storage index; The region status acquisition module is used to acquire the data header of the target storage region, parse the data header, and acquire the status identifier; wherein, the storage format of the business data in the physical storage space includes a data header and a data body, and the status identifier is used to indicate the data validity of the current storage region; The data operation module is used to perform the data operation corresponding to the data operation request based on the status identifier, and update the management model.

12. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, include: The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Memory system and de-duplication memory system

    CN110851076A

  • Data storage method and device, electronic equipment and storage medium

    CN114968069A