CPS-based memory-based database data access methods, devices, terminals, and media

By dividing CPS memory granularity into data items and configuring unique fingerprint identifiers to build a data index, the problem of low read efficiency in existing technologies is solved, and efficient data reading is achieved.

CN115657947BActive Publication Date: 2025-11-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211320248.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-26
Publication Date
2025-11-14
Estimated Expiration
2042-10-26

AI Technical Summary

Technical Problem

In existing technologies, when reading data from CPS memory, each granularity needs to be accessed sequentially, which leads to read/write amplification issues and affects data reading efficiency.

Method used

The granularity of CPS memory is divided into several data items, each data item is configured with a unique fingerprint identifier, a data index is built, and data items are filtered according to the fingerprint identifier to read the target data.

Benefits of technology

By partitioning data items and building indexes, unnecessary CPS memory reads are filtered out, improving data reading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115657947B_ABST
    Figure CN115657947B_ABST
Patent Text Reader

Abstract

This invention relates to the field of database data access, specifically disclosing a database data access method, apparatus, terminal, and medium based on CPS memory. The method divides the granularity of CPS memory into several data items, each data item containing at least one granularity; each data item is assigned a unique fingerprint identifier; when storing data into CPS memory, a data index is constructed based on the unique fingerprint identifier of the data item containing the data; when reading data from CPS memory, the corresponding data items are filtered based on the unique fingerprint identifier in the index, and the granularities within the filtered data items are accessed sequentially to retrieve the target data. This invention divides the granularity of CPS memory into data items, constructs a data index based on the data items, filters out unnecessary CPS memory reads, and improves read efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database data access, and specifically to a database data access method, apparatus, terminal, and medium based on CPS memory. Background Technology

[0002] In recent years, emerging non-volatile memory (NVM) has emerged, characterized by byte addressability, non-volatility, high storage density, and low access latency. This type of NVM, connected to the CPU via the memory bus, is also known as persistent memory (PM). In the overall computer architecture, persistent memory occupies a middle position between secondary storage (HDD or SSD) and main memory (DRAM), offering advantages in capacity, performance, and price. In other words, it can be used as both main memory and persistent secondary storage.

[0003] CPS (Continuous Persistent Memory) is increasingly used as a type of persistent memory, for example, as database memory to store database data. However, because the data access granularity of CPS memory differs from that of the CPU, the current method of reading data from CPS memory involves sequentially accessing each granularity of the CPS memory until all data is retrieved. For example, when the data access granularity of CPS memory is 256B, the CPS memory needs to perform multiple 256B reads, which causes read / write amplification and affects data retrieval efficiency. Summary of the Invention

[0004] To address the aforementioned issues, this invention provides a database data access method, apparatus, terminal, and medium based on CPS memory. The method divides CPS memory into data items at the granular level, constructs a data index based on these data items, filters out unnecessary CPS memory reads, and improves read efficiency.

[0005] In a first aspect, the technical solution of the present invention provides a database data access method based on CPS memory, comprising the following steps:

[0006] The granularity of CPS memory is divided into several data items, and each data item contains at least one granularity.

[0007] Configure a unique fingerprint identifier for each data item;

[0008] When storing data in CPS memory, a data index is built based on the unique fingerprint of the data item containing the data.

[0009] When reading data from CPS memory, the corresponding data items are filtered based on the unique fingerprint identifier in the index, and the granularity within the filtered data items is accessed sequentially to read the target data.

[0010] Furthermore, a data index is constructed based on the unique fingerprint identifier of the data item containing the data, specifically including:

[0011] Use the data's metadata as the key and the unique fingerprint of the data item as the target value.

[0012] Furthermore, constructing a data index based on the unique fingerprint identifier of the data item also includes:

[0013] Add the status of the data item to the target value;

[0014] Accordingly, the method also includes the following steps:

[0015] Monitor the status of each data item in real time and update the data index accordingly.

[0016] Furthermore, the method specifically includes the following steps:

