System and method for querying dynamic cell data based on tree-type relational data offset

By marking and assigning node offsets in the tree structure and building a node index table, the problems of low efficiency and poor accuracy of cell data query in the existing technology are solved, and fast and accurate cell data query is achieved.

CN119336777BActive Publication Date: 2025-04-11浙江网盛数新软件股份有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411885390.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-11
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

When performing cell data query in a tree structure, it is necessary to traverse the entire tree or build a complex index structure, resulting in long query time and low efficiency, and it is difficult to accurately query the required data when data is updated.

Method used

By marking nodes in the tree structure one by one, distinguishing and assigning offsets, building a node index table, and updating the index table when the tree structure is updated, to achieve rapid positioning and extraction of cell data.

Benefits of technology

Improve the efficiency and accuracy of cell data query, avoid the inconvenience of traversing the entire tree structure, and ensure real-time dynamic update of node index tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336777B_ABST
    Figure CN119336777B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data query, and discloses a system and method for querying dynamic cell data based on tree-type relationship data offset; the system comprises the following steps: allocating an offset to a node, constructing a node index table based on the offset and a node identifier, determining whether to execute a node index table update operation, parsing a query request, constructing a model tree, calculating a query offset, and extracting cell data from a target node; compared with the prior art, the present invention can construct a node index table corresponding to a tree structure, and by identifying update attributes of the node index table, an update operation can be performed on the node index table when an update node appears, so as to ensure that the data information in the node index table maintains a real-time dynamic update effect, avoids the problem of low accuracy caused by untimely update of the data information in the node index table, and can quickly and accurately query the required cell data from the tree structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data query, and more specifically, to a system and method for querying dynamic cell data based on tree-type relationship data offset. Background Art

[0002] In a tree-type relational database, data is organized and stored in the form of nodes, and each node may contain multiple cell data. With the continuous growth of the data tree and the diversified evolution of query requirements, how to efficiently and accurately query the required cell data from the tree structure has become a key problem that needs to be solved.

[0003] The patent application with reference publication number CN116842228A discloses a grid cell data query method and system, including receiving the index of the grid cell to be queried and the grid group ID to which it belongs, and obtaining each grid cell set contained in the grid group according to the grid group ID; the grid cell set is a data set of grid cells of the same type, including the cell type, the number of cells, the starting index and the cell topology array; the grid cell set to which the index of the grid cell to be queried belongs is calculated according to the starting index and the number of cells of each grid cell set in turn, as the target cell set; the index of each grid point in the grid cell to be queried is extracted from the cell topology array of the target cell set, and the coordinates of each grid point of the grid cell to be queried are obtained in the global grid point array;

[0004] When performing cell data queries, existing query systems rely on traversing the entire tree or building a complex index structure to determine the node position of the cell data in the tree structure. For example, in the above-mentioned patent application, it calculates the grid cell set to which the index of the grid cell to be queried belongs based on the starting index and the number of cells of each grid cell set to achieve the positioning and identification of the target cell set, which results in a large amount of query time being consumed when querying cell data, reducing the query efficiency. At the same time, in the process of querying a large amount of data, it is also easy for cell data to be updated and changed, resulting in a dynamic change in the query reference basis of subsequent cell data, and thus the required cell data cannot be accurately queried, reducing the query accuracy of the cell data.

[0005] In view of this, the present invention proposes a system and method for querying dynamic cell data based on tree-type relationship data offset to solve the above problems. Summary of the invention

[0006] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution: a system for querying dynamic cell data based on tree-type relationship data offset, comprising:

[0007] The offset allocation module is used to mark all nodes in the tree structure one by one, distinguish the node attributes of all nodes, and allocate offsets to the distinguished nodes;

[0008] An index table construction module is used to obtain the node identifier of the node in the tree structure, and to construct a node index table based on the offset and the node identifier;

[0009] An update determination module is used to formulate an update cycle of the tree structure, and identify the update attributes of the tree structure after the update cycle to determine whether to perform a node index table update operation;

[0010] A request calculation module is used to parse the query features in the query request, construct a model tree with a target node, and calculate the query offset of the target node;

[0011] The query positioning module is used to locate the target node in the tree structure through the node index table using the query offset as the index condition, and extract the cell data from the target node.

