Data storage method, device, terminal device and storage medium

By building a storage architecture based on relational data structures, the problems of storage space waste and low retrieval efficiency are solved, and efficient data storage and retrieval are achieved.

CN117171164BActive Publication Date: 2025-09-05CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311028574.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-09-05
Estimated Expiration
2043-08-15

AI Technical Summary

Technical Problem

The existing technology has the problems of wasted storage space and low retrieval efficiency when storing and retrieving massive plain text software function descriptions.

Method used

The storage architecture is built based on the preset relational data structure, including the table parsing layer that converts the original table into a logical tree structure, the intermediate data layer for encoding and parent-child relationship representation, the dynamic block and storage layer for splitting, generating subtree blocks, and retrieving through the application interface layer.

Benefits of technology

It achieves efficient data storage, solves the problems of storage space waste and low retrieval efficiency, and improves the efficiency of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171164B_ABST
    Figure CN117171164B_ABST
Patent Text Reader

Abstract

The present invention discloses a data storage method, apparatus, terminal device, and storage medium. The method comprises: constructing a storage architecture based on a preset relational data structure; and searching for a block of searchable items according to the storage architecture to obtain search results. The present invention solves the problems of wasted storage space and low search efficiency, thereby improving data storage efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data, and in particular to a data storage method, apparatus, terminal equipment, and storage medium. Background Art

[0002] In the context of the Internet era, software applicable to various business scenarios is everywhere. How to evaluate the scale of a software is not only related to the time investment in software development, but also affects the financial and personnel investment in software development. The current mainstream software scale assessment method is the full function point analysis method (COSMIC-FFP) proposed by the Common Software Metrics International Association. The COSMIC software assessment method retrieves all data movement processes, regards each data movement process as a function point (CFP), and finally obtains the scale measurement of the entire software by counting the number of function points (CFP). With the development of natural language processing (NLP), artificial intelligence (AI), and the development of the field of software scale assessment, the scale of the whole software is becoming more and more popular. , With the development of artificial intelligence technologies such as COSMIC, artificial intelligence evaluation methods based on COSMIC have gradually become a new development direction.

[0003] According to the COSMIC software evaluation method, the original software description document must first be broken down into function points, obtaining the functional process description corresponding to each function point. The results of the split are then stored to prepare data for subsequent algorithm application. However, when faced with massive amounts of plain text software functional description processes for measuring the workload of new project software, efficient storage and rapid retrieval of these functional descriptions directly impacts the efficiency of determining function point reproducibility and the accuracy of the final workload (man-days) measurement.

[0004] The existing storage method mainly converts the function point splitting table obtained after splitting into a relational data structure, and stores it in a relational database according to the correspondence between projects, functional module levels, functional processes, sub-process descriptions and their related attributes, resulting in waste of storage space and low retrieval efficiency.

[0005] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0006] The main purpose of the present invention is to provide a data storage method, apparatus, terminal device and storage medium, aiming to solve the technical problems of storage space waste and low retrieval efficiency.

[0007] To achieve the above object, the present invention provides a data storage method, which includes:

[0008] Build storage architecture based on preset relational data structure;

[0009] According to the storage architecture, the item blocks to be retrieved are retrieved to obtain the retrieval results.

[0010] Optionally, the step of constructing a storage architecture based on a preset relational data structure includes:

[0011] Convert the original table into the corresponding logical tree structure through the table parsing layer;

[0012] Encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree;

[0013] Splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks;

[0014] Building an index based on the plurality of subtree blocks and storing the index in an application interface layer;

[0015] According to the application interface layer, a search interface is generated through a block scheduling mechanism and block marking.

[0016] Optionally, the step of encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree includes:

[0017] Setting a plurality of arrays for the nodes of the logical tree structure through the intermediate data layer;

[0018] Encode the plurality of arrays to obtain node names, node codes, search times, child node codes, and parent node codes;

[0019] According to the obtained node name, node code, number of retrievals, child node code and parent node code, an encoded original storable tree is obtained.

[0020] Optionally, the step of splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks includes:

[0021] Pruning and dividing the storage trees in the original storable tree that exceed the preset system module size into blocks to obtain a number of storage trees that meet the size;

[0022] Constructing virtual nodes and new subtrees according to the plurality of storage trees that meet the scale;

[0023] According to the new subtree, a plurality of subtree blocks are obtained by associating the parent and child nodes before the block division through the virtual node.

[0024] Optionally, the step of searching the item block to be searched according to the storage architecture and obtaining the search results includes:

[0025] Sort the blocks where the node names are located according to the number of times they have been searched to obtain a sorting result;