[0017] When storing data into CPS memory, a data structure is constructed, which includes a selection bit, a bitmap, a fingerprint array, and two next pointers. The selection bit is used to specify which of the two next pointers is valid, the bitmap is used to store the state of the data item containing the data, the fingerprint array is used to store the unique fingerprint identifier of the data item containing the data, and the two next pointers indicate up and down.

[0018] Construct the target value of the data based on the bitmap and fingerprint data of the data structure;

[0019] The key-value pairs of data are inserted into the corresponding positions in the data index linked list based on the selection bit and the two next pointers.

[0020] Furthermore, the method also includes the following steps:

[0021] When performing a data insertion operation, first check if the key value of the data exists in the data index. If it exists, update the corresponding target value; if it does not exist, insert a new key-value pair into the data index.

[0022] When performing a data update operation, first check if the key value of the data exists in the data index. If it exists, update the data in the corresponding data item. If it does not exist, access the CPS memory granularity to check if the corresponding data exists. If it exists, update the data index. If it does not exist, return an operation failure message.

[0023] Furthermore, the method also includes the following steps:

[0024] Create a cache in CPS memory and store the data index in the cache.

[0025] Furthermore, the method also includes the following steps:

[0026] Generate a log list for each thread in CPS memory;

[0027] When performing an insert operation into CPS memory, a new log node is allocated and inserted into the log list;

[0028] When performing an update operation on CPS memory, the new log is appended to the corresponding log node before modifying the data;

[0029] When performing a delete operation on CPS memory, the corresponding log node is deleted from the log list.

[0030] Secondly, the technical solution of the present invention provides a database data access device based on CPS memory, comprising,

[0031] Data item allocation module: Divides the granularity of CPS memory into several data items, each data item containing at least one granularity;

[0032] Identification configuration module: Configures a unique fingerprint identifier for each data item;

[0033] Index building module: When storing data into CPS memory, it builds a data index based on the unique fingerprint of the data item containing the data;

[0034] Data reading module: When reading data from CPS memory, it filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data.

[0035] Cache creation module: Creates a cache in CPS memory and stores the data index in the cache;

[0036] Log list operation module: Generates a log list for each thread in CPS memory; when performing an insert operation into CPS memory, allocates a new log node and inserts it into the log list; when performing an update operation into CPS memory, appends the new log to the corresponding log node before modifying the data; when performing a delete operation into CPS memory, deletes the corresponding log node from the log list.

[0037] Thirdly, the technical solution of the present invention provides a terminal, comprising:

[0038] Memory, used to store database data access programs based on CPS memory;

[0039] A processor, configured to implement the steps of the CPS memory-based database data access method as described in any of the preceding claims when executing the CPS memory-based database data access program.

[0040] Fourthly, the present invention provides a computer-readable storage medium storing a CPS memory-based database data access program, wherein when the CPS memory-based database data access program is executed by a processor, it implements the steps of the CPS memory-based database data access method as described in any of the above claims.

[0041] This invention provides a database data access method, apparatus, terminal, and medium based on CPS memory. Compared with existing technologies, it has the following advantages: It divides CPS memory into data items, each with a unique fingerprint identifier. A data index is constructed based on the unique fingerprint identifier of the data item. When reading data, the corresponding data item is found based on the unique fingerprint identifier, and the data is retrieved from the found data item, eliminating the need to traverse all granularities of CPS memory. This invention divides CPS memory into data items and constructs a data index based on these items, filtering out unnecessary CPS memory reads and improving read efficiency. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.

[0043] Figure 1 This is a schematic diagram of a database data access method based on CPS memory provided in an embodiment of the present invention.

[0044] Figure 2 This is a schematic block diagram of a database data access device based on CPS memory provided in an embodiment of the present invention.

[0045] Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation

[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] Figure 1 This is a schematic diagram of a database data access method based on CPS memory provided in an embodiment of the present invention, as shown below. Figure 1As shown, the method includes the following steps.

[0048] S1 divides the granularity of CPS memory into several data items, each data item containing at least one granularity.