[0012] Furthermore, node attributes include root nodes, intermediate nodes, and terminal nodes;

[0013] The methods for distinguishing root nodes, intermediate nodes, and terminal nodes include:

[0014] Numbering the levels of all nodes in the tree structure in ascending order to obtain a tree structure with level numbers;

[0015] The level with level number 1 is recorded as the first level, the remaining levels are recorded as lower levels, and the nodes in the first level are recorded as root nodes;

[0016] In the lower level, mark the pointer from the node on the Ath lower level to the node on the A+1th lower level;

[0017] The nodes with pointers are recorded as intermediate nodes, and the nodes without pointers are recorded as terminal nodes.

[0018] Furthermore, the method of allocating an offset to a node includes:

[0019] Preset the offset of the root node and record it as the starting value;

[0020] Import all nodes into the node queue in ascending order of level number, and select one node from the node queue in turn as the current node;

[0021] Identify the parent node of the current node, use the starting value as the offset of the parent node of the current node, and obtain the parent offset value;

[0022] The nodes with the same level number as the current node are recorded as child nodes, and the number of child nodes is counted to obtain the child node value;

[0023] Arrange the child nodes with the same level number from left to right, and record the position of the current node in the arrangement as the current value;

[0024] Based on the parent offset value, child node value and current value, calculate the offset of the current node;

[0025] The expression of the current node's offset is:

[0026] ;

[0027] In the formula, is the offset of the current node, is the parent offset value, is the child node value, is the current value;

[0028] Traverse all nodes in the node queue, calculate the offsets of B-1 nodes, and assign the offsets of B-1 nodes and the offset of the root node to B nodes accordingly.

[0029] Furthermore, the node identification includes the node name, node level and node order.

[0030] Furthermore, the method for constructing the node index table includes:

[0031] Construct a blank table with two columns and B+1 rows, and fill in the index key and index value in the first row respectively;

[0032] Draw three data bits in each of the remaining B rows in the first column, and mark a separation line between two adjacent data bits to obtain B data groups;

[0033] Import the node names, node levels and node orders of the B nodes into the three data bits of the B data groups one by one according to the level number and current value from small to large;

[0034] The remaining B rows in the second column import the offsets corresponding to the node names, node levels, and node orders of the B nodes, respectively, to generate a node index table.

[0035] Further, the update attribute includes updated and not updated;

[0036] Updated and non-updated identification methods include:

[0037] Query the time when B nodes were first fully recorded one by one through the timestamps to obtain B original times;

[0038] After an update cycle, the times when B nodes are fully recorded are queried one by one through the timestamps to obtain B real-time times;

[0039] Compare the real-time times of B nodes with the corresponding original times one by one, and record the nodes whose real-time times are inconsistent with the original times as updated nodes;

[0040] When there is an updated node in the tree structure, the updated attribute of the tree structure is recorded as updated;

[0041] When there is no update node in the tree structure, the update attribute of the tree structure is recorded as not updated.

[0042] Furthermore, the method for determining whether to perform the node index table update operation includes:

[0043] When the update attribute of the tree structure is updated, it is determined to execute the node index table update operation;

[0044] When the update attribute of the tree structure is not updated, it is determined that the node index table update operation is not performed.

[0045] Furthermore, the query features include hierarchical features, name features, and sequence features;

[0046] The model tree construction methods include:

[0047] Taking the hierarchical features as the hierarchical basis, a basic tree of the same size as the hierarchical features is constructed, and taking the sequential features as the sequential basis, the basic nodes are marked one by one in the hierarchy of the basic tree;

[0048] Based on the name feature, the node names of the basic nodes are identified from top to bottom in the hierarchy, and pointers are marked between the basic nodes of two adjacent levels;

[0049] In the base tree, the base node that is consistent with the level feature, name feature, and order feature is recorded as the target node;

[0050] The parent node of the target node is identified according to the pointer, and the basic node at the first level is recorded as the root node to construct the model tree.

[0051] Furthermore, the method for extracting cell data includes:

[0052] The unit semantics of all the cell data in the target node are recognized by natural language processing technology, and the target node is divided into D cells based on the unit semantics;

[0053] The attributes of the query request and the attributes of the D cells are queried one by one through the attribute management system, and are recorded as query attributes and cell attributes respectively;