[0026] Based on the ranking result, similarity comparison is performed on the project names of the project blocks to be retrieved to obtain a retrieval result.

[0027] Optionally, the step of performing similarity comparison on the project names of the to-be-searched project blocks according to the sorting result to obtain the search result includes:

[0028] According to the sorting result, performing a first similarity comparison on the item names of the item blocks to be retrieved by using the node names;

[0029] If the preset first similarity threshold is met, a second similarity comparison is performed on the sub-node code of the item to be retrieved using the sub-node code of the block where the node name is located to obtain a retrieval result.

[0030] Optionally, the step of performing a second similarity comparison on the sub-node codes of the to-be-searched items using the sub-node codes of the block where the node name is located to obtain the search result includes:

[0031] Performing a second similarity comparison on the sub-node codes of the item to be retrieved using the sub-node codes of the block where the node name is located;

[0032] If the preset second similarity threshold is not met, the item block to be detected is stored as a newly added tree;

[0033] If the preset second similarity threshold is met, the output search result is the block where the node name is located.

[0034] An embodiment of the present invention further provides a data storage device, comprising:

[0035] Building modules, used to build storage architecture based on preset relational data structures;

[0036] The retrieval module is used to retrieve the item block to be retrieved according to the storage architecture and obtain the retrieval result.

[0037] An embodiment of the present invention further proposes a terminal device comprising a memory, a processor, and a data storage program stored in the memory and executable on the processor. When the data storage program is executed by the processor, the steps of the data storage method described above are implemented.

[0038] An embodiment of the present invention further provides a computer-readable storage medium, on which a data storage program is stored. When the data storage program is executed by a processor, the steps of the data storage method described above are implemented.

[0039] Embodiments of the present invention propose a data storage method, apparatus, terminal device, and storage medium. These methods construct a storage architecture based on a pre-set relational data structure. Based on this storage architecture, blocks of searchable items are retrieved to obtain search results. This enables the construction of a storage architecture and data retrieval based on this architecture, resolving the issues of wasted storage space and inefficient retrieval, and improving data storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the data storage device of the present invention belongs;

[0041] Figure 2 A flowchart of an exemplary embodiment of a data storage method of the present invention;

[0042] Figure 3 A schematic diagram of a relational data structure related to the data storage method of the present invention;

[0043] Figure 4 This is another schematic diagram of a relational data structure related to the data storage method of the present invention;

[0044] Figure 5 A schematic diagram of a storage architecture related to the data storage method of the present invention;

[0045] Figure 6 This is a flow chart of the data storage method of the present invention involving obtaining an encoded original storable tree;

[0046] Figure 7 A schematic diagram of a flow chart of a data storage method of the present invention involving obtaining a subtree block;

[0047] Figure 8 A flowchart of another exemplary embodiment of the data storage method of the present invention;

[0048] Figure 9 A schematic diagram of a flow chart of the data storage method of the present invention involving obtaining search results;

[0049] Figure 10 This is a flow chart of the data storage method of the present invention involving similarity comparison.

[0050] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0052] The main solution of the embodiment of the present invention is as follows: the original table is converted into a corresponding logical tree structure through the table parsing layer; the logical tree structure is encoded and parent-child relationships are represented through the intermediate data layer to obtain an encoded original storable tree; the encoded original storable tree is split through the dynamic block and storage layer to obtain multiple subtree blocks; an index is constructed based on the multiple subtree blocks and stored in the application interface layer; and a search interface is generated through the block scheduling mechanism and block tags in the application interface layer. Through the intermediate data layer, multiple arrays are set for the nodes of the logical tree structure; the multiple arrays are encoded to obtain node names, node codes, number of searches, child node codes, and parent node codes; and the encoded original storable tree is obtained based on the obtained node names, node codes, number of searches, child node codes, and parent node codes. Storage trees in the original storable tree that exceed the preset system module size are pruned and divided into multiple storage trees that meet the size; virtual nodes and new subtrees are constructed based on the multiple storage trees that meet the size; and based on the new subtrees, multiple subtree blocks are obtained by associating the virtual nodes with the parent and child nodes before the block division. The node name block is sorted based on the number of times it has been searched, obtaining a sorting result. Based on the sorting result, a similarity comparison is performed on the item names in the item block to be searched, obtaining a search result. Based on the sorting result, a first similarity comparison is performed on the item names in the item block to be searched using the node name. If a preset first similarity threshold is met, a second similarity comparison is performed on the subnode codes of the node name block with the subnode codes of the item to be searched, obtaining a search result. A second similarity comparison is performed on the subnode codes of the node name block with the subnode codes of the item to be searched. If the preset second similarity threshold is not met, the item block to be searched is stored as a newly added tree. If the preset second similarity threshold is met, the search result is output as the block containing the node name. This solves the problems of wasted storage space and low search efficiency, achieves efficient data storage, and improves data storage efficiency. Based on the present invention, a data storage method is designed to address the real-world problems of wasted storage space and low search efficiency. The effectiveness of the data storage method of the present invention has been verified in actual data storage, and the efficiency of data storage has been significantly improved.