[0049] In practice, data items are divided according to the difference in access granularity between the CPU and CPS memory to ensure that data is within one data item as much as possible and to improve data reading efficiency.

[0050] S2, configure a unique fingerprint identifier for each data item.

[0051] It should be noted that the unique fingerprint identifier configured for the data item also needs to be stored within the data item, so that the corresponding data item can be found later based on the unique fingerprint identifier.

[0052] S3, when storing data into CPS memory, constructs a data index based on the unique fingerprint identifier of the data item where the data is located.

[0053] A data index is used by the system to quickly locate the target data. The data index includes a key and a target value. The key is used to match the target data. In some specific embodiments, the data's metadata information can be used as the key, and the unique fingerprint identifier of the data item can be used as the target value. Then, when searching for the target data, template data is retrieved based on the metadata and the unique fingerprint identifier.

[0054] In some specific embodiments, a cache is created in CPS memory, and the data index is stored in the cache. The data index is retrieved from the cache for data lookup.

[0055] S4, when reading data from CPS memory, filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data.

[0056] When it is necessary to find a target data, the corresponding metadata is first matched in the data index based on the target data's metadata. Then, the unique fingerprint identifier corresponding to the metadata is found. The data item is matched based on the unique fingerprint identifier, unnecessary data items are filtered out, and the granularity within the matched data item is accessed in turn to read the target data.

[0057] This invention provides a database data access method based on CPS memory. The CPS memory is divided into data items, each with a unique fingerprint identifier. A data index is constructed based on the unique fingerprint identifier of the data item containing the data. When reading data, the corresponding data item is located based on the unique fingerprint identifier, and the data is retrieved from the found data item, eliminating the need to traverse all granularities of the CPS memory. This invention divides the CPS memory into data items and constructs a data index based on these items, filtering out unnecessary CPS memory reads and improving read efficiency.

[0058] Based on the above embodiments, as a preferred implementation, constructing a data index based on the unique fingerprint identifier of the data item further includes: adding the state of the data item to the target value. Correspondingly, the state of each data item is monitored in real time and updated in the data index.

[0059] The status of data items is also added to the target value of the data index. The status of data items is monitored in real time, and the status of data items is updated in the data index. In this way, when reading certain data, the status of the data item containing the target data can be obtained from the data index. If the data item is deleted, there is no need to read it again, which further improves the efficiency of reading and reading result feedback.

[0060] Based on the above embodiments, as a preferred implementation, the construction of a data index specifically includes the following steps:

[0061] Step 1: When storing data into CPS memory, construct the data structure, which includes a selection bit, a bitmap, a fingerprint array, and two next pointers.

[0062] The selection bit is used to specify which of the two next pointers is valid, the bitmap is used to store the state of the data item where the data is located, the fingerprint array is used to store the unique fingerprint identifier of the data item where the data is located, and the two next pointers indicate up and down.

[0063] Step 2: Construct the target value of the data based on the bitmap and fingerprint data of the data structure.

[0064] Step 3: Based on the selection bit and the two next pointers, insert the key-value pairs of the data into the corresponding positions in the data index linked list.

[0065] The data index exists in list form. After constructing a key-value pair for a certain data, the newly constructed key-value pair needs to be added to the list of the data index. The position in the list where the key-value pair is inserted can be set according to user needs. Therefore, in this preferred embodiment, the target value is constructed using a data structure. The data structure contains not only the data item and its state, but also an indication of the position in the data index list where the key-value pair should be inserted, indicated by a selection bit and two next pointers. The two next pointers indicate up and down, and the selection bit specifies which of the two next pointers is valid. For example, if the selection bit specifies that the up pointer is valid, the key-value pair is inserted above the base key-value pair in the data index. It should be noted that the base key-value pair can be the last key-value pair or another key-value pair specified by the user, which can be set according to user requirements.

[0066] Based on the above embodiments, as a preferred implementation, the method further includes the following steps:

[0067] Step 1: When performing data insertion, first check if the key-value pair of the data exists in the data index. If it exists, update the corresponding target value; if it does not exist, insert the new key-value pair into the data index.

