Data storage method, device and equipment, readable storage medium and program product

By obtaining and utilizing the time characteristic values ​​of the data table, the problem of data life cycle observation difficulties in the LSM tree is solved in the process of transferring data from the current data layer to the target data layer, and the flexibility of data storage is improved.

CN119938667APending Publication Date: 2025-05-06SUGON INFORMATION IND +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411848386.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, when data is stored in the form of an LSM tree, the life cycle of the data in the storage process cannot be specifically observed, resulting in poor storage flexibility.

Method used

During the process of transferring the first data table from the current data layer to the target data layer, the first time characteristic value of the first data table is obtained, and used for format conversion and time characteristic value determination, the second data table and the second time characteristic value are generated, and finally transferred to the target data layer.

Benefits of technology

It realizes the observation and display of the data life cycle in the hierarchical data structure, and improves the flexibility of data storage processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938667A_ABST
    Figure CN119938667A_ABST
Patent Text Reader

Abstract

The invention relates to a data storage method and device, equipment, a readable storage medium and a program product. The method comprises the following steps: acquiring a first time characteristic value of a first data table in a process of transferring the first data table from a current data layer to a target data layer, then performing format conversion on the first data table according to a data format corresponding to the target data layer to obtain a second data table, and storing the second data table in the current data layer; and determining a second time characteristic value of the second data table according to the first time characteristic value, and finally transferring the second data table and the second time characteristic value into the target data layer. By adopting the method, the flexibility of the data storage process can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data storage method, apparatus, device, readable storage medium and program product. Background Art

[0002] LSM tree (Log-Structured Merge Tree) is a data structure commonly used to store data. It includes multiple data layers. When data is stored in the form of LSM tree, the data layer will be converted in a specific life cycle.

[0003] However, when data is stored in the form of an LSM tree, it is impossible to specifically observe the life cycle of the data during the storage process. Therefore, traditional data storage methods have the problem of poor storage flexibility. Summary of the invention

[0004] Based on this, it is necessary to provide a data storage method, device, equipment, readable storage medium and program product that can improve storage flexibility in response to the above technical problems.

[0005] In a first aspect, the present application provides a data storage method, comprising:

[0006] In the process of transferring the first data table from the current data layer to the target data layer, obtaining a first time characteristic value of the first data table;

[0007] Convert the first data table into a data format corresponding to the target data layer to obtain a second data table, and determine a second time characteristic value of the second data table according to the first time characteristic value;

[0008] The second data table and the second time characteristic value are transferred to the target data layer.

[0009] In the above embodiment, in the hierarchical data structure, when the first data table is transferred from the current data layer to the target data layer, the first time characteristic value corresponding to the first data table is obtained, and then the time characteristic value corresponding to the second data table after the first data table is converted to the target data layer is determined according to the first time characteristic value, and the corresponding time characteristic value is set for the data table in each data layer, which shows the life cycle of the data in the entire storage process and improves the flexibility of the data storage process.

[0010] In one embodiment, the current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk, and determining a second time characteristic value of a second data table according to the first time characteristic value includes:

[0011] In the case where the current data layer is the first data layer, the first time characteristic value is used as the second time characteristic value, and the first time characteristic value is the time when the first data table is established in the first data layer;

[0012] When the current data layer is the target sublayer in the second data layer or the third data layer, the second time characteristic value is determined according to the first time characteristic value and the number of the first data tables.

[0013] In the above embodiment, when the current data layers are different, the second time characteristic value is determined by combining the first time characteristic value and the number of the first data table, so that the second time characteristic value is more accurate.

[0014] In one embodiment, determining the second time characteristic value according to the first time characteristic value and the quantity of the first data table includes:

[0015] When the current data layer is the second data layer and the number of the first data table is one, the first time feature value is used as the second time feature value;

[0016] When the current data layer is the second data layer and the number of the first data tables is plural, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

[0017] In the above embodiment, when the current data layer is the second data layer, the number of first data tables can be one. At this time, the server directly uses the first time characteristic value as the second time characteristic value, and the second time characteristic value can accurately represent the time when the data in the second data table is stored in the hierarchical data structure; the number of first data tables can also be multiple. At this time, each first data table will be merged into a second data table and sunk to the target data layer. The server determines the maximum time characteristic value from each first time characteristic value as the second time characteristic value, which can make the second time characteristic value accurately represent the time when the data in the second data table is latest stored in the hierarchical data structure, so that the life cycle of the data can be more accurately represented.