[0053] The technical terms involved in the present invention are:

[0054] Tableau: Tableau is a visual analytics and business intelligence tool used to transform data into easy-to-understand and interactive visual charts and dashboards. It provides an intuitive interface and powerful features, enabling users to quickly explore, analyze, and share data. Within the Tableau layer, users can connect to various data sources, such as databases, Excel files, and web pages, and then create views by simply dragging, dropping, and configuring them. It supports a variety of chart types, including bar charts, line charts, scatter plots, and maps, allowing users to select the appropriate chart type based on their needs. The Tableau layer allows users to perform data preprocessing, data cleaning, data calculations, and data modeling. It also supports advanced features such as parameterized queries, filters, sorting, calculated fields, aggregations, and joins, enabling users to analyze data more deeply and uncover hidden connections and trends. Once a visualization is created, users can combine multiple views through dashboards and add interactive filters and action buttons. This allows users to quickly switch between and compare different views of the data, as well as conduct real-time exploration and analysis of the data.

[0055] Dynamic Programming Partitioning Algorithm: The Dynamic Programming Partitioning Algorithm (DPPA) is an algorithm used to solve optimization problems. It improves computational efficiency by partitioning a large problem into multiple interconnected subproblems and storing intermediate results in tables or arrays to avoid repeated computations. The DPA is suitable for problems with overlapping subproblems and optimal substructures. By dividing a large problem into smaller ones and storing intermediate results, the DPA effectively reduces repeated computations, resulting in higher efficiency when solving complex problems.

[0056] The embodiment of the present invention takes into account that when performing data storage, the relevant technology mainly converts the function point splitting table obtained after the splitting into a relational data structure, and performs relational database storage according to the correspondence between projects, function module levels, function processes, sub-process descriptions and their related attributes. However, this method has the problems of redundant storage and low retrieval efficiency.

[0057] Therefore, in an embodiment of the present invention, a data storage method is designed based on the problems of storage space waste and low retrieval efficiency in reality, and the effectiveness of the data storage method of the present invention is verified in actual data storage. Finally, the efficiency of data storage is significantly improved through the method of the present invention.

[0058] Specifically, refer to Figure 1 , Figure 1This is a schematic diagram of the functional modules of a terminal device to which the data storage device of the present invention belongs. The data storage device can be a device independent of the terminal device capable of storing data, and can be hosted on the terminal device in the form of hardware or software. The terminal device can be a smart mobile device with data processing capabilities, such as a mobile phone or tablet computer, or a fixed terminal device or server with data processing capabilities.

[0059] In this embodiment, the terminal device to which the data storage apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .

[0060] Memory 130 stores an operating system and a data storage program. The data storage device can construct a storage architecture based on a pre-set relational data structure. Based on this storage architecture, the search item block is searched and the search results are obtained. Semiconductor defect identification is performed using the data storage program, and the data storage results and other information are stored in memory 130. Output module 110 can be a display screen, for example. Communication module 140 can include a Wi-Fi module, a mobile communication module, or a Bluetooth module, and communicates with external devices or servers through communication module 140.

[0061] When the data storage program in the memory 130 is executed by the processor, the following steps are implemented:

[0062] Build storage architecture based on preset relational data structure;

[0063] According to the storage architecture, the item blocks to be retrieved are retrieved to obtain the retrieval results.

[0064] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0065] Convert the original table into the corresponding logical tree structure through the table parsing layer;

[0066] Encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree;

[0067] Splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks;

[0068] Building an index based on the plurality of subtree blocks and storing the index in an application interface layer;

[0069] According to the application interface layer, a search interface is generated through a block scheduling mechanism and block marking.

[0070] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0071] Setting a plurality of arrays for the nodes of the logical tree structure through the intermediate data layer;

[0072] Encode the plurality of arrays to obtain node names, node codes, search times, child node codes, and parent node codes;

[0073] According to the obtained node name, node code, number of retrievals, child node code and parent node code, an encoded original storable tree is obtained.

[0074] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0075] Pruning and dividing the storage trees in the original storable tree that exceed the preset system module size into blocks to obtain a number of storage trees that meet the size;