[0068] Step 2: When performing a data update operation, first check if the key value of the data exists in the data index. If it exists, update the data in the corresponding data item. If it does not exist, access the CPS memory granularity to check if the corresponding data exists. If it exists, update the data index. If it does not exist, return an operation failure message.

[0069] When performing a data insertion operation, the system first checks if the data already exists in CPS memory. This is done by checking if the data's key-value pair exists in the data index. If it exists, the data is stored and the corresponding target value is updated. If it doesn't exist, a new key-value pair needs to be built and the data index updated. Similarly, when performing a data update operation, the system first checks if the data already exists. This is done by checking if the data's key-value pair exists in the data index. If it exists, the corresponding data item is found, and the data within that item is updated. If it doesn't exist in the data index, the system then accesses the CPS memory granularity to determine if the corresponding data can be found. If the data is found, a key-value pair is built and the data index updated. If it doesn't exist, the update operation cannot be performed, and an operation failure message is returned.

[0070] At the same time, the above steps enable fast and efficient data insertion and updating, improving the effectiveness of data access.

[0071] Based on the above embodiments, as a preferred implementation, the method further includes the following steps:

[0072] Step 1: Generate a log list for each thread in CPS memory;

[0073] Step 2: When performing an insert operation into CPS memory, allocate a new log node and insert it into the log list;

[0074] Step 3: When performing an update operation on CPS memory, the new log is appended to the corresponding log node before modifying the data;

[0075] Step four: When performing a delete operation on the CPS memory, delete the corresponding log node from the log list.

[0076] Currently, access to CPS memory granularity involves locking. When an operation accesses a specific granularity, that granularity is locked, and unlocked after the operation is complete before other operations can access it. This locking and unlocking process amplifies lock overhead and reduces data operation efficiency. Therefore, in some preferred implementations, a log list is generated for each thread in the CPS memory. This log list supports insertion, updating, and deletion. When performing an insertion operation into CPS memory, a new log node is allocated and inserted into the log list. When performing an update operation, the new log is appended to the corresponding log node before modifying the data. When performing a deletion operation, the corresponding log node is deleted from the log list. Based on the log list configuration, lock-free control is achieved, improving data operation efficiency.

[0077] The foregoing has described in detail an embodiment of a database data access method based on CPS memory. Based on the database data access method based on CPS memory described in the above embodiment, this invention also provides a database data access device based on CPS memory corresponding to the method.

[0078] Figure 2 This is a schematic block diagram of a database data access device based on CPS memory provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the device includes: a data item allocation module, an identifier configuration module, an index building module, a data reading module, a cache creation module, and a log list operation module.

[0079] Data Item Allocation Module: Divides the granularity of CPS memory into several data items, each data item containing at least one granularity.

[0080] Identifier Configuration Module: Configures a unique fingerprint identifier for each data item.

[0081] Index building module: When storing data into CPS memory, it builds a data index based on the unique fingerprint of the data item.

[0082] Data reading module: When reading data from CPS memory, it filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data.

[0083] Cache creation module: Creates a cache in CPS memory and stores the data index in the cache.

[0084] Log list operation module: Generates a log list for each thread in CPS memory; when performing an insert operation into CPS memory, allocates a new log node and inserts it into the log list; when performing an update operation into CPS memory, appends the new log to the corresponding log node before modifying the data; when performing a delete operation into CPS memory, deletes the corresponding log node from the log list.

[0085] The index building module constructs a data index based on the unique fingerprint of the data item containing the data. Specifically, it uses the metadata information of the data as the key value and the unique fingerprint of the data item containing the data as the target value.

[0086] Meanwhile, the index building module constructs a data index based on the unique fingerprint identifier of the data item containing the data, and also includes adding the status of the data item to the target value. Correspondingly, the device can also be equipped with a data item status monitoring module to monitor the status of each data item in real time and update the data index accordingly.