[0054] The cells whose cell attributes are consistent with the query attributes of the query request are recorded as valid cells, and the valid cells are split from the target node to obtain the cell data.

[0055] The method for querying dynamic cell data based on tree-type relational data offset is implemented by a system for querying dynamic cell data based on tree-type relational data offset, including:

[0056] S1: Mark all nodes in the tree structure one by one, distinguish the node attributes of all nodes, and assign offsets to the distinguished nodes;

[0057] S2: Obtain the node identifier of the node in the tree structure, and construct a node index table based on the offset and the node identifier;

[0058] S3: Formulate an update cycle for the tree structure, and identify update attributes of the tree structure after the update cycle to determine whether to perform a node index table update operation;

[0059] S4: If the node index table update operation is not performed, the query feature in the query request is parsed, a model tree with a target node is constructed, and a query offset of the target node is calculated;

[0060] S5: Using the query offset as an index condition, locate the target node in the tree structure through the node index table, and extract the cell data from the target node.

[0061] The technical effects and advantages of the system and method for querying dynamic cell data based on tree-type relationship data offset of the present invention are as follows:

[0062] The present invention marks all nodes in a tree structure one by one, distinguishes node attributes of all nodes, assigns offsets to the distinguished nodes, obtains node identifiers of nodes in the tree structure, and constructs a node index table based on the offsets and node identifiers, formulates an update cycle of the tree structure, and identifies update attributes of the tree structure after the update cycle, determines whether to execute a node index table update operation, parses query features in a query request, constructs a model tree with a target node, calculates the query offset of the target node, locates the target node in the tree structure through the node index table, and extracts cell data from the target node; compared with the prior art, the present invention distinguishes node attributes of different types of nodes, and can accurately calculate the offset of the node in the tree structure. The node index table corresponding to the tree structure can be constructed by combining the node identifier, and by identifying the update attributes of the node index table, the node index table can be updated when the update node appears in the node index table, so as to ensure that the data information in the node index table is updated in real time and dynamically, avoiding the problem of low accuracy caused by untimely update of the data information in the node index table. At the same time, a model tree can be constructed according to the query request, and the query offset can be calculated, which can provide accurate positioning index guidance for the offset query of subsequent cell data, and then the required cell data can be queried quickly and accurately from the tree structure, avoiding the inconvenience of traversing and querying all the data in the tree structure, improving the efficiency of cell data query, and also improving the accuracy of cell data query. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of modules of a system for querying dynamic cell data based on tree-type relationship data offset provided in the first embodiment of the present invention;

[0064] Figure 2 A schematic flow chart of a method for querying dynamic cell data based on tree-type relationship data offset provided in Embodiment 2 of the present invention;

[0065] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention;

[0066] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0067] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] Example 1: Please refer to Figure 1 As shown, the system for querying dynamic cell data based on tree-type relationship data offset in this embodiment includes:

[0069] The offset allocation module marks all nodes in the tree structure one by one, distinguishes the node attributes of all nodes, and allocates offsets to the distinguished nodes;

[0070] Nodes are the basic building blocks of a tree structure, and can be used to layer and grade the tree structure. Each node contains cell data and a pointer to the next level of nodes, and there is a hierarchical relationship between nodes. One node can be the parent node of another node, and the latter becomes the child node of the former.

[0071] When marking the nodes of the tree structure, it is necessary to record the collection points on each level and containing cell data as nodes, so that each node can represent the cell data at different levels and different positions as a whole;

[0072] After marking the nodes, it is necessary to identify the attributes and types of the nodes in the tree structure, so as to determine the role and function of each node in the tree structure, and finally achieve the node differentiation effect of all nodes, that is, to quickly and accurately classify nodes of different types and attributes in the tree structure;

[0073] Node attributes include root nodes, intermediate nodes, and terminal nodes; the root node refers to the only node at the first level in the tree structure, which serves as the starting point of all subsequent nodes; the intermediate node refers to the nodes with hierarchical relationships between adjacent levels in the tree structure, which play a role of connecting the upper and lower levels; the terminal node refers to the node in the tree structure that does not have a next-level relationship;

[0074] The methods for distinguishing root nodes, intermediate nodes, and terminal nodes include:

[0075] Numbering the levels of all nodes in the tree structure in ascending order to obtain a tree structure with level numbers;