[0076] Constructing virtual nodes and new subtrees according to the plurality of storage trees that meet the scale;

[0077] According to the new subtree, a plurality of subtree blocks are obtained by associating the parent and child nodes before the block division through the virtual node.

[0078] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0079] Sort the blocks where the node names are located according to the number of times they have been searched to obtain a sorting result;

[0080] Based on the ranking result, similarity comparison is performed on the project names of the project blocks to be retrieved to obtain a retrieval result.

[0081] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0082] According to the sorting result, performing a first similarity comparison on the item names of the item blocks to be retrieved by using the node names;

[0083] If the preset first similarity threshold is met, a second similarity comparison is performed on the sub-node code of the item to be retrieved using the sub-node code of the block where the node name is located to obtain a retrieval result.

[0084] Furthermore, when the data storage program in the memory 130 is executed by the processor, the following steps are also implemented:

[0085] Performing a second similarity comparison on the sub-node codes of the item to be retrieved using the sub-node codes of the block where the node name is located;

[0086] If the preset second similarity threshold is not met, the item block to be detected is stored as a newly added tree;

[0087] If the preset second similarity threshold is met, the output search result is the block where the node name is located.

[0088] This embodiment uses the above-mentioned solution to construct a storage architecture based on a preset relational data structure; according to the storage architecture, the search item block is searched to obtain the search results. Based on the tree-like storage structure, a data storage method is designed for data storage, which can solve the problems of storage space waste and low retrieval efficiency. Based on the solution of the present invention, starting from the problems of storage space waste and low retrieval efficiency in reality, a data storage method is designed, and the effectiveness of the data storage method of the present invention is verified in actual data storage. Finally, the efficiency of data storage is significantly improved by the method of the present invention.

[0089] Based on the above terminal device architecture but not limited to the above framework, an embodiment of the method of the present invention is proposed.

[0090] Reference Figure 2 , Figure 2 This is a flow chart of an exemplary embodiment of a data storage method of the present invention. The data storage method includes:

[0091] Step S01, building a storage architecture based on a preset relational data structure;

[0092] The execution subject of the method of this embodiment can be a data storage device, or a data storage terminal device or server. This embodiment takes a data storage device as an example, and the data storage device can be integrated into a terminal device with data processing function.

[0093] In order to achieve data storage, the following steps are implemented:

[0094] First, in this embodiment, a relational data structure is used to construct a storage architecture, wherein the relational data structure is as follows: Figure 3 As shown, the function point splitting table obtained after splitting is converted into a relational data structure, and stored in a relational database according to the corresponding relationship between projects, function levels, function processes, sub-process descriptions and their related attributes;

[0095] Finally, a storage architecture is constructed using a relational data structure. The storage architecture includes: the bottom-level software function splitting table to be evaluated, which is the most primitive table representation method; a table parsing layer, which is used to convert the table relationship into a corresponding logical tree structure; an intermediate data layer, which is used to encode each node and represent the parent-child relationship according to the tree structure obtained after processing the table parsing layer, to obtain an encoded original storable tree; a dynamic block and storage layer, which splits the encoded original storable tree according to the dynamic block algorithm to obtain corresponding subtree blocks, so that it meets the memory storage block size requirements and the parent-child logical relationship requirements of the tree; at the same time, the block structure is indexed and stored in the external memory space; and the application interface layer provides a retrieval interface for the application service through a block scheduling mechanism and block marking (recording the number of historical calls).

[0096] Step S02: searching the item blocks to be searched according to the storage architecture to obtain search results.

[0097] After building the storage architecture, use the storage architecture to search for data. Take the following steps:

[0098] First, the number of times the block where the node name is located in the storage structure is searched is used to sort the items to obtain a sorting result. The block where the node name is located refers to the storage structure in which each item is divided into a corresponding tree for storage, and each subtree has a corresponding block, and the block includes several types of arrays. In this embodiment, four types of arrays are used as a demonstration. For example, each subtree block contains the node name, node code, number of times it has been searched, child node code, and parent node code, and the number of times it has been searched is used for sorting. Here, it can be understood that frequently used items are searched first.

[0099] Finally, based on the sorting results, the block of items to be retrieved is used for retrieval, wherein the project name of the item to be retrieved is used for similarity comparison first. When the first similarity threshold is exceeded, it means that the probability that the item to be retrieved is stored in the block where the node name is located is high. The sub-node code of the item to be retrieved is then used for a second similarity comparison. When the second similarity threshold is exceeded, the block where the node name is located is output as the retrieval result.