[0018] In one embodiment, determining the second time characteristic value according to the first time characteristic value and the quantity of the first data table further includes:

[0019] When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

[0020] In the above embodiment, since the server merges multiple first data tables based on the data range corresponding to each first data table, the values ​​of the first time characteristic values ​​corresponding to each first data table may be discontinuous. In order to make the second time characteristic value accurately represent the storage time of the data in the second data table, in the embodiment of the present application, the minimum time characteristic value is determined from each first time characteristic value as the second time characteristic value. In this way, the second time characteristic value can represent the data stored in the second data table at least at the storage time corresponding to the second time characteristic value.

[0021] In one embodiment, the method further comprises:

[0022] The second-level time feature value corresponding to the target data layer is updated according to the first-level time feature value corresponding to the current data layer.

[0023] In the above embodiment, the server sets a hierarchical time characteristic value for each data layer, so that when subsequently observing the data corresponding to each storage moment, the data layer corresponding to the data can be determined based on the hierarchical time characteristic value corresponding to each data layer.

[0024] In one embodiment, updating the second-level time feature value corresponding to the target data layer according to the first-level time feature value corresponding to the current data layer includes:

[0025] When the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the first-level time feature value is the same as the first time feature value.

[0026] In the above embodiment, when the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the second-level time feature value can accurately represent the writing time of the latest data written into the hierarchical data structure in the second data layer.

[0027] In one embodiment, updating the second-level time feature value corresponding to the target data layer according to the first-level time feature value corresponding to the current data layer includes:

[0028] When the current data layer is a target sublayer in the second data layer or the third data layer, determining target time characteristic values ​​of other data tables in the current data layer except the first data table;

[0029] A minimum time feature value is determined from the first-level time feature value and each target time feature value, and the determined minimum time feature value is used as the second-level time feature value.

[0030] In the above embodiment, when the current data layer is the second data layer, the first data table is converted into the second data table. After being transferred to the target data layer, there may be other data tables in the current data layer that have not undergone data layer conversion. The target time feature values ​​corresponding to the other data tables and the first-level time feature value corresponding to the current data layer are both greater than or equal to the time feature value corresponding to the second data table. The minimum time feature value is selected as the second-level time feature value. The second-level time feature value can represent the write time of the data written into the hierarchical data structure in the target data layer the latest; and when the current data layer is the target sublayer in the third data layer, the target data layer also belongs to the target sublayer in the third data layer. After the first data table is converted into the second data table and transferred to the target data layer, the target time feature values ​​corresponding to other data tables in the current data layer that have not undergone data layer conversion may be greater than the time feature value corresponding to the second data table, or may be less than the time feature value corresponding to the second data table. The second-level time feature value determined by the above embodiment can represent that the data written into the hierarchical data structure before the time corresponding to the second-level time feature value has been transferred to the target data layer or other data layers subsequent to the target data layer.

[0031] In a second aspect, the present application also provides a data storage device, comprising:

[0032] An acquisition module, configured to acquire a first time characteristic value of the first data table during a process of transferring the first data table from the current data layer to the target data layer;

[0033] A conversion module, used for converting the first data table into a data format corresponding to the target data layer to obtain a second data table, and determining a second time characteristic value of the second data table according to the first time characteristic value;

[0034] The transfer module is used to transfer the second data table and the second time characteristic value to the target data layer.

[0035] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of the first aspect when executing the computer program.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect described above.

[0037] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect are implemented.

[0038] The above-mentioned data storage method, device, equipment, readable storage medium and program product obtain the first time characteristic value of the first data table during the process of transferring the first data table from the current data layer to the target data layer, then convert the first data table into a data format corresponding to the target data layer to obtain the second data table, and determine the second time characteristic value of the second data table according to the first time characteristic value, and finally transfer the second data table and the second time characteristic value to the target data layer. In this way, in the hierarchical data structure, when the first data table is transferred from the current data layer to the target data layer, the first time characteristic value corresponding to the first data table is obtained, and then the time characteristic value corresponding to the second data table after the first data table is converted to the target data layer is determined according to the first time characteristic value, and the corresponding time characteristic value is set for the data table in each data layer, which shows the life cycle of the data in the entire storage process and improves the flexibility of the data storage process. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 An application environment diagram of a data storage method in one embodiment;