[0087] When the index building module stores data into CPS memory, it constructs the data index by building a data structure. Specifically, the data structure includes a selection bit, a bitmap, a fingerprint array, and two next pointers. The selection bit specifies which of the two next pointers is valid, the bitmap stores the state of the data item, the fingerprint array stores the unique fingerprint identifier of the data item, and the two next pointers indicate up and down. The index building module constructs the data structure, then constructs the target value of the data based on the bitmap and fingerprint data of the data structure, and inserts the key-value pairs of the data into the corresponding positions in the data index linked list according to the selection bit and the two next pointers.

[0088] Simultaneously, during data insertion, the index building module first checks if the data's key-value pair exists in the data index. If it exists, the corresponding target value is updated; otherwise, a new key-value pair is inserted into the data index. During data update, the index building module first checks if the data's key-value pair exists in the data index. If it exists, the data in the corresponding data item is updated; otherwise, the CPS memory granularity is accessed to check if the corresponding data exists. If it exists, the data index is updated; otherwise, an operation failure message is returned.

[0089] The database data access device based on CPS memory in this embodiment is used to implement the aforementioned database data access method based on CPS memory. Therefore, the specific implementation of this device can be found in the embodiment section of the database data access method based on CPS memory mentioned above. Thus, the specific implementation can be referred to the description of the corresponding embodiments, and will not be elaborated here.

[0090] Furthermore, since the database data access device based on CPS memory in this embodiment is used to implement the aforementioned database data access method based on CPS memory, its function corresponds to the function of the above method, and will not be repeated here.

[0091] Figure 3 A schematic diagram of a terminal device 300 provided in an embodiment of the present invention includes: a processor 310, a memory 320, and a communication unit 330. The processor 310 is used to implement the following steps when executing a database data access program based on CPS memory stored in the memory 320:

[0092] S1 divides the granularity of CPS memory into several data items, each data item containing at least one granularity;

[0093] S2, configure a unique fingerprint identifier for each data item;

[0094] S3, when storing data into CPS memory, construct a data index based on the unique fingerprint of the data item where the data is located;

[0095] S4, when reading data from CPS memory, filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data.

[0096] This invention divides CPS memory into data items, each with a unique fingerprint identifier. A data index is built based on the unique fingerprint identifier of the data item containing the data. When reading data, the corresponding data item is found based on the unique fingerprint identifier, and the data can be retrieved from the found data item without traversing all granularities of CPS memory. This invention divides CPS memory into data items and builds a data index based on the data items, filtering out unnecessary CPS memory reads and improving read efficiency.

[0097] The terminal device 300 includes a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It can be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0098] The memory 320 can be used to store the execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile memory terminal 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. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 is able to perform some or all of the steps in the above method embodiments.

[0099] The processor 310 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 310 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0100] The communication unit 330 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.

[0101] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0102] The computer storage medium stores a database data access program based on CPS memory. When the CPS memory-based database data access program is executed by the processor, it performs the following steps:

[0103] S1 divides the granularity of CPS memory into several data items, each data item containing at least one granularity;

[0104] S2, configure a unique fingerprint identifier for each data item;

[0105] S3, when storing data into CPS memory, construct a data index based on the unique fingerprint of the data item where the data is located;

[0106] S4, when reading data from CPS memory, filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data.

[0107] This invention divides CPS memory into data items, each with a unique fingerprint identifier. A data index is built based on the unique fingerprint identifier of the data item containing the data. When reading data, the corresponding data item is found based on the unique fingerprint identifier, and the data can be retrieved from the found data item without traversing all granularities of CPS memory. This invention divides CPS memory into data items and builds a data index based on the data items, filtering out unnecessary CPS memory reads and improving read efficiency.

[0108] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0109] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0110] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0111] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0112] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.

Claims