[0100] This embodiment, through the above-mentioned solution, specifically constructs a storage architecture based on a preset relational data structure; based on this storage architecture, searches for the search item block to obtain search results. This achieves efficient data storage, solves the problems of wasted storage space and low search efficiency, and improves data storage efficiency.

[0101] Reference Figure 4 , Figure 4 FIG. 4 is a flow chart of another exemplary embodiment of the data storage method of the present invention.

[0102] Based on the above Figure 2 In the embodiment shown, step S01, the step of constructing a storage architecture based on a preset relational data structure, includes:

[0103] Step S011, converting the original table into a corresponding logical tree structure through the table parsing layer;

[0104] Step S012: encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree;

[0105] Step S013, splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks;

[0106] Step S014: construct an index based on the plurality of subtree blocks and store the index in the application interface layer;

[0107] Step S015: Generate a search interface according to the application interface layer through a block scheduling mechanism and block marking.

[0108] Specifically, to build the storage architecture, the following steps are performed:

[0109] First, the table parsing layer is used to convert the original table and generate the corresponding logical structure tree, where the generated logical structure tree logically corresponds the data;

[0110] Then, the logical structure tree is encoded and the parent-child relationship is represented through the intermediate data layer to obtain a codable original storable tree. The purpose of encoding the logical structure tree is to make it correspond to each other and facilitate subsequent retrieval. The parent-child relationship representation can be understood as representing the size relationship of data. For example, a company's head office is used as the parent tree, and the branch offices are used as child trees. This can better express the relationship between data.

[0111] Then, the encoded original storable tree is split into several subtree blocks through dynamic block division and storage layer. The purpose of splitting is to optimize the content of the entire tree structure and avoid wasting storage space.

[0112] Finally, the generated subtree blocks are indexed and stored in the application layer interface layer, and a retrieval interface is generated through the block scheduling mechanism and tags. The generation of the corresponding retrieval interface by the subtree blocks can improve the efficiency of retrieval.

[0113] More specifically, if Figure 5 As shown, Figure 5 This is a schematic diagram of a storage architecture related to the data storage method of the present invention.

[0114] First, the table parsing layer is used to process the original table generated by the underlying data source to obtain a logical structure tree;

[0115] Then, the logical structure tree is processed using the intermediate data layer to obtain the original storable tree, that is, the corresponding node name, node code, number of retrievals, child node code and parent node code;

[0116] Then, the dynamic block layer is used to perform disk management on the original storable tree to generate subtree blocks, including but not limited to dynamic block management, index management, and cache management;

[0117] Finally, the application interface layer is used to store the subtree blocks and the corresponding indexes to the application interface layer to generate a retrieval interface.

[0118] This embodiment, through the above-mentioned solution, specifically converts the original table into a corresponding logical tree structure through the table parsing layer; encodes the logical tree structure and represents the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree; splits the encoded original storable tree through dynamic block division and the storage layer to obtain several subtree blocks; constructs an index based on these subtree blocks and stores them in the application interface layer; and generates a retrieval interface based on the block scheduling mechanism and block tagging in the application interface layer. This achieves the generation of a storage architecture, solves the problems of wasted storage space and low retrieval efficiency, and improves data storage efficiency.

[0119] Reference Figure 6 , Figure 6 The data storage method of the present invention is a flow chart of obtaining an encoded original storable tree.

[0120] Based on the above Figure 4 In the embodiment shown, the step S012 of encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain the encoded original storable tree includes:

[0121] Step S0121, setting a number of arrays for the nodes of the logical tree structure through the intermediate data layer;

[0122] Step S0122: Encode the plurality of arrays to obtain node names, node codes, search times, child node codes, and parent node codes;

[0123] Step S0123: Obtain an encoded original storable tree based on the acquired node name, node code, number of searches, child node code, and parent node code.

[0124] Specifically, in order to implement array encoding of the logical tree structure, the following steps are taken:

[0125] First, through the intermediate data layer, several arrays are set for the nodes of the logical tree structure. In this embodiment, a 4-dimensional array is set, and other numbers of arrays may also be used in other embodiments.

[0126] Then, the four data are encoded so that each node of the logic tree obtains the corresponding node name, node code, number of searches, child node code and parent node code. Among them, the node name provides a larger range for the search. Generally, the specific item stored is used as the node name. The number of searches is recorded in real time and will be modified accordingly every time it is accessed. The child node code and parent node code are used as an array, which can make the upper and lower layer relationships corresponding to the data more logically stored.

[0127] Finally, based on the node name, node code, number of searches, child node code, and parent node code of each array, the encoded original storable tree is obtained. Encoding the logical tree structure refers to encoding the structure of the entire tree so that the corresponding child trees and parent trees have corresponding names, codes, number of searches, and their respective upper and lower relationships.