[0041] Figure 2 A schematic diagram of a flow chart of a data storage method in one embodiment;

[0042] Figure 3 is a flow chart of step 202 in another embodiment;

[0043] Figure 4 A schematic diagram of a flow chart of an exemplary data storage method in another embodiment;

[0044] Figure 5 is a structural block diagram of a data storage device in one embodiment;

[0045] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] LSM tree (Log-Structured Merge Tree) is a data structure commonly used to store data, including the readable and writable Memtable (memory table layer) in memory, the readable and non-writable Immtable (immutable memory table layer), and the SSTable (sorted string table layer, immutable) stored on the disk. In the LSM tree, the data table in the Memtable layer usually stores the most recently written data. When the amount of data stored in the data table in the Memtable layer reaches the threshold, the data table in the Memtable layer will be converted into a data table in the Immtable layer. Subsequently, the data table in the Immtable layer will be converted into a data table in the SSTable layer. The SSTable layer also includes sub-data layers at different levels. The data tables under each sub-data layer will be continuously merged and converted to the next sub-data layer.

[0048] However, when storing data in the form of an LSM tree, it is impossible to observe the conversion process of the data in the LSM tree, that is, it is impossible to determine to which level the data has sunk. Therefore, there is an urgent need for an observation method to observe the conversion progress of the data in the LSM tree, so as to improve the flexibility of the data storage process.

[0049] In view of this, the present application provides a data storage method, device, equipment, readable storage medium and program product, which obtains the first time characteristic value of the first data table during the process of transferring the first data table from the current data layer to the target data layer, then converts the first data table according to the data format corresponding to the target data layer to obtain the second data table, and determines the second time characteristic value of the second data table according to the first time characteristic value, and finally transfers the second data table and the second time characteristic value to the target data layer. In this way, in the hierarchical data structure, when the first data table is transferred from the current data layer to the target data layer, the first time characteristic value corresponding to the first data table is obtained, and then the second time characteristic value corresponding to the second data table after the first data table is converted to the target data layer is determined according to the first time characteristic value, thereby setting the corresponding time characteristic value for the data table in each data layer, showing the life cycle of the data in the entire storage process, and improving the flexibility of the data storage process.

[0050] The data storage method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the data storage system can store the data that the server 101 needs to process. The data storage system can be integrated on the server 101, or it can be placed on the cloud or other network servers. The server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0051] In an exemplary embodiment, Figure 2 As shown, a data storage method is provided, which is applied to Figure 1 The server 101 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:

[0052] Step 201 , when a first data table is transferred from a current data layer to a target data layer, a first time characteristic value of the first data table is obtained.

[0053] The first data table may be a data table to be subjected to data layer conversion, and is stored in the storage system in the form of a hierarchical data structure.

[0054] A hierarchical data structure may be a data structure including multiple data layers for storing data, for example, an LSM tree, a B-tree, etc.

[0055] In the embodiment of the present application, the hierarchical data structure includes multiple data layers, and the first data table is in any data layer.

[0056] In a possible implementation, the server may obtain the first time characteristic value corresponding to the first data table. Optionally, the server may directly obtain the first time characteristic value from a database.

[0057] In an embodiment of the present application, the first time characteristic value can be used to characterize the storage time of the data in the first data table into the hierarchical data structure. The larger the first time characteristic value is, the shorter the storage time of the data in the first data table is.

[0058] Optionally, the server may determine the storage time according to a system clock; optionally, the server may determine the storage time according to a time format such as GMT or UTC.

[0059] Step 202: convert the first data table into a data format corresponding to the target data layer to obtain a second data table, and determine a second time characteristic value of the second data table according to the first time characteristic value.

[0060] After determining the first time feature corresponding to the first data table, the server can perform data layer conversion on the first data table. In an embodiment of the present application, the server can convert the first data table into a data format corresponding to the data in the target data layer. For example, in the LSM tree, if the current data layer is the Memtable layer and the target data layer is the Immtable layer, the server can convert the data in the first data table into a data format corresponding to the data in the Immtable layer, thereby obtaining a second data table that satisfies the Immtable layer data format.

[0061] After obtaining the second data table, the server may determine the second time characteristic value of the second data table according to the first time characteristic value.