[0076] The level with level number 1 is recorded as the first level, the remaining levels are recorded as lower levels, and the nodes in the first level are recorded as root nodes;

[0077] In the lower level, mark the pointer from the node on the Ath lower level to the node on the A+1th lower level;

[0078] The nodes with pointers are recorded as intermediate nodes, and the nodes without pointers are recorded as terminal nodes.

[0079] When all nodes in the tree structure are divided by node attributes, it is necessary to assign corresponding offsets to each node according to the location and node attributes of each node. The offset refers to the position difference between the node in the previous level and the node in the next level in the tree data structure, so as to accurately represent the specific position of the node in the tree structure.

[0080] Methods for assigning offsets to nodes include:

[0081] Preset the offset of the root node and record it as the starting value;

[0082] Import all nodes into the node queue in ascending order of level number, and select one node from the node queue in turn to record it as the current node; by obtaining the node queue, all nodes can be arranged and integrated in sequence, so as to ensure that all nodes are selected and calculated in order, thereby improving the orderliness of node selection and marking;

[0083] Identify the parent node of the current node, use the starting value as the offset of the parent node of the current node, and obtain the parent offset value;

[0084] The nodes with the same level number as the current node are recorded as child nodes, and the number of child nodes is counted to obtain the child node value;

[0085] Arrange the child nodes with the same level number from left to right, and record the position of the current node in the arrangement as the current value;

[0086] Based on the parent offset value, child node value and current value, calculate the offset of the current node;

[0087] The expression of the current node's offset is:

[0088] ;

[0089] In the formula, is the offset of the current node, is the parent offset value, is the child node value, is the current value;

[0090] Traverse all nodes in the node queue, calculate the offsets of B-1 nodes, and assign the offsets of B-1 nodes and the offset of the root node to B nodes accordingly.

[0091] It should be noted that the node traversal method adopts breadth-first traversal, which can maintain the consistency of offset calculation during the traversal process and ensure that the offset of each node is unique.

[0092] An index table construction module obtains the node identifier of the node in the tree structure, and constructs a node index table based on the offset and the node identifier;

[0093] The node identifier is used to accurately represent the specific location information and type information of the node in the tree structure, so that in the subsequent node query operation, the corresponding node can be quickly found through the offset, or its offset can be quickly obtained through the node identifier. It also serves as the basis for subsequent cell data deviation query;

[0094] The node identifier includes the node name, node level and node order; the node name refers to the type attribute of the node in the tree structure, which can distinguish nodes of different types of attributes; the node level refers to the level number of the level where the node is located in the tree structure; the node order refers to the sequential position of the node in the same level;

[0095] Specifically, a node name consists of a root node, an intermediate node, and a terminal node, and each node can only be one of the root node, the intermediate node, and the terminal node. The node level is the level number of the level where the node is located, and each node has one and only one node level. The node order is the sequential position of the node in the nodes with the same level number, and each node has one and only one node order.

[0096] When the node identifier is obtained, it is necessary to construct a node index table that matches the nodes in the tree structure based on the node name, node level, node order and offset, so that the node index table can uniquely, accurately and orderly arrange and display the offsets and node identifiers of the nodes in the tree structure, and provide a reference for subsequent cell data offset queries in the tree structure;

[0097] The node index table construction method includes:

[0098] Construct a blank table with two columns and B+1 rows, and fill in the index key and index value in the first row respectively;

[0099] Three data bits are drawn in the remaining B rows in the first column, and a separator line is marked between two adjacent data bits, so as to obtain B data groups; the data group is data used to integrate the node name, node level and node order as a whole, and the data bit is the smallest unit constituting the data group, and enables the data bit to provide accurate import position limitation for the node name, node level and node order;

[0100] Import the node names, node levels and node orders of the B nodes into the three data bits of the B data groups one by one according to the level number and current value from small to large;

[0101] The remaining B rows in the second column import the offsets corresponding to the node names, node levels, and node orders of the B nodes, respectively, to generate a node index table.

[0102] By constructing a node index table, the node identifiers and offsets of all nodes in the tree structure can be stored independently and accurately, and a fast and accurate reference object can be provided for the cell data in subsequent nodes, thereby improving the query efficiency and accuracy of the cell data.