[0128] This embodiment, through the above-described solution, specifically through the intermediate data layer, sets up several arrays for the nodes of the logical tree structure; then encodes these arrays to obtain the node name, node code, number of searches, child node code, and parent node code. This achieves the configuration of each node in the logical tree structure, solves the problems of wasted storage space and low search efficiency, and improves data storage efficiency.

[0129] Reference Figure 7 , Figure 7 This is a flow chart of the data storage method of the present invention involving obtaining a subtree block.

[0130] Based on the above Figure 4 In the embodiment shown, the step S013 of splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks includes:

[0131] Step S0131, pruning and dividing the storage trees in the original storable tree that exceed the preset system module size into blocks to obtain a number of storage trees that meet the size;

[0132] Step S0132: construct virtual nodes and new subtrees based on the plurality of storage trees that meet the scale;

[0133] Step S0133: According to the new subtree, a plurality of subtree blocks are obtained by associating the parent and child nodes before the block division through the virtual node.

[0134] Specifically, in order to reduce the waste of storage space, the following steps are implemented:

[0135] First, in this embodiment, a dynamic partitioning algorithm is used to partition the database. The dynamic partitioning algorithm (Dynamic Programming Partitioning Algorithm) is an algorithm for solving optimization problems. In the problem-solving process, it divides a large problem into multiple interrelated sub-problems and uses tables or arrays to store intermediate results to avoid repeated calculations, thereby improving computational efficiency. The dynamic partitioning algorithm is suitable for problems with overlapping sub-problems and optimal substructure properties. By dividing a large problem into small problems and saving intermediate results, the dynamic partitioning algorithm can effectively reduce repeated calculations, thereby achieving higher efficiency in solving complex problems.

[0136] Then, the storage trees that exceed the system default scheduling block size are pruned to obtain several storage trees that meet the scale. The system default scale can be adjusted according to business needs, but will not exceed or fall below the carrying capacity of the current operating system or operating equipment.

[0137] Then, construct virtual nodes and new subtrees for the storage tree that meets the scale;

[0138] Finally, through the constructed new subtree, virtual nodes are used to associate the parent and child nodes before the block division to generate several subtree blocks.

[0139] Furthermore, the steps of obtaining several subtree blocks may also be described as follows:

[0140] First, prune and split the tree that exceeds the system default scheduling block size;

[0141] Then, construct virtual nodes and new subtrees, and use virtual nodes to associate parent and child nodes before the block.

[0142] Finally, the size of the new subtree and the scheduling block is determined, and the subtree that exceeds the scheduling block size is re-pruned until the block size meets the judgment condition;

[0143] This embodiment, through the above-described scheme, specifically prunes and blocks storage trees in the original storable tree that exceed the preset system module size, thereby obtaining several storage trees that meet the size. Based on these several storage trees that meet the size, virtual nodes and new subtrees are constructed. Based on these new subtrees, the virtual nodes are associated with the parent and child nodes before the block division to obtain several subtree blocks. This achieves the pruning and construction of subtree blocks, solves the problem of storage space waste, and improves storage space efficiency.

[0144] Reference Figure 8 , Figure 8FIG. 4 is a flow chart of another exemplary embodiment of the data storage method of the present invention.

[0145] Based on the above Figure 2 In the embodiment shown, the step S02 of searching for the item block to be searched according to the storage architecture and obtaining the search results includes:

[0146] Step S021, sorting the blocks where the node names are located according to the number of times they have been searched to obtain a sorting result;

[0147] Step S022: performing a similarity comparison on the project names of the project blocks to be searched based on the ranking result to obtain a search result.

[0148] Specifically, in order to achieve efficient retrieval, the following steps are taken:

[0149] First, the block where the node name is located is sorted by the number of times it has been searched to obtain a sorting result. In this embodiment, the block where the node name is located can be understood as the block where each project data is located. The purpose of sorting it is to view the sorting table of the number of times the project has been accessed, so as to facilitate the rapid retrieval of the project to be retrieved and avoid wasting resources.

[0150] Finally, according to the sorting results, the node names at the top of the sorting results are compared with the node names of the item block to be retrieved for similarity to obtain the retrieval results. Among them, after the retrieval result is compared, if the similarity reaches the corresponding threshold, the sub-node codes in the item block to be retrieved and the sub-node codes corresponding to the block where the node name is located are compared again for similarity. If the comparison result exceeds the threshold, it means that the item data to be retrieved is stored in the block where the current node name is located.