1. A database data access method based on CPS memory, characterized in that, Includes the following steps: The granularity of CPS memory is divided into several data items, and each data item contains at least one granularity. Configure a unique fingerprint identifier for each data item; When storing data in CPS memory, a data index is constructed based on the unique fingerprint identifier of the data item. This includes: constructing a data structure, which includes a selection bit, a bitmap, a fingerprint array, and two next pointers; the selection bit specifies which of the two next pointers is valid, the bitmap stores the state of the data item, the fingerprint array stores the unique fingerprint identifier of the data item, and the two next pointers indicate up and down; constructing the target value of the data based on the bitmap and fingerprint data of the data structure; and inserting the key-value pairs of the data into the corresponding positions in the data index linked list based on the selection bit and the two next pointers. When reading data from CPS memory, the corresponding data items are filtered based on the unique fingerprint identifier in the index, and the granularity within the filtered data items is accessed sequentially to read the target data.

2. The database data access method based on CPS memory according to claim 1, characterized in that, A data index is constructed based on the unique fingerprint identifier of the data item containing the data, specifically including: Use the data's metadata as the key and the unique fingerprint of the data item as the target value.

3. The database data access method based on CPS memory according to claim 2, characterized in that, The data index is constructed based on the unique fingerprint identifier of the data item, and also includes: Add the status of the data item to the target value; Accordingly, the method also includes the following steps: Monitor the status of each data item in real time and update the data index accordingly.

4. The database data access method based on CPS memory according to claim 3, characterized in that, The method also includes the following steps: When performing a data insertion operation, first check if the key value of the data exists in the data index. If it exists, update the corresponding target value; if it does not exist, insert a new key-value pair into the data index. When performing a data update operation, first check if the key value of the data exists in the data index. If it exists, update the data in the corresponding data item. If it does not exist, access the CPS memory granularity to check if the corresponding data exists. If it exists, update the data index. If it does not exist, return an operation failure message.

5. The database data access method based on CPS memory according to claim 4, characterized in that, The method also includes the following steps: Create a cache in CPS memory and store the data index in the cache.

6. The database data access method based on CPS memory according to claim 5, characterized in that, The method also includes the following steps: Generate a log list for each thread in CPS memory; When performing an insert operation into CPS memory, a new log node is allocated and inserted into the log list; When performing an update operation on CPS memory, the new log is appended to the corresponding log node before modifying the data; When performing a delete operation on CPS memory, the corresponding log node is deleted from the log list.

7. A database data access device based on CPS memory, characterized in that, include, Data item allocation module: Divides the granularity of CPS memory into several data items, each data item containing at least one granularity; Identification configuration module: Configures a unique fingerprint identifier for each data item; The index building module: When storing data in CPS memory, it builds a data index based on the unique fingerprint identifier of the data item. This includes: building a data structure, which consists of a selection bit, a bitmap, a fingerprint array, and two next pointers; the selection bit specifies which of the two next pointers is valid, the bitmap stores the state of the data item, the fingerprint array stores the unique fingerprint identifier of the data item, and the two next pointers indicate up and down; constructing the target value of the data based on the bitmap and fingerprint data of the data structure; and inserting the key-value pairs of the data into the corresponding positions in the data index linked list based on the selection bit and the two next pointers. Data reading module: When reading data from CPS memory, it filters the corresponding data items based on the unique fingerprint identifier in the index, accesses the granularity within the filtered data items in turn, and reads the target data. Cache creation module: Creates a cache in CPS memory and stores the data index in the cache; Log list operation module: Generates a log list for each thread in CPS memory; when performing an insert operation into CPS memory, allocates a new log node and inserts it into the log list; when performing an update operation into CPS memory, appends the new log to the corresponding log node before modifying the data; when performing a delete operation into CPS memory, deletes the corresponding log node from the log list.

8. A terminal, characterized in that, include: Memory, used to store database data access programs based on CPS memory; A processor, configured to implement the steps of the CPS memory-based database data access method as described in any one of claims 1-6 when executing the CPS memory-based database data access program.

9. A computer-readable storage medium, characterized in that, The readable storage medium stores a CPS memory-based database data access program, which, when executed by a processor, implements the steps of the CPS memory-based database data access method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Distributed replica storage system with web services interface

    CN101496005A

  • Buffer layer used in industrial big data aggregation, aggregation system and method

    CN108804347A