[0103] Exemplarily, according to the above-mentioned method for constructing the node index table, a tree structure with 10 nodes is selected to construct the following node index table, and the node identifier and offset corresponding to the node are imported into the node index table, as shown in Table 1;

[0104] Table 1: Node index table

[0105]

[0106] As shown in Table 1, the offset of the root node of Table 1 is set to 0, and the node identifiers and offsets of all nodes are as recorded in Table 1.

[0107] The update determination module formulates the update cycle of the tree structure, and identifies the update attributes of the tree structure after the update cycle to determine whether to perform the node index table update operation;

[0108] After the node index table is constructed, the index key and index value in the node index table can only represent the nodes of the tree structure at a certain moment. When the tree structure undergoes insertion or deletion, the node index table needs to be updated according to the changes in the offset of the relevant node and the node identifier, so as to ensure that the node index table can maintain real-time dynamic update effect and prevent the node index table from lagging or being inaccurate.

[0109] In order to perform regular updates on the node index table, an update cycle needs to be worked out, so that the node index table can be updated regularly after the update cycle.

[0110] When formulating the update cycle, it is necessary to calculate in advance the duration of changes in each node in the tree structure and select the maximum duration of the change as the update cycle, so that the change duration of the update cycle is longer, ensuring that all nodes in the tree structure can undergo at least one insertion or deletion change after the update cycle.

[0111] The update attribute is used to indicate whether the tree structure has changed after the update cycle, which can be used as the basis for subsequent judgment on whether to update the node index table;

[0112] Update attributes include updated and not updated; updated means that the tree structure has changed dynamically after the update cycle, and not updated means that the tree structure has not changed dynamically after the update cycle;

[0113] Updated and non-updated identification methods include:

[0114] Query the time when B nodes were first fully recorded one by one through the timestamps to obtain B original times;

[0115] After an update cycle, the times when B nodes are fully recorded are queried one by one through the timestamps to obtain B real-time times;

[0116] Compare the real-time times of B nodes with the corresponding original times one by one, and record the nodes whose real-time times are inconsistent with the original times as updated nodes;

[0117] When there is an update node in the tree structure, it means that the node of the tree structure has been inserted, deleted, etc., and the update attribute of the tree structure is recorded as updated;

[0118] When there is no update node in the tree structure, it means that no insertion, deletion, etc. has occurred to the nodes of the tree structure, and the update attribute of the tree structure is recorded as not updated.

[0119] The node index table update operation refers to the operation of updating and replacing the index key and index value in the node index table after the update node appears in the tree structure, so as to ensure that the node index table can accurately match the relevant index information of the node in the tree structure, and ensure that the node index table can dynamically and real-time associate the node information of the tree structure;

[0120] The determination method of whether to perform the node index table update operation includes:

[0121] When the update attribute of the tree structure is updated, the node index table of the tree structure needs to update and replace the index key and index value, and it is determined to execute the node index table update operation;

[0122] When the update attribute of the tree structure is not updated, the node index table of the tree structure does not need to update and replace the index key and index value, and it is determined that the node index table update operation is not performed.

[0123] It should be noted that when it is necessary to perform a node index table update operation, it is necessary to identify each update node from the tree structure and obtain C update nodes. At this time, the node allocation module is used to distinguish the node attributes of the C update nodes, and offsets are allocated to the C update nodes again. Then, the node identifiers of the C update nodes are obtained through the index table construction module, and the index keys and index values ​​corresponding to the C update nodes are located in the node index table. After the index keys and index values ​​corresponding to the C update nodes are removed, the node identifiers and offsets of the C update nodes are imported into the node index table accordingly, and the removed index keys and index values ​​can be updated and replaced, thereby realizing the update operation of the node index table and ensuring that the node index table can maintain a real-time dynamic update effect.

[0124] The request calculation module parses the query features in the query request, constructs a model tree with a target node, and calculates the query offset of the target node;

[0125] The query request refers to the comprehensive information of the request for offset query cell data sent by the user end to the tree structure, while the query feature is a concise representation of the specific query meaning in the query request, and can simplify the complex and lengthy query request, and provide a basis for the subsequent identification of the node to be verified;

[0126] The query features include hierarchical features, name features and sequence features; the hierarchical features are used to represent the hierarchical level of the cell data in the tree structure in the query request, the name features are used to represent the name of the cell data in the tree structure in the query request, and the sequence features are used to represent the order of the cell data in the tree structure in the query request; the hierarchical features, name features and sequence features are all obtained after identifying and parsing the query request through natural language processing technology.