[0151] This embodiment utilizes the above-mentioned solution to obtain a sorting result by sorting the blocks containing the node names based on the number of times they have been searched. Based on the sorting result, the project names in the blocks to be searched are compared for similarity to obtain a search result. This achieves efficient retrieval based on the storage structure, solves the problem of low retrieval efficiency, and improves data storage efficiency.

[0152] Reference Figure 9 , Figure 9 This is a flow chart of the data storage method of the present invention involving obtaining retrieval results.

[0153] Based on the above Figure 8 In the embodiment shown, the step S022 of performing similarity comparison on the project names of the to-be-searched project blocks based on the ranking results to obtain the search results includes:

[0154] Step S0221: performing a first similarity comparison on the item names of the item blocks to be retrieved using the node names according to the sorting result;

[0155] Step S0222: If the preset first similarity threshold is met, a second similarity comparison is performed on the sub-node code of the block where the node name is located with the sub-node code of the item to be retrieved to obtain a retrieval result.

[0156] Specifically, in order to obtain the search results, the step of performing the first similarity comparison includes:

[0157] First, based on the sorting results, the first similarity comparison is performed between the node name with the highest number of searches and the item name of the item block to be searched;

[0158] Then, if the first similarity result meets the first similarity threshold, a second similarity comparison is performed between the sub-node code of the block where the node name is located and the sub-node code of the item to be retrieved;

[0159] Finally, if the first similarity result does not meet the first similarity threshold, it means that the block of the item to be retrieved is not stored in the block corresponding to the current node name. Then, the search is continued according to the sorting result until the first similarity threshold is met. Then, a second similarity comparison is performed between the sub-node code of the block where the node name is located and the sub-node code of the item to be retrieved.

[0160] This embodiment, through the above-described scheme, specifically performs a first similarity comparison on the item names of the to-be-searched item block using the node names based on the sorting result. If the first similarity threshold is met, a second similarity comparison is performed on the sub-node codes of the block containing the node names with the sub-node codes of the to-be-searched items to obtain a search result. This prioritizes searching blocks corresponding to node names with high access counts, reducing search times, addressing the issue of low search efficiency, and improving data retrieval efficiency.

[0161] Reference Figure 10 , Figure 10 This is a flow chart of the data storage method of the present invention involving similarity comparison.

[0162] Based on the above Figure 9 In the embodiment, the step S0222 of performing a second similarity comparison on the sub-node codes of the to-be-searched item using the sub-node codes of the block where the node name is located, and obtaining the search result includes:

[0163] Step S02221, performing a second similarity comparison on the sub-node codes of the item to be retrieved using the sub-node codes of the block where the node name is located;

[0164] Step S02222: If the preset second similarity threshold is not met, the item block to be detected is stored as a newly added tree;

[0165] Step S02223: If the preset second similarity threshold is met, the search result is output as the block where the node name is located.

[0166] Specifically, in order to obtain the search results, the following steps are taken:

[0167] First, a second similarity comparison is performed on the sub-node codes of the item to be retrieved using the sub-node codes of the block where the node name is located;

[0168] Then, if the second similarity threshold is not met, the project block to be detected is stored as a newly added tree, wherein the second similarity threshold can be adjusted according to business needs, and the purpose of storing the newly added tree is to preserve the project data;

[0169] Finally, if the second similarity threshold is met, the search result is output as the block where the node name is located. When the similarity threshold is met, it means that the data of the item block to be retrieved is stored in the block where the current node name is located.

[0170] This embodiment, through the above scheme, specifically performs a second similarity comparison between the sub-node codes of the block containing the node name and the sub-node codes of the item to be retrieved. If the second similarity threshold is not met, the block containing the item to be detected is stored as a newly added tree. If the second similarity threshold is met, the block containing the node name is output as the search result. This achieves efficient retrieval of the item block to be detected, solves the problem of low retrieval efficiency, and improves data retrieval efficiency.

[0171] In addition, an embodiment of the present invention further provides a data storage device, the data storage device comprising:

[0172] Building modules, used to build storage architecture based on preset relational data structures;

[0173] The retrieval module is used to retrieve the item block to be retrieved according to the storage architecture and obtain the retrieval result.

[0174] In addition, an embodiment of the present invention also proposes a terminal device, which includes a memory, a processor, and a data storage program stored in the memory and runnable on the processor, and when the data storage program is executed by the processor, the steps of the data storage method described above are implemented.

[0175] Since the data storage program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.

[0176] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a data storage program is stored. When the data storage program is executed by a processor, the steps of the data storage method described above are implemented.

[0177] Since the data storage program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.