[0062] Optionally, the server may use the first time feature value as the second time feature value so that the second data table inherits the time feature of the first data table; optionally, if there are multiple first data tables and the first data tables are merged during data layer conversion, the server may use the time feature value with a larger value in the first time feature value as the second time feature value, so that the second time feature value can represent the latest storage time of the data in the second data table.

[0063] Step 203: transfer the second data table and the second time characteristic value to the target data layer.

[0064] After the server obtains the converted second data table and the second time characteristic value corresponding to the second data table, the server may transfer the second data table and the second time characteristic value to the target data layer accordingly.

[0065] In the data conversion process of the traditional LSM tree, since the Memtable layer and the Immtable layer are stored in memory, in order to avoid the loss of data in the Memtable layer and the Immtable layer due to host abnormalities, corresponding log files will be generated for different Memtable layers and Immtable layers. When the Memtable layer is converted to the Immtable layer, the corresponding log file will also become a readable but not writable log file. When the Immtable layer is converted to the SSTable layer, the corresponding readable but not writable log file is deleted.

[0066] Therefore, in an embodiment of the present application, the server can write the data content corresponding to the second data table and the second time characteristic value into a log file. Optionally, when the storage system is interrupted for some reason, resulting in the loss of data in the data layer not in the disk, the server can restore the data in the data layer not in the disk based on the log file, and ensure the consistency of the restored data; optionally, when the second time characteristic value is written into the log file, it can facilitate the server's own monitoring of the data life cycle. When the second time characteristic value written into the log file indicates that the second data table has been transferred to the data layer on the disk, the server can delete the second data table and the second time characteristic value from the log file, thereby avoiding the storage of a large amount of solidified data in the log file and reducing the waste of storage resources.

[0067] Since a large number of log files are generated during traditional data storage, which makes management troublesome, in order to facilitate management, in a possible implementation, the server can write each data table and its corresponding time characteristic value as a data record into a log file. The preset file records the data and time characteristic values ​​corresponding to each data table in the hierarchical data structure to which the first data table belongs.

[0068] In the above embodiment, in the hierarchical data structure, when the first data table is transferred from the current data layer to the target data layer, the first time characteristic value corresponding to the first data table is obtained, and then the time characteristic value corresponding to the second data table after the first data table is converted to the target data layer is determined according to the first time characteristic value, and the corresponding time characteristic value is set for the data table in each data layer, which shows the life cycle of the data in the entire storage process and improves the flexibility of the data storage process.

[0069] In one embodiment, based on the above embodiment, see Figure 3 This embodiment relates to a process of determining a second time characteristic value of a second data table according to a first time characteristic value, wherein the current data layer and the target data layer are both data layers in a hierarchical data structure, and the hierarchical data structure includes a first data layer and a second data layer in memory and a third data layer in a disk. Figure 3 As shown, step 202 may include step 301 and step 302.

[0070] In an embodiment of the present application, when data is stored in the form of a hierarchical data structure, it can be first stored in a data table in the first data layer. When the amount of data in the data table in the first data layer reaches a threshold, the data table will undergo data layer conversion and become a data table in the second data layer. At a preset time, the data table in the second data layer will undergo data solidification and be converted into a data table in the third data layer. Therefore, the number of data tables in the first data layer can be one, while the number of data tables in the second data layer and the third data layer can be multiple.

[0071] Step 301: When the current data layer is the first data layer, the first time feature value is used as the second time feature value.

[0072] In an embodiment of the present application, when the server stores data into a hierarchical data structure, it can first establish a data table in the first data layer and write the data into the data table. At this time, the server can set the establishment time of the data table to the time characteristic value corresponding to the data table. Therefore, when the current data layer is the first data layer, the first time characteristic value is the time when the first data table is established in the first data layer.

[0073] Since the number of data tables in the first data layer is one, the server can directly use the first time feature value as the second time feature value, so that the second time feature value represents the time when the data is stored in the hierarchical data structure.

[0074] Step 302: When the current data layer is the target sublayer in the second data layer or the third data layer, determine the second time characteristic value according to the first time characteristic value and the number of the first data tables.

[0075] In an embodiment of the present application, when the current data layer is the target sublayer in the second data layer or the third data layer, the number of first data tables may be one or more. For different numbers of first data tables, the data conversion method is different. In order to make the second time characteristic value more accurately represent the storage time of the data in the second data table, the server determines the second time characteristic value based on the first time characteristic value and the number of first data tables.