[0127] After parsing the query features, it is necessary to construct a model tree adapted to the query features according to the query features, so that the model tree can represent the model structure of the upper half of the target node corresponding to the query features in the tree structure, and serve as a basis for identifying the target node, and the target node is the node corresponding to the query feature, so that the target node contains the required cell data;

[0128] The model tree construction methods include:

[0129] Taking the hierarchical features as the hierarchical basis, a basic tree of the same size as the hierarchical features is constructed, and taking the sequential features as the sequential basis, the basic nodes are marked one by one in the hierarchy of the basic tree; the basic tree refers to a blank tree structure without actual nodes and pointers, and serves as the basis for constructing subsequent model trees;

[0130] Based on the name feature, the node names of the basic nodes are identified from top to bottom in the hierarchy, and pointers are marked between the basic nodes of two adjacent levels;

[0131] In the base tree, the base node that is consistent with the level feature, name feature, and order feature is recorded as the target node;

[0132] The parent node of the target node is identified according to the pointer, and the basic node at the first level is recorded as the root node to construct the model tree.

[0133] After the model tree is constructed, the offset of the target node can be calculated according to the model tree and recorded as the query offset, so that the query offset can be used as a basis for subsequent accurate query of cell data;

[0134] The calculation method of the query offset is consistent with the calculation method of the offset of the current node mentioned above. When calculating the query offset, it is necessary to preset an offset for the root node of the model tree, and identify the offset of the parent node of the target node based on the offset of the root node. At the same time, obtain the total number of nodes in the hierarchy where the target node is located in the model tree and the order of the target node in the hierarchy. Finally, the offset of the target node is calculated through the expression of the offset of the current node and recorded as the query offset.

[0135] The query positioning module uses the query offset as the index condition, locates the target node in the tree structure through the node index table, and extracts the cell data from the target node;

[0136] After the query offset is obtained, the query offset is used as the index condition for the offset query. The index value that is consistent with the query offset can be queried from the node index table, and then the index key corresponding to the index value is recorded as the query index key. After that, the unique target node can be accurately located from the tree structure according to the node name, node level and node order in the query index key, so that the node position where the cell data is located can be offset queried in the tree structure.

[0137] After locating the target node, it is necessary to extract the required cell data from the multiple cell data of the target node, thereby ensuring the accuracy and uniqueness of the deviation query of the cell data and improving the precision of the cell data offset query;

[0138] The methods for extracting cell data include:

[0139] The unit semantics of all cell data in the target node are identified through natural language processing technology, and the target node is divided into D cells based on the unit semantics; the unit semantics is used to concisely express the true meaning of the cell data, and serves as the basis for subsequent identification and positioning of the cell data;

[0140] The attributes of the query request and the attributes of the D cells are queried one by one through the attribute management system, and are recorded as query attributes and cell attributes respectively;

[0141] The cells whose cell attributes are consistent with the query attributes of the query request are recorded as valid cells, and the valid cells are split from the target node to obtain the cell data.

[0142] It should be noted that there may be one or more cell data extracted. When there are multiple cell data, all cell data should be split from the target node and arranged one by one in the order of splitting, so that there will be no cross-interference between multiple cell data, thereby improving the independence and stability of cell data extraction.

[0143] In this embodiment, all nodes in the tree structure are marked one by one, node attributes of all nodes are distinguished, and offsets are assigned to the distinguished nodes, node identifiers of the nodes in the tree structure are obtained, and a node index table is constructed based on the offsets and node identifiers, an update cycle of the tree structure is formulated, and update attributes of the tree structure are identified after the update cycle, and it is determined whether to execute the node index table update operation, the query features in the query request are parsed, a model tree with a target node is constructed, and the query offset of the target node is calculated, the target node is located in the tree structure through the node index table, and cell data is extracted from the target node; compared with the prior art, by distinguishing node attributes of different types of nodes, the offsets of the nodes in the tree structure can be accurately calculated. The node index table corresponding to the tree structure can be constructed by combining the node identifier with the node index table, and the node index table can be updated when the update node appears in the node index table by updating the attribute identification, so as to ensure that the data information in the node index table is updated in real time and dynamically, avoiding the problem of low accuracy caused by untimely update of the data information in the node index table. At the same time, a model tree can be constructed according to the query request, and the query offset can be calculated, which can provide accurate positioning index guidance for the subsequent offset query of cell data, and then the required cell data can be queried quickly and accurately from the tree structure, avoiding the inconvenience of traversing and querying all the data in the tree structure, improving the efficiency of cell data query, and also improving the accuracy of cell data query.