[0178] Compared with the prior art, the data storage method, apparatus, terminal device, and storage medium proposed in the embodiments of the present invention construct a storage architecture based on a preset relational data structure; according to the storage architecture, the search item block is searched to obtain the search results.

[0179] This solves the problems of wasted storage space and low retrieval efficiency, realizes data storage and retrieval, and improves the efficiency of data storage. Based on the solution of the present invention, a data storage method is designed based on the problems of wasted storage space and low retrieval efficiency in reality. The effectiveness of the data storage method of the present invention is verified in actual data storage. Finally, the efficiency of data storage is significantly improved through the method of the present invention.

[0180] Compared with existing technologies, the embodiments of the present invention have the following advantages:

[0181] 1. Change the row-based redundant relation storage and propose a storage method based on tree and dynamic block, which greatly saves storage space;

[0182] 2. Based on block storage, the corresponding blocks are selectively loaded into the memory according to the functional split information of the project to be evaluated, which not only improves the retrieval efficiency but also avoids a large amount of I / O consumption.

[0183] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0184] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0185] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present invention.

[0186] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data storage method, characterized in that: The data storage method comprises the following steps: Build storage architecture based on preset relational data structure; The step of constructing a storage architecture based on a preset relational data structure includes: Convert the original table into the corresponding logical tree structure through the table parsing layer; Encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree; Splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks; Building an index based on the plurality of subtree blocks and storing the index in an application interface layer; According to the application interface layer, a search interface is generated through a block scheduling mechanism and block marking; According to the storage architecture, the item blocks to be retrieved are retrieved to obtain the retrieval results.

2. The data storage method according to claim 1, wherein: The step of encoding the logical tree structure and expressing the parent-child relationship through the intermediate data layer to obtain the encoded original storable tree includes: Setting a plurality of arrays for the nodes of the logical tree structure through the intermediate data layer; Encode the plurality of arrays to obtain node names, node codes, search times, child node codes, and parent node codes; According to the obtained node name, node code, number of retrievals, child node code and parent node code, an encoded original storable tree is obtained.

3. The data storage method according to claim 1, wherein: The step of splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks includes: Pruning and dividing the storage trees in the original storable tree that exceed the preset system module size into blocks to obtain a number of storage trees that meet the size; Constructing virtual nodes and new subtrees according to the plurality of storage trees that meet the scale; According to the new subtree, a plurality of subtree blocks are obtained by associating the parent and child nodes before the block division through the virtual node.

4. The data storage method according to claim 2, wherein: The step of searching the item block to be searched and obtaining the search results according to the storage architecture includes: Sort the blocks where the node names are located according to the number of times they have been searched to obtain a sorting result; Based on the ranking result, similarity comparison is performed on the project names of the project blocks to be retrieved to obtain a retrieval result.

5. The data storage method according to claim 4, characterized in that: The step of performing similarity comparison on the project names of the project blocks to be searched based on the sorting results to obtain search results includes: According to the sorting result, performing a first similarity comparison on the item names of the item blocks to be retrieved by using the node names; If the preset first similarity threshold is met, a second similarity comparison is performed on the sub-node code of the item to be retrieved using the sub-node code of the block where the node name is located to obtain a retrieval result.

6. The data storage method according to claim 5, characterized in that: The step of performing a second similarity comparison on the sub-node codes of the to-be-searched items by using the sub-node codes of the block where the node name is located to obtain the search result comprises: Performing a second similarity comparison on the sub-node codes of the item to be retrieved using the sub-node codes of the block where the node name is located; If the preset second similarity threshold is not met, the item block to be detected is stored as a newly added tree; If the preset second similarity threshold is met, the output search result is the block where the node name is located.

7. A data storage device, characterized in that The data storage device comprises: Building modules, used to build storage architecture based on preset relational data structures; The construction module is further configured to convert the original table into a corresponding logical tree structure through a table parsing layer; Encoding the logical tree structure and representing the parent-child relationship through the intermediate data layer to obtain an encoded original storable tree; Splitting the encoded original storable tree through dynamic block division and storage layer to obtain a plurality of subtree blocks; Building an index based on the plurality of subtree blocks and storing the index in an application interface layer; According to the application interface layer, a retrieval interface retrieval module is generated through a block scheduling mechanism and a block tag, and is used to search the to-be-searched item blocks according to the storage architecture to obtain a search result.

8. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a data storage program stored in the memory and executable on the processor. When the data storage program is executed by the processor, the steps of the data storage method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a data storage program, which, when executed by a processor, implements the steps of the data storage method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and apparatus for executing relation type calculating instruction in distributed way

    CN105786808A

  • Inferred predicates for query optimization

    US20220179854A1