[0076] In a possible implementation, when the current data layer is the second data layer, the number of first data tables may be one or more. Optionally, when the current data layer is the second data layer and the number of first data tables is one, the server may use the first time feature value as the second time feature value. Optionally, when the current data layer is the second data layer and the number of first data tables is more than one, the maximum time feature value is determined from each first time feature value, and the maximum time feature value is used as the second time feature value.

[0077] In an embodiment of the present application, when the current data layer is the second data layer, the number of first data tables can be one. In this case, the server directly uses the first time characteristic value as the second time characteristic value, and the second time characteristic value can accurately represent the time when the data in the second data table is stored in the hierarchical data structure; the number of first data tables can also be multiple. In this case, each first data table will be merged into a second data table and sunk to the target data layer. The server determines the maximum time characteristic value from each first time characteristic value as the second time characteristic value, which can make the second time characteristic value accurately represent the time when the data in the second data table is latest stored in the hierarchical data structure, so that the life cycle of the data can be more accurately represented.

[0078] In an embodiment of the present application, after the first data table is solidified to the third data layer, there may be data tables with overlapping data ranges in each third data layer. For example, in the LSM tree, there may be data tables with duplicate key values ​​in the SSTable layer. In order to reduce the waste of storage resources, the third data layer may include multiple sub-data layers. The server can merge the data tables with overlapping data ranges in the sub-data layer corresponding to the current data layer and the sub-data layer corresponding to the target data layer, and transfer them to the sub-data layer corresponding to the target data layer.

[0079] Therefore, when the first data table is in the target sub-layer and needs to be transferred from the current data layer to the target data layer, the number of the first data tables may be multiple.

[0080] In a possible implementation, when the current data layer is the target sublayer and there are multiple first data tables, the server may determine the minimum time feature value from each first time feature value and use the determined minimum time feature value as the second time feature value.

[0081] In an embodiment of the present application, when the server merges multiple first data tables, the merger is based on the data range corresponding to each first data table. In order to make the second time characteristic value accurately represent the storage time of the data in the second data table, in an embodiment of the present application, the minimum time characteristic value is determined from each first time characteristic value as the second time characteristic value. In this way, the second time characteristic value can represent the data stored in the second data table at least at the storage time corresponding to the second time characteristic value.

[0082] In the above embodiment, when the current data layers are different, the second time characteristic value is determined by combining the first time characteristic value and the number of the first data table, so that the second time characteristic value can more accurately represent the writing time of the data.

[0083] In one embodiment, based on the above embodiment, this embodiment relates to a process of updating the hierarchical time features. The process may include: updating the second-level time feature value corresponding to the target data layer according to the first-level time feature value corresponding to the current data layer.

[0084] In an embodiment of the present application, the server may also set a hierarchical time characteristic value for each data layer, so that when subsequently observing the data corresponding to each storage moment, the data layer corresponding to the data may be more conveniently determined.

[0085] In a possible implementation, when the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value.

[0086] The first-level time feature value is the same as the first time feature value.

[0087] In an embodiment of the present application, when the current data layer is the first data layer, the number of first data tables is one. Since the first time characteristic value is the time when the first data table is established in the first data layer, the server sets the first-level time characteristic value to be the same as the first time characteristic value. The first-level time characteristic value can represent the data written into the hierarchical data structure when the first time characteristic value is stored in the first data layer.

[0088] When the first data table is converted into the second data table and transferred to the second data layer, the server can use the first-level time feature value as the second-level time feature value, so that the second-level time feature value can accurately represent the writing time of the latest data written into the hierarchical data structure in the second data layer.

[0089] In another possible implementation, when the current data layer is the target sublayer in the second data layer or the third data layer, the server determines the target time feature values ​​of other data tables in the current data layer except the first data table, and then determines the minimum time feature value from the first-level time feature value and each target time feature value, and uses the determined minimum time feature value as the second-level time feature value.