[0144] Example 2: Please refer to Figure 2 As shown, the part not described in detail in this embodiment is described in the first embodiment, and a method for querying dynamic cell data based on tree-type relationship data offset is provided, which is implemented by a system for querying dynamic cell data based on tree-type relationship data offset, including:

[0145] S1: Mark all nodes in the tree structure one by one, distinguish the node attributes of all nodes, and assign offsets to the distinguished nodes;

[0146] S2: Obtain the node identifier of the node in the tree structure, and construct a node index table based on the offset and the node identifier;

[0147] S3: formulate an update cycle of the tree structure, and identify the update attributes of the tree structure after the update cycle to determine whether to perform the node index table update operation; if the node index table update operation is not performed, perform S4-S5; if the node index table update operation is performed, repeat S1-S3;

[0148] S4: parse the query features in the query request, construct a model tree with a target node, and calculate the query offset of the target node;

[0149] S5: Using the query offset as an index condition, locate the target node in the tree structure through the node index table, and extract the cell data from the target node.

[0150] Example 3: Please refer to Figure 3 As shown, this embodiment discloses an electronic device, including a processor and a memory;

[0151] Wherein, the memory stores a computer program that can be called by the processor;

[0152] The processor executes the method of querying dynamic cell data based on tree-type relationship data offset by calling the computer program stored in the memory.

[0153] Since the electronic device introduced in this embodiment is an electronic device used to implement the method for querying dynamic cell data based on tree-type relationship data offset in the second embodiment of the present application, based on the method for querying dynamic cell data based on tree-type relationship data offset introduced in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as the electronic device used by a person skilled in the art to implement the method for querying dynamic cell data based on tree-type relationship data offset in the embodiment of the present application, it belongs to the scope of protection of the present application.

[0154] Example 4: Please refer to Figure 4 As shown, this embodiment discloses a computer-readable storage medium on which a rewritable computer program is stored;

[0155] When the computer program is executed, the method of querying dynamic cell data based on tree-type relationship data offset is implemented.

[0156] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A system for querying dynamic cell data based on tree-type relational data offset, characterized in that: include: The offset allocation module is used to mark all nodes in the tree structure one by one, distinguish the node attributes of all nodes, and allocate offsets to the distinguished nodes; An index table construction module is used to obtain the node identifier of the node in the tree structure, and to construct a node index table based on the offset and the node identifier; An update determination module is used to formulate an update cycle of the tree structure, and identify the update attributes of the tree structure after the update cycle to determine whether to perform a node index table update operation; A request calculation module is used to parse the query features in the query request, construct a model tree with a target node, and calculate the query offset of the target node; The query positioning module is used to locate the target node in the tree structure through the node index table using the query offset as the index condition, and extract the cell data from the target node.

2. The system for querying dynamic cell data based on tree-type relational data offset according to claim 1, characterized in that: Node attributes include root node, intermediate node and terminal node; The methods for distinguishing root nodes, intermediate nodes, and terminal nodes include: Numbering the levels of all nodes in the tree structure in ascending order to obtain a tree structure with level numbers; The level with level number 1 is recorded as the first level, the remaining levels are recorded as lower levels, and the nodes in the first level are recorded as root nodes; In the lower level, mark the pointer from the node on the Ath lower level to the node on the A+1th lower level; The nodes with pointers are recorded as intermediate nodes, and the nodes without pointers are recorded as terminal nodes.

3. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 2 is characterized in that: Methods for assigning offsets to nodes include: Preset the offset of the root node and record it as the starting value; Import all nodes into the node queue in ascending order of level number, and select one node from the node queue in turn as the current node; Identify the parent node of the current node, use the starting value as the offset of the parent node of the current node, and obtain the parent offset value; The nodes with the same level number as the current node are recorded as child nodes, and the number of child nodes is counted to obtain the child node value; Arrange the child nodes with the same level number from left to right, and record the position of the current node in the arrangement as the current value; Based on the parent offset value, child node value and current value, calculate the offset of the current node; The expression of the current node's offset is: ; In the formula, is the offset of the current node, is the parent offset value, is the child node value, is the current value; Traverse all nodes in the node queue, calculate the offsets of B-1 nodes, and assign the offsets of B-1 nodes and the offset of the root node to B nodes accordingly.

4. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 3 is characterized in that: Node identification includes node name, node level and node order.

5. The system for querying dynamic cell data based on tree-type relational data offset according to claim 4 is characterized in that: The node index table construction method includes: Construct a blank table with two columns and B+1 rows, and fill in the index key and index value in the first row respectively; Draw three data bits in each of the remaining B rows in the first column, and mark a separation line between two adjacent data bits to obtain B data groups; Import the node names, node levels and node orders of the B nodes into the three data bits of the B data groups one by one according to the level number and current value from small to large; The remaining B rows in the second column import the offsets corresponding to the node names, node levels, and node orders of the B nodes, respectively, to generate a node index table.

6. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 5, characterized in that: Update attributes include updated and not updated; Updated and non-updated identification methods include: Query the time when B nodes were first fully recorded one by one through the timestamps to obtain B original times; After an update cycle, the times when B nodes are fully recorded are queried one by one through the timestamps to obtain B real-time times; Compare the real-time times of B nodes with the corresponding original times one by one, and record the nodes whose real-time times are inconsistent with the original times as updated nodes; When there is an updated node in the tree structure, the updated attribute of the tree structure is recorded as updated; When there is no update node in the tree structure, the update attribute of the tree structure is recorded as not updated.

7. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 6, characterized in that: The determination method of whether to perform the node index table update operation includes: When the update attribute of the tree structure is updated, it is determined to execute the node index table update operation; When the update attribute of the tree structure is not updated, it is determined that the node index table update operation is not performed.

8. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 7, characterized in that: The query features include hierarchical features, name features, and order features; The model tree construction methods include: Taking the hierarchical features as the hierarchical basis, a basic tree of the same size as the hierarchical features is constructed, and taking the sequential features as the sequential basis, the basic nodes are marked one by one in the hierarchy of the basic tree; Based on the name feature, the node names of the basic nodes are identified from top to bottom in the hierarchy, and pointers are marked between the basic nodes of two adjacent levels; In the base tree, the base node that is consistent with the level feature, name feature, and order feature is recorded as the target node; The parent node of the target node is identified according to the pointer, and the basic node at the first level is recorded as the root node to construct the model tree.

9. The system for querying dynamic cell data based on tree-type relationship data offset according to claim 8, characterized in that: The methods for extracting cell data include: The unit semantics of all the cell data in the target node are recognized by natural language processing technology, and the target node is divided into D cells based on the unit semantics; The attributes of the query request and the attributes of the D cells are queried one by one through the attribute management system, and are recorded as query attributes and cell attributes respectively; The cells whose cell attributes are consistent with the query attributes of the query request are recorded as valid cells, and the valid cells are split from the target node to obtain the cell data.

10. A method for querying dynamic cell data based on tree-type relationship data offset, implemented based on the system for querying dynamic cell data based on tree-type relationship data offset according to any one of claims 1 to 9, characterized in that: include: S1: Mark all nodes in the tree structure one by one, distinguish the node attributes of all nodes, and assign offsets to the distinguished nodes; S2: Obtain the node identifier of the node in the tree structure, and construct a node index table based on the offset and the node identifier; S3: Formulate an update cycle for the tree structure, and identify update attributes of the tree structure after the update cycle to determine whether to perform a node index table update operation; S4: If the node index table update operation is not performed, the query feature in the query request is parsed, a model tree with a target node is constructed, and a query offset of the target node is calculated; S5: Using the query offset as an index condition, locate the target node in the tree structure through the node index table, and extract the cell data from the target node.

Citation Information

Patent Citations

  • Grid cell data query method and system

    CN116842228A

  • Stream data-oriented quick indexing method, streaming data-oriented quick indexing device, streaming data-oriented quick indexing equipment and storage medium

    CN111125120A

  • Network flow real-time indexing method and system

    CN113139100A