[0090] Optionally, when the current data layer is the second data layer, the first data table is converted to the second data table, and after being transferred to the target data layer, there may be other data tables in the current data layer that have not undergone data layer conversion, and the target time feature values ​​corresponding to the other data tables and the first-level time feature values ​​corresponding to the current data layer are both greater than or equal to the time feature values ​​corresponding to the second data table. The server may compare the first-level time feature value with the target time feature values ​​corresponding to each other data table, and select the minimum time feature value as the second-level time feature value. In this way, the second-level time feature value can represent the write time of the data that is written to the hierarchical data structure in the target data layer the latest; Optionally, when the current data layer is the target sublayer in the third data layer, and the target data layer also belongs to the target sublayer in the third data layer, after the first data table is converted into the second data table and transferred to the target data layer, the target time feature values ​​corresponding to other data tables in the current data layer that have not undergone data layer conversion may be greater than the time feature values ​​corresponding to the second data table, or may be less than the time feature values ​​corresponding to the second data table. Therefore, the second-level time feature values ​​determined by the server through the above embodiment can indicate that the data written into the hierarchical data structure before the moment corresponding to the second-level time feature values ​​have been transferred to the target data layer or other data layers subsequent to the target data layer.

[0091] In one possible implementation, when the data in the hierarchical data structure is continuously transferred and sunk, all the data will be stored in the bottom-most data layer of the hierarchical data structure. It can be understood that at this time, the hierarchical time feature values ​​corresponding to the various data layers in the hierarchical data structure are consistent. Therefore, in an embodiment of the present application, when the hierarchical time feature values ​​corresponding to the various data layers in the hierarchical data structure are consistent, the server can determine that all the data have been stored in the bottom-most data layer of the hierarchical data structure. Optionally, the server can output corresponding transfer completion information to prompt the user that the data in the hierarchical data structure have been stored in the bottom-most data layer, and the user can perform subsequent operations on the hierarchical data structure based on this information.

[0092] In one embodiment, referring to Figure 4 , provides an exemplary data storage method, which can be applied to Figure 1 Server 101 in.

[0093] Step 401 , when a first data table is transferred from a current data layer to a target data layer, a first time characteristic value of the first data table is obtained.

[0094] Step 402: Convert the first data table into a data format corresponding to the target data layer to obtain a second data table.

[0095] The current data layer and the target data layer are both data layers in a hierarchical data structure, and the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk.

[0096] Step 403: When the current data layer is the first data layer, the first time feature value is used as the second time feature value.

[0097] The first time characteristic value is the time when the first data table is established in the first data layer.

[0098] Step 404: when the current data layer is the second data layer and the number of the first data table is one, use the first time feature value as the second time feature value.

[0099] Step 405 : when the current data layer is the second data layer and there are multiple first data tables, determine the maximum time feature value from each first time feature value, and use the maximum time feature value as the second time feature value.

[0100] Step 406: When the current data layer is the target sublayer and there are multiple first data tables, determine the minimum time feature value from the first time feature values, and use the determined minimum time feature value as the second time feature value.

[0101] Step 407: transfer the second data table and the second time characteristic value to the target data layer.

[0102] Step 408: When the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value.

[0103] The first-level time feature value is the same as the first time feature value.

[0104] Step 409: when the current data layer is a target sublayer in the second data layer or the third data layer, determine target time characteristic values ​​of other data tables in the current data layer except the first data table.

[0105] Step 410 , determining a minimum time feature value from the first-level time feature value and each target time feature value, and using the determined minimum time feature value as the second-level time feature value.

[0106] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0107] Based on the same inventive concept, the embodiment of the present application also provides a data storage device for implementing the data storage method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more data storage device embodiments provided below can refer to the limitations on the data storage method above, and will not be repeated here.

[0108] In an exemplary embodiment, Figure 5 As shown, a data storage device is provided, including: an acquisition module 501, a conversion module 502 and a transfer module 503, wherein:

[0109] An acquisition module 501 is used to acquire a first time characteristic value of a first data table during a process of transferring the first data table from a current data layer to a target data layer;

[0110] A conversion module 502 is used to convert the first data table into a data format corresponding to the target data layer to obtain a second data table, and determine a second time characteristic value of the second data table according to the first time characteristic value;

[0111] The transfer module 503 is used to transfer the second data table and the second time characteristic value to the target data layer.

[0112] In one embodiment, the current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in memory and a third data layer in a disk, and the conversion module 502 includes:

[0113] a first determining unit, configured to use the first time characteristic value as the second time characteristic value when the current data layer is the first data layer, the first time characteristic value being the time when the first data table is established in the first data layer;

[0114] The second determining unit is used to determine the second time characteristic value according to the first time characteristic value and the number of the first data tables when the current data layer is the second data layer or a target sublayer in the third data layer.

[0115] In one embodiment, the second determining unit is further configured to execute:

[0116] When the current data layer is the second data layer and the number of the first data table is one, using the first time feature value as the second time feature value;

[0117] When the current data layer is the second data layer and there are multiple first data tables, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

[0118] In one embodiment, the second determining unit is further configured to execute:

[0119] When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

[0120] In one embodiment, the data storage device further comprises:

[0121] The layer time characteristic value determination module is used to update the second layer time characteristic value corresponding to the target data layer according to the first layer time characteristic value corresponding to the current data layer.

[0122] In one embodiment, the hierarchical time feature value determination module includes:

[0123] The first layer determination unit is used to use the first layer time feature value as the second layer time feature value when the current data layer is the first data layer, and the first layer time feature value is the same as the first time feature value.

[0124] In one embodiment, the hierarchical time feature value determination module includes:

[0125] a target time characteristic value determining unit, configured to determine target time characteristic values ​​of other data tables in the current data layer except the first data table, when the current data layer is a target sublayer in the second data layer or the third data layer;

[0126] The second-level determination unit is used to determine a minimum time feature value from the first-level time feature value and each of the target time feature values, and use the determined minimum time feature value as the second-level time feature value.

[0127] Each module in the above data storage device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data storage data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a data storage method.

[0129] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0130] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0131] In the process of transferring the first data table from the current data layer to the target data layer, obtaining a first time characteristic value of the first data table;

[0132] Converting the first data table into a data format corresponding to the target data layer to obtain a second data table, and determining a second time characteristic value of the second data table according to the first time characteristic value;

[0133] The second data table and the second time characteristic value are transferred to the target data layer.

[0134] In one embodiment, the current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk, and the processor further implements the following steps when executing the computer program:

[0135] In a case where the current data layer is the first data layer, using the first time characteristic value as the second time characteristic value, the first time characteristic value being the time when the first data table is established in the first data layer;

[0136] In a case where the current data layer is the second data layer or a target sublayer in the third data layer, the second time characteristic value is determined according to the first time characteristic value and the number of the first data tables.

[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0138] When the current data layer is the second data layer and the number of the first data table is one, using the first time feature value as the second time feature value;

[0139] When the current data layer is the second data layer and there are multiple first data tables, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0141] When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

[0142] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0143] The second-level time feature value corresponding to the target data layer is updated according to the first-level time feature value corresponding to the current data layer.

[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0145] In the case that the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the first-level time feature value is the same as the first time feature value.

[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0147] In a case where the current data layer is a target sublayer in the second data layer or the third data layer, determining target time feature values ​​of other data tables in the current data layer except the first data table;

[0148] A minimum time feature value is determined from the first-level time feature value and each of the target time feature values, and the determined minimum time feature value is used as the second-level time feature value.

[0149] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0150] In the process of transferring the first data table from the current data layer to the target data layer, obtaining a first time characteristic value of the first data table;

[0151] Converting the first data table into a data format corresponding to the target data layer to obtain a second data table, and determining a second time characteristic value of the second data table according to the first time characteristic value;

[0152] The second data table and the second time characteristic value are transferred to the target data layer.

[0153] In one embodiment, the current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk, and when the computer program is executed by a processor, the following steps are also implemented:

[0154] In a case where the current data layer is the first data layer, using the first time characteristic value as the second time characteristic value, the first time characteristic value being the time when the first data table is established in the first data layer;

[0155] In a case where the current data layer is the second data layer or a target sublayer in the third data layer, the second time characteristic value is determined according to the first time characteristic value and the number of the first data tables.

[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0157] When the current data layer is the second data layer and the number of the first data table is one, using the first time feature value as the second time feature value;

[0158] When the current data layer is the second data layer and there are multiple first data tables, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0160] When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0162] The second-level time feature value corresponding to the target data layer is updated according to the first-level time feature value corresponding to the current data layer.

[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0164] In the case that the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the first-level time feature value is the same as the first time feature value.

[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0166] In a case where the current data layer is a target sublayer in the second data layer or the third data layer, determining target time feature values ​​of other data tables in the current data layer except the first data table;

[0167] A minimum time feature value is determined from the first-level time feature value and each of the target time feature values, and the determined minimum time feature value is used as the second-level time feature value.

[0168] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0169] In the process of transferring the first data table from the current data layer to the target data layer, obtaining a first time characteristic value of the first data table;

[0170] Converting the first data table into a data format corresponding to the target data layer to obtain a second data table, and determining a second time characteristic value of the second data table according to the first time characteristic value;

[0171] The second data table and the second time characteristic value are transferred to the target data layer.

[0172] In one embodiment, the current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk, and when the computer program is executed by a processor, the following steps are also implemented:

[0173] In a case where the current data layer is the first data layer, using the first time characteristic value as the second time characteristic value, the first time characteristic value being the time when the first data table is established in the first data layer;

[0174] In a case where the current data layer is the second data layer or a target sublayer in the third data layer, the second time characteristic value is determined according to the first time characteristic value and the number of the first data tables.

[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0176] When the current data layer is the second data layer and the number of the first data table is one, using the first time feature value as the second time feature value;

[0177] When the current data layer is the second data layer and there are multiple first data tables, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0179] When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0181] The second-level time feature value corresponding to the target data layer is updated according to the first-level time feature value corresponding to the current data layer.

[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0183] In the case that the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the first-level time feature value is the same as the first time feature value.

[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0185] In a case where the current data layer is a target sublayer in the second data layer or the third data layer, determining target time feature values ​​of other data tables in the current data layer except the first data table;

[0186] A minimum time feature value is determined from the first-level time feature value and each of the target time feature values, and the determined minimum time feature value is used as the second-level time feature value.

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

[0188] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0189] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0190] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data storage method, characterized in that: The method comprises: In the process of transferring the first data table from the current data layer to the target data layer, obtaining a first time characteristic value of the first data table; Converting the first data table into a data format corresponding to the target data layer to obtain a second data table, and determining a second time characteristic value of the second data table according to the first time characteristic value; The second data table and the second time characteristic value are transferred to the target data layer.

2. The method according to claim 1, characterized in that: The current data layer and the target data layer are both data layers in a hierarchical data structure, the hierarchical data structure includes a first data layer and a second data layer in a memory and a third data layer in a disk, and determining the second time characteristic value of the second data table according to the first time characteristic value includes: In a case where the current data layer is the first data layer, using the first time characteristic value as the second time characteristic value, the first time characteristic value being the time when the first data table is established in the first data layer; In a case where the current data layer is the second data layer or a target sublayer in the third data layer, the second time characteristic value is determined according to the first time characteristic value and the number of the first data tables.

3. The method according to claim 2, characterized in that The determining the second time characteristic value according to the first time characteristic value and the number of the first data table includes: When the current data layer is the second data layer and the number of the first data table is one, using the first time feature value as the second time feature value; When the current data layer is the second data layer and there are multiple first data tables, a maximum time feature value is determined from each of the first time feature values, and the maximum time feature value is used as the second time feature value.

4. The method according to claim 2, characterized in that: The determining the second time characteristic value according to the first time characteristic value and the number of the first data table further includes: When the current data layer is the target sublayer and there are multiple first data tables, a minimum time feature value is determined from the first time feature values, and the determined minimum time feature value is used as the second time feature value.

5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: The second-level time feature value corresponding to the target data layer is updated according to the first-level time feature value corresponding to the current data layer.

6. The method according to claim 5, characterized in that The updating of the second-level time feature value corresponding to the target data layer according to the first-level time feature value corresponding to the current data layer includes: In the case that the current data layer is the first data layer, the first-level time feature value is used as the second-level time feature value, and the first-level time feature value is the same as the first time feature value.

7. The method according to claim 5, characterized in that The updating of the second-level time feature value corresponding to the target data layer according to the first-level time feature value corresponding to the current data layer includes: In a case where the current data layer is a target sublayer in the second data layer or the third data layer, determining target time feature values ​​of other data tables in the current data layer except the first data table; A minimum time feature value is determined from the first-level time feature value and each of the target time feature values, and the determined minimum time feature value is used as the second-level time feature value.

8. A data storage device, characterized in that: The device comprises: An acquisition module, configured to acquire a first time characteristic value of the first data table during a process of transferring the first data table from the current data layer to the target data layer; a conversion module, configured to convert the first data table into a data format corresponding to the target data layer to obtain a second data table, and determine a second time characteristic value of the second data table according to the first time characteristic value; A transfer module is used to transfer the second data table and the second time characteristic value to the target data layer.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.