Data query method and apparatus, computer device, and computer-readable storage medium

By obtaining and analyzing node information and association lists, query instructions are generated to narrow the query scope, solving the problem of low data query efficiency in the database and achieving fast and efficient data location and query.

WO2024183311A1PCT designated stage expired Publication Date: 2024-09-12KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/129261
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-06
Filing Date
2023-11-02
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

In databases with large data storage scales, existing technologies are difficult to complete data queries quickly and efficiently. In particular, they cannot perform regional positioning of target data, resulting in low query efficiency.

Method used

By obtaining the current node information, the target node parent category identifier and the node association list, determine the adjacent node information according to the association relationship, and generate a query instruction to narrow the query scope. Based on the query instruction, the node association list is queried, and the target node information is obtained and output target data.

Benefits of technology

It effectively improves the efficiency of data query, can quickly locate and query target data, narrows the scope of query, and improves the accuracy and speed of data query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023129261_12092024_PF_FP_ABST
    Figure CN2023129261_12092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a data query method and apparatus, a computer device, and a computer-readable storage medium. The method comprises: in response to a starting instruction, acquiring current node information, a target node parent class identifier and a node association list, current node class identifiers comprising a current parent class identifier and a current child class identifier, and the node association list being generated by traversing each node path in a data graph corresponding to the current node information and the node class identifier of each node; according to an association relationship, determining adjacent node information corresponding to the current node information; according to the current parent class identifier and the current child class identifier, the adjacent node child class identifier corresponding to the adjacent node information, and the target node parent class identifier, generating a query instruction; and querying the node association list on the basis of the query instruction to obtain target node information corresponding to the target node parent class identifier, and, according to the target node information, determining and outputting target data.
Need to check novelty before this filing date? Find Prior Art

Description

Data query method, device, computer equipment and computer readable storage medium

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023102397594, filed on March 6, 2023, entitled “Data query method, device, computer equipment and computer-readable storage medium”, the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a data query method, apparatus, computer equipment, and computer-readable storage medium. Background Art

[0004] With the development of computer technology, the data storage scale of computer equipment is getting larger and larger. Therefore, when performing data query on a database with a large data storage scale, it is very important to complete the data query operation quickly and efficiently.

[0005] Summary of the Invention

[0006] In a first aspect, the present application provides a data query method, comprising:

[0007] In response to the start instruction, the current node information, the target node parent category identifier, and the node association list are obtained. The current node information includes the current node category identifier and the association relationship with other nodes. The current node category identifier includes the current parent category identifier and the current child category identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information.

[0008] Determine the adjacent node information corresponding to the current node information based on the association relationship, where the adjacent node information is directly associated with the current node information;

[0009] Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier;

[0010] The node association list is queried based on the query instruction to obtain the target node information corresponding to the parent category identifier of the target node, and the target data is determined and output according to the target node information.

[0011] In one embodiment, determining the adjacent node information corresponding to the current node information according to the association relationship includes:

[0012] Determine the association path between the current node corresponding to the current node information and each associated node in the data graph according to the association relationship;

[0013] When no other nodes exist on the associated path, the associated node is determined to be the adjacent node corresponding to the current node information, and the adjacent node information corresponding to the adjacent node is obtained.

[0014] In one embodiment, generating a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier includes:

[0015] When the number of parent category identifiers of the target node is at least two, a batch query instruction is generated according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifiers corresponding to the adjacent node information, and the parent category identifiers of each target node;

[0016] Based on the query instruction, the node association list is queried to obtain the target node information corresponding to the parent category identifier of the target node, and the target data is determined and output according to the target node information, including:

[0017] Perform batch query on the node association list according to the batch query instruction to obtain the corresponding target node information, and determine the target data according to the target node information;

[0018] The target data are sorted and output based on the association relationship between the parent category identifiers of the target nodes.

[0019] In one embodiment, querying the node association list based on the query instruction to obtain target node information corresponding to the target node parent category identifier, and determining and outputting target data based on the target node information include:

[0020] Determine a first query scope in the node association list according to the current parent category identifier and the current child category identifier;

[0021] Determine a second query range within the first query range according to the adjacent node subcategory identifier;

[0022] The corresponding target node information is determined within the second query range according to the target node parent category identifier, and the target data is determined and output according to the target node information.

[0023] In a second aspect, the present application provides a method for generating a data list, comprising:

[0024] Obtain a data graph corresponding to the target data and determine the target data node based on the data graph. The data graph includes at least two data nodes of different data categories and the association relationship between the data nodes.

[0025] Determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph;

[0026] Traverse each node path of the data graph based on the association relationship between each data node. The node path is determined by starting from the target data node and ending at the corresponding data node;

[0027] Store the data nodes on each node path into the list position that matches the data category corresponding to the list column dimension based on the corresponding data category. Each node path corresponds to the same row.

[0028] Until all node paths in the data map are stored, a target data list corresponding to the data map is generated.

[0029] In one embodiment, the data nodes on each node path are stored in a list position that matches the data category corresponding to the list column dimension based on the corresponding data category, including:

[0030] Query the data category corresponding to each data node on each node path in turn;

[0031] When the data category of the current data node does not match the data category corresponding to the list column dimension, the corresponding target data category is added to the target list column dimension according to the data category of the current data node, and the current data node is stored in the list position corresponding to the target data category.

[0032] In a third aspect, the present application provides a data query device, comprising:

[0033] An acquisition module, configured to obtain, in response to a start instruction, current node information, a target node parent category identifier, and a node association list, wherein the current node information includes the current node category identifier and associations with other nodes, the current node category identifier including the current parent category identifier and the current child category identifier, and the node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information;

[0034] A query instruction generation module is used to determine the adjacent node information corresponding to the current node information based on the association relationship, where the adjacent node information is directly associated with the current node information; and generate a query instruction based on the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier;

[0035] The query module is used to query the node association list based on the query instruction, obtain the target node information corresponding to the parent category identifier of the target node, and determine and output the target data according to the target node information.

[0036] In a fourth aspect, the present application provides a data list generating device, comprising:

[0037] A data acquisition module is used to obtain a data map corresponding to the target data and determine the target data node based on the data map. The data map includes at least two data nodes of different data categories and the association relationship between each data node;

[0038] The data traversal module is used to determine the corresponding list column dimension based on the total number of data categories of each data node in the data map; traverse each node path of the data map based on the association relationship between each data node, and the node path is determined by starting from the target data node and ending at the corresponding data node;

[0039] The list generation module is used to store the data nodes on each node path into a list position that matches the data category corresponding to the list column dimension based on the corresponding data category. Each node path corresponds to the same row; until all node paths in the data map are stored, a target data list corresponding to the data map is generated.

[0040] In a fifth aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] In response to the start instruction, the current node information, the target node parent category identifier, and the node association list are obtained. The current node information includes the current node category identifier and the association relationship with other nodes. The current node category identifier includes the current parent category identifier and the current child category identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information.

[0042] Determine the adjacent node information corresponding to the current node information based on the association relationship, where the adjacent node information is directly associated with the current node information;

[0043] Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier;

[0044] The node association list is queried based on the query instruction to obtain the target node information corresponding to the parent category identifier of the target node, and the target data is determined and output according to the target node information.

[0045] In a sixth aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0046] Obtain a data graph corresponding to the target data and determine the target data node based on the data graph. The data graph includes at least two data nodes of different data categories and the association relationship between the data nodes.

[0047] Determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph;

[0048] Traverse each node path of the data graph based on the association relationship between each data node. The node path is determined by starting from the target data node and ending at the corresponding data node;

[0049] Store the data nodes on each node path into the list position that matches the data category corresponding to the list column dimension based on the corresponding data category. Each node path corresponds to the same row.

[0050] Until all node paths in the data map are stored, a target data list corresponding to the data map is generated.

[0051] In a seventh aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0052] In response to the start instruction, the current node information, the target node parent category identifier, and the node association list are obtained. The current node information includes the current node category identifier and the association relationship with other nodes. The current node category identifier includes the current parent category identifier and the current child category identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information.

[0053] Determine the adjacent node information corresponding to the current node information based on the association relationship, where the adjacent node information is directly associated with the current node information;

[0054] Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier;

[0055] The node association list is queried based on the query instruction to obtain the target node information corresponding to the parent category identifier of the target node, and the target data is determined and output according to the target node information.

[0056] In an eighth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0057] Obtain a data graph corresponding to the target data and determine the target data node based on the data graph. The data graph includes at least two data nodes of different data categories and the association relationship between the data nodes.

[0058] Determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph;

[0059] Traverse each node path of the data graph based on the association relationship between each data node. The node path is determined by starting from the target data node and ending at the corresponding data node;

[0060] Store the data nodes on each node path into the list position that matches the data category corresponding to the list column dimension based on the corresponding data category. Each node path corresponds to the same row.

[0061] Until all node paths in the data map are stored, a target data list corresponding to the data map is generated.

[0062] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0064] FIG1 is an application environment diagram of a data query method according to an embodiment;

[0065] FIG2 is a schematic diagram of a flow chart of a data query method in one embodiment;

[0066] FIG3 is a schematic diagram of a process for determining neighboring node information of a current node in one embodiment;

[0067] FIG4 is a schematic diagram of a process for performing batch query on multiple target data in one embodiment;

[0068] FIG5 is a schematic diagram of a process for querying target data according to an embodiment;

[0069] FIG6 is a schematic flow chart of a method for generating a data list in one embodiment;

[0070] FIG7 is a schematic diagram of a process of traversing a node path in one embodiment;

[0071] FIG8 is a structural block diagram of a data query device according to an embodiment;

[0072] FIG9 is a block diagram of a data list generating device according to an embodiment;

[0073] FIG10 is a flow chart of a method for generating a data list in one embodiment;

[0074] FIG11 is a schematic diagram of a data list generated in one embodiment;

[0075] FIG12 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0077] With the advancement of computer technology, the scale of data storage in computer devices is increasing. One technique known to the applicant involves sequentially traversing the entire database along the paths of each data node, thereby storing the associated paths corresponding to each path. This method cannot regionally locate the target data during data queries, resulting in low data query efficiency.

[0078] The data query method provided by the present application can be applied in an application environment as shown in FIG1 . As shown in FIG1 , the computer device 102 obtains the current node information, the target node parent category identifier and the node association list in response to the startup instruction. The current node information includes the current node category identifier and the association relationship with other nodes. The current node category identifier includes the current parent category identifier and the current subcategory identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data map corresponding to the current node information; the adjacent node information corresponding to the current node information is determined according to the association relationship, and the adjacent node information is directly associated with the current node information; a query instruction is generated according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier; based on the query instruction, the node association list is queried to obtain the target node information corresponding to the target node parent category identifier, and the target data is determined and output according to the target node information. Among them, the computer device 102 can be, but is not limited to, various personal computers, servers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, etc.

[0079] In one embodiment, as shown in FIG2 , a data query method is provided. The method is described by taking the computer device 102 in FIG1 as an example, and includes the following steps:

[0080] Step S202 : obtaining current node information, target node parent category identifier, and node association list in response to the start instruction.

[0081] Among them, the current node information includes the current node category identifier and the association relationship with other nodes. The current node category identifier contains the current node location information and the current parent category identifier and the current child category identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information. Each node in the data graph has corresponding node information, and the node information includes the location information and node category identifier of the corresponding node.

[0082] Specifically, after receiving the start instruction, the computer device obtains the current node information corresponding to the current node corresponding to the user's current data query operation, the target node parent category identifier corresponding to the current node information, and the node association list, where the target node is the data node to be queried.

[0083] Step S204: determining the adjacent node information corresponding to the current node information according to the association relationship, where the adjacent node information is directly associated with the current node information.

[0084] Among them, a direct association relationship means that there is at least one direct association path between the two node information, and a direct association path means that the association path between the two nodes does not contain any other nodes. For example, if there is only an association path abc and an association is generated, then because the association path between node a and node c contains other node b, node a and node c are not directly associated, but node a and node b, and node b and node c are both directly associated.

[0085] Specifically, the computer device determines the associated path information between the current node information and other node information corresponding to the data graph based on the current node information obtained in the aforementioned steps, determines the node information in the entire data graph that is directly associated with the current node information, and determines these node information that is directly associated with the current node information as the adjacent node information corresponding to the current node information.

[0086] Step S206: Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier.

[0087] The query instruction is used to query the target node subcategory identifier in the node association list according to the current node information and the target node parent category identifier.

[0088] Specifically, the computer device generates a first sub-segment corresponding to the query instruction based on the current parent category identifier and the current child category identifier, then generates a second sub-segment corresponding to the query instruction based on the first sub-segment and the adjacent node information, and finally fuses the first sub-segment, the second sub-segment and the parent category identifier of the target node to generate the query instruction.

[0089] Step S208 : querying the node association list based on the query instruction, obtaining target node information corresponding to the target node parent category identifier, and determining and outputting target data according to the target node information.

[0090] Specifically, the computer device determines the first query range corresponding to the current node information in the node association list according to the first sub-segment of the query instruction, and then continues to determine the second query range corresponding to the current node information within the first query range according to the second sub-segment of the query instruction. Finally, according to the parent category identifier of the target node, the computer device queries the corresponding target node information within the second query range, and determines the storage location information of the corresponding target data according to the target node information and outputs it.

[0091] In this embodiment, the current node information, the target node parent category identifier and the node association list are obtained in response to the startup instruction, and the adjacent node information corresponding to the current node information is determined based on the association relationship between the current node information and other node information in the data map. Then, a query instruction is generated based on the current node category identifier of the current node information and the adjacent node subcategory identifier of its adjacent node and the target node parent category identifier. According to this query instruction, the query range of the target node subcategory identifier in the node association list can be effectively narrowed, and the target data can be quickly queried, thereby effectively improving the data query efficiency.

[0092] In one embodiment, as shown in FIG3 , determining the adjacent node information corresponding to the current node information according to the association relationship includes:

[0093] Step S302: determining the association path between the current node corresponding to the current node information and each associated node in the data graph according to the association relationship.

[0094] Specifically, the computer device reads the corresponding association relationship in the current node information, and obtains the association path between the current node corresponding to the current node information and each associated node in the data graph based on the association relationship between the current node information and other node information.

[0095] Step S304: When there are no other nodes on the associated path, determine that the associated node is the adjacent node corresponding to the current node information, and obtain the adjacent node information corresponding to the adjacent node.

[0096] Specifically, the computer device traverses each associated path corresponding to the current node determined in the aforementioned steps in sequence. When there are no other nodes on the associated path (that is, a certain associated path only includes the current node and the corresponding end point), the associated path without other nodes is determined as a direct associated path, and the corresponding nodes on the direct associated path other than the current node are determined as adjacent nodes corresponding to the current node, and adjacent node information corresponding to the adjacent nodes is obtained.

[0097] In this embodiment, the association path between the current node corresponding to the current node information and each associated node in the data graph is determined based on the association relationship, and then when it is judged that there are no other nodes on the association path, the associated node is determined to be the adjacent node corresponding to the current node information, and the adjacent node information corresponding to the adjacent node is obtained. Then, the adjacent node information corresponding to the current node information can be quickly determined based on the association relationship corresponding to each node information, effectively improving the efficiency of determining the adjacent node information.

[0098] In one embodiment, as shown in FIG4 , generating a query instruction based on the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier includes:

[0099] Step S402: When the number of target node parent category identifiers is at least two, a batch query instruction is generated according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifiers corresponding to the adjacent node information, and the parent category identifiers of each target node.

[0100] Specifically, when the computer device obtains multiple (at least two) target node parent category identifiers at one time, it generates a first sub-segment corresponding to the batch query instruction based on the current parent category identifier and the current sub-category identifier, and then generates a second sub-segment corresponding to the batch query instruction based on the adjacent node sub-category identifier corresponding to the first sub-segment and the adjacent node information. Finally, the first sub-segment, the second sub-segment and the target node parent category identifier are merged to generate a batch query instruction.

[0101] Based on the query instruction, the node association list is queried to obtain the target node information corresponding to the parent category identifier of the target node, and the target data is determined and output according to the target node information, including:

[0102] Step S404: perform batch query on the node association list according to the batch query instruction to obtain information of each corresponding target node, and determine each target data according to the information of each target node.

[0103] The batch query instruction is used to batch query target data corresponding to multiple target node information associated with the current node information in the node association list according to the current node information.

[0104] Specifically, the computer device can determine the first search range corresponding to the current node information in the node association list according to the first sub-segment corresponding to the batch query instruction, and then determine the second search range according to the second sub-segment corresponding to the batch query instruction, and then determine the target data corresponding to each target node information within the second search range according to the parent category identifier of each target node. The computer device can also fuse the parent category identifiers of each target node in the batch query instruction with the current parent category identifier, the current subcategory identifier, and the adjacent node subcategory identifier corresponding to the adjacent node information to generate multiple query instructions, and then determine the preset priority corresponding to each query instruction according to the parent category identifier of each target node, and query the target data according to the corresponding query instruction in order of priority from high to low.

[0105] Step S406: sort and output each target data based on the association relationship between the parent category identifiers of each target node.

[0106] The association relationship of the parent category identifier of each target node includes the up-pushing and down-pushing relationship between the target node and other nodes on the parent category identifier.

[0107] Specifically, the computer device performs batch queries on the target data corresponding to the parent category identifiers of each target node according to the batch query instructions determined in the aforementioned steps, and sorts and outputs the queried target data according to their corresponding association relationships (upward and downward push) with the parent category identifiers of each target node.

[0108] In this embodiment, when the number of parent category identifiers of the target node is at least two, a batch query instruction is generated based on the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the parent category identifier of each target node. A batch query is performed on the node association list according to the batch query instruction to obtain the corresponding target node information, and each target data is determined based on the information of each target node. The target data is sorted and output based on the association relationship of the parent category identifier of each target node, thereby enabling batch query of multiple target data based on the current node information, effectively improving data query efficiency.

[0109] In one embodiment, as shown in FIG5 , querying the node association list based on the query instruction to obtain target node information corresponding to the target node parent category identifier, and determining and outputting target data based on the target node information include:

[0110] Step S502: Determine a first query range in the node association list according to the current parent category identifier and the current child category identifier.

[0111] Specifically, the computer device determines the corresponding column where the current node information is located in the node association list according to the current parent category identifier corresponding to the current node information, and then determines the row where the current node information is located in the corresponding column according to the current child category identifier, and determines the first query range by the corresponding column and the row where the current node information is located.

[0112] Step S504: determining a second query range within the first query range according to the adjacent node subcategory identifiers.

[0113] The second query range is a subset of the first query range.

[0114] Specifically, the computer device determines the first query range according to the aforementioned steps, and then determines the second query range in the first query range according to the adjacent node subcategory identifier.

[0115] Step S506 : determining corresponding target node information within the second query range according to the target node parent category identifier, and determining and outputting target data according to the target node information.

[0116] In this embodiment, by determining the first query range in the node association list according to the current parent category identifier and the current subcategory identifier, determining the second query range within the first query range according to the adjacent node subcategory identifier, determining the corresponding target node information within the second query range according to the target node parent category identifier, and determining and outputting the target data based on the target node information, it is possible to quickly query the target node information based on the current node information and the target node parent category identifier, and then query the corresponding target data, effectively narrowing the query range, achieving targeted regional query effects, and effectively improving data query efficiency.

[0117] In one embodiment, as shown in FIG6 , a method for generating a data list is provided. The method is described by taking the computer device 102 in FIG1 as an example, and includes the following steps:

[0118] Step S602: Obtain a data graph corresponding to the target data, and determine a target data node based on the data graph. The data graph includes at least two data nodes of different data categories and an association relationship between each data node.

[0119] Among them, the target data is the source data corresponding to the data list to be generated, the data map includes each data node corresponding to the target data and the association relationship and topological structure between each data node, and the data map includes at least two data nodes with different data categories.

[0120] Specifically, after the computer device obtains the data map corresponding to the target data, it arbitrarily determines a data node in the data map and uses it as the target data node.

[0121] Step S604: determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph.

[0122] The data category of each data node in the data graph includes a corresponding parent category identifier and a subcategory identifier. The parent category identifier characterizes the attribute characteristics of the target data of the corresponding data node. For example, the parent category identifier could be "sales order," "shipping notice," "sales delivery order," "accounts receivable," etc. The subcategory identifier identifies the specific target data location information under the parent category identifier.

[0123] Specifically, the computer device determines the number of columns (column dimensions) of the data list to be generated according to the data category of each data node in the data graph, and the number of data categories is equal to the number of column dimensions of the list.

[0124] Step S606: traverse each node path of the data graph based on the association relationship between each data node. The node path is determined by taking the target data node as the starting point and the corresponding data node as the end point.

[0125] The node information corresponding to each data node includes the adjacent node information associated with the data node itself.

[0126] Specifically, the computer device determines each node path between each data node based on the association relationship between each data node in the data graph.

[0127] Step S608 : The data nodes on each node path are stored in a list position that matches the data category corresponding to the list column dimension based on the corresponding data category, and each node path corresponds to the same row.

[0128] Step S610, until all node paths in the data graph are stored, a target data list corresponding to the data graph is generated.

[0129] In this embodiment, by obtaining the data map corresponding to the target data, and determining the target data node according to the data map, the corresponding list column dimension is determined based on the total number of data categories of each data node in the data map, and each node path of the data map is traversed based on the association relationship between each data node, the data nodes on each node path are stored in the list position matching the data category corresponding to the list column dimension based on the corresponding data category, and the node information on each node path corresponds to the same row of the data list until all node paths in the data map are stored, and a target data list corresponding to the data map is generated, thereby realizing the generation of a data list of a corresponding format for each data node corresponding to the target data according to the association relationship (node ​​path) between the data nodes and the data node type, making the data query operation based on this data list more convenient and effectively improving the rationality of data storage.

[0130] In one embodiment, as shown in FIG7 , the data nodes on each node path are stored in a list position that matches the data category corresponding to the list column dimension based on the corresponding data category, including:

[0131] Step S702: query the data category corresponding to each data node on each node path in sequence.

[0132] Specifically, the computer device traverses each data node on each node path in the data graph in sequence, starting from the target data node and the corresponding data node as the end point, and queries the data category of each node in sequence in a forward and backward order.

[0133] Step S704, when the data category of the current data node does not match the data category corresponding to the list column dimension, add the corresponding target data category in the target list column dimension according to the data category of the current data node, and store the current data node in the list position corresponding to the target data category.

[0134] Specifically, the computer device queries the data category of the current data node on the currently traversed node path. When the data category of the current data node does not match the data category corresponding to the list column dimension, the corresponding target data category is added to the target list column dimension according to the data category of the current data node, and the current data node is stored in the list position corresponding to the target data category; when the data category of the current data node matches the data category corresponding to the list column dimension, the current data node is stored in the row and column position corresponding to the list column dimension.

[0135] In this embodiment, by querying the data category corresponding to each data node on each node path in turn, when the data category of the current data node does not match the data category corresponding to the list column dimension, the corresponding target data category is added to the target list column dimension according to the data category of the current data node, and the current data node is stored in the list position corresponding to the target data category, so that in the process of traversing each node path, each column dimension of the data list is generated in turn, and the corresponding data node is stored in the corresponding position of the column dimension of the corresponding data list, so as to quickly generate a data list in the corresponding storage format, effectively improving the efficiency of data list generation.

[0136] This application also provides an application scenario, which applies the above-mentioned data query method, and the method is applied to the scenario of querying enterprise business documents. Specifically, the application of the data query method in this application scenario is as follows:

[0137] (1) Create a document association list

[0138] The computer device reads the data map corresponding to the target source data, determines the target data node in the data map, takes the target data node as the root node of the data map, takes the parent category identifier of the root node as the category attribute of the first column of the document association list to be generated, and determines a corresponding node in the data map as the end point of the map. With the target data node as the starting point, traverses each node path from the starting point to the end point, and then queries the data category (parent category identifier) ​​corresponding to the node on each path in turn, and judges whether the parent category identifier of the current node can match the attributes of each column in the document association list. When the parent category identifier of the current node matches the attributes of each column in the document association list, the generated document is generated. When the column attributes match, the current node information corresponding to the current node is stored in the corresponding column and row of the document association list, and it is ensured that all nodes on each node path are stored in the same row. When the parent category identifier of the current node does not match the column attributes of the document association list, the corresponding column attributes are created in the document association list according to the current parent category identifier of the current node, and the current node information is stored in the corresponding position of the newly added column. Similarly, each node on the entire data map is traversed according to the corresponding paths and data categories, thereby generating a document association list corresponding to the target source data. The specific process is shown in Figure 10.

[0139] For example, suppose there is a node path: Document A → Document B → Document C. In order to record their relationship, it is necessary to identify this document. The information identifying this document can be regarded as a node, and each node is stored as a row of data. If the data of node A is now known and node C needs to be found, node B must be found first, and then node C can be found based on the data of node B. If there is a very long route map, or there are different routes to reach node C, and the position of node C is also uncertain, the entire route needs to be traversed. The number of column dimensions of the row-to-column output of this application is fixed, and node C is found directly based on node A. The example is as follows:

[0140] Example 1: Assume that the original node association list of the target source data contains a node path: Node A → Node B → Node C, as shown in Table 1 below:

[0141] Table 1

[0142] Convert the row-based data storage method to a column-based document association list, as shown in Table 2 below:

[0143] Table 2

[0144] Example 2: Assume that the original node association list of the target source data contains the node paths: Node A → Node B1 and Node B2 → Node C, as shown in Table 3 below:

[0145] Table 3

[0146] Convert the row-based data storage method to a column-based document association list, as shown in Table 4 below:

[0147] Table 4

[0148] (2) Query business documents of enterprises:

[0149] The computer device receives a data query start instruction, obtains a document association list corresponding to all business documents, obtains current node information corresponding to the current business document in the database based on the document information corresponding to the currently known business document, then obtains adjacent node information directly associated with the current node information based on the current node information, locks a first query range in the document association list based on the current parent category identifier and subcategory identifier in the current node information, then determines a second query range based on the subcategory identifier in the adjacent node information, where the second query range is included in the first query range, and finally locks the target node information within the second query range based on the target node parent category identifier of the target node information corresponding to the target business document to be queried. Then, the target business document is determined based on the guidance of the target node information, and the target business document is output and displayed, completing the entire business document query operation. For example, as shown in FIG11 , when the parent category identifier of the current node is “sales order”, the target business documents with the target node parent category identifiers of “shipping notice”, “sales delivery order”, and “account receivable order” shown in FIG11 are queried and output based on the first column “sales order” in FIG11 .

[0150] In this embodiment, by responding to the start instruction to obtain the current node information, the target node parent category identifier and the document association list, the adjacent node information corresponding to the current node information is determined according to the association relationship between the current node information and other node information in the data map, and then a query instruction is generated based on the current node category identifier of the current node information and the adjacent node subcategory identifier of its adjacent node and the target node parent category identifier. According to this query instruction, the query range of the target node subcategory identifier in the document association list can be effectively narrowed, and the target data can be quickly queried, thereby effectively improving the data query efficiency.

[0151] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0152] In one embodiment, as shown in FIG8 , a data query device is provided. The device may be a software module or a hardware module, or a combination of both, as part of a computer device. The device specifically includes: an acquisition module 802 , a query instruction generation module 804 , and a query module 806 , wherein:

[0153] An acquisition module 802 is configured to acquire, in response to a start instruction, current node information, a target node parent category identifier, and a node association list. The current node information includes the current node category identifier and its associations with other nodes. The current node category identifier includes the current parent category identifier and the current child category identifier. The node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information.

[0154] The query instruction generation module 804 is configured to determine the adjacent node information corresponding to the current node information based on the association relationship, where the adjacent node information is directly associated with the current node information; and to generate a query instruction based on the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the parent category identifier of the target node.

[0155] The query module 806 is configured to query the node association list based on the query instruction, obtain target node information corresponding to the target node parent category identifier, and determine and output target data according to the target node information.

[0156] In one embodiment, the query instruction generation module 804 is also used to determine the association path between the current node corresponding to the current node information and each associated node in the data graph based on the association relationship; when there are no other nodes on the association path, the associated node is determined to be the adjacent node corresponding to the current node information, and the adjacent node information corresponding to the adjacent node is obtained.

[0157] In one embodiment, the query instruction generation module 804 is also used to generate batch query instructions based on the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the parent category identifier of each target node when the number of parent category identifiers of the target node is at least two; perform batch queries on the node association list according to the batch query instructions to obtain the corresponding target node information, and determine the target data based on the target node information; sort and output the target data based on the association relationship of the parent category identifiers of each target node.

[0158] In one embodiment, the query module 806 is also used to determine a first query range in the node association list based on the current parent category identifier and the current child category identifier; determine a second query range within the first query range based on the adjacent node child category identifier; determine the corresponding target node information within the second query range based on the target node parent category identifier, and determine and output the target data based on the target node information.

[0159] The above-mentioned data query device obtains the current node information, the target node parent category identifier and the node association list in response to the startup instruction, determines the adjacent node information corresponding to the current node information based on the association relationship between the current node information and other node information in the data map, and then generates a query instruction based on the current node category identifier of the current node information and the adjacent node subcategory identifier of its adjacent node and the target node parent category identifier. According to this query instruction, the query range of the target node subcategory identifier in the node association list can be effectively narrowed, and the target data can be quickly queried, thereby effectively improving the data query efficiency.

[0160] For the specific definition of the data query device, please refer to the definition of the data query method above and will not be repeated here. Each module in the above-mentioned data query device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0161] In one embodiment, as shown in FIG9 , a data list generating device is provided. The device may be a software module or a hardware module, or a combination of both, and may be formed as part of a computer device. The device specifically includes: a data acquisition module 902 , a data traversal module 904 , and a list generating module 906 , wherein:

[0162] Data acquisition module 902, used to obtain a data map corresponding to the target data and determine the target data node based on the data map. The data map includes at least two data nodes of different data categories and the association relationship between the data nodes;

[0163] The data traversal module 904 is configured to determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph; traverse each node path of the data graph based on the association relationship between each data node, where the node path is determined from the target data node as the starting point and the corresponding data node as the end point;

[0164] The list generation module 906 is used to store the data nodes on each node path into a list position that matches the data category corresponding to the list column dimension based on the corresponding data category, and each node path corresponds to the same row; until all node paths in the data map are stored, a target data list corresponding to the data map is generated.

[0165] In one embodiment, the list generation module 906 is also used to query the data category corresponding to each data node on each node path in turn; when the data category of the current data node does not match the data category corresponding to the list column dimension, the corresponding target data category is added to the target list column dimension according to the data category of the current data node, and the current data node is stored in the list position corresponding to the target data category.

[0166] The above-mentioned data list generating device obtains the data map corresponding to the target data, determines the target data node according to the data map, determines the corresponding list column dimension based on the total number of data categories of each data node in the data map, traverses each node path of the data map based on the association relationship between each data node, and stores the data nodes on each node path in the list position matching the data category corresponding to the list column dimension based on the corresponding data category, and the node information on each node path corresponds to the same row of the data list until the storage of each node path in the data map is completed, and generates the target data list corresponding to the data map, thereby realizing the generation of a data list of the corresponding format for each data node corresponding to the target data according to the association relationship (node ​​path) between the data nodes and the data node type, making the data query operation based on this data list more convenient and effectively improving the rationality of data storage.

[0167] The specific definition of the data list generation device can be found in the definition of the data list generation method above and will not be repeated here. The various modules in the above-mentioned data list generation device can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0168] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in Figure 12. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication, and the wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near field communication), or other technologies. When the computer program is executed by the processor, a data query method is implemented. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or may be buttons, a trackball, or a touchpad provided on the computer device housing, or may be an external keyboard, touchpad, or mouse.

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

[0170] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0171] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0172] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.

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

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

[0175] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A data query method, the method comprising: In response to the start instruction, the current node information, the target node parent category identifier and the node association list are obtained, wherein the current node information includes the current node category identifier and the association relationship with other nodes, the current node category identifier includes the current parent category identifier and the current child category identifier, and the node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information; Determine, according to the association relationship, the adjacent node information corresponding to the current node information, wherein the adjacent node information is directly associated with the current node information; Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier; as well as The node association list is queried based on the query instruction to obtain target node information corresponding to the target node parent category identifier, and target data is determined and output according to the target node information.

2. The method according to claim 1, wherein: The determining, according to the association relationship, the adjacent node information corresponding to the current node information includes: Determine, according to the association relationship, an association path between the current node corresponding to the current node information and each associated node in the data graph; and When no other nodes exist on the associated path, the associated node is determined to be an adjacent node corresponding to the current node information, and adjacent node information corresponding to the adjacent node is acquired.

3. The method according to claim 1 or 2, wherein: The generating of the query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier includes: When the number of parent category identifiers of the target nodes is at least two, a batch query instruction is generated according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifiers corresponding to the adjacent node information, and the parent category identifiers of the respective target nodes; The node association list is queried based on the query instruction to obtain target node information corresponding to the parent category identifier of the target node, and target data is determined and output according to the target node information, including: Performing batch query on the node association list according to the batch query instruction to obtain each corresponding target node information, and determining each target data according to each target node information; and The target data are sorted and output based on the association relationship between the parent category identifiers of the target nodes.

4. The method according to any one of claims 1 to 3, wherein: The querying of the node association list based on the query instruction to obtain the target node information corresponding to the parent category identifier of the target node, and determining and outputting the target data according to the target node information includes: Determine a first query in the node association list according to the current parent category identifier and the current child category identifier. scope; Determining a second query range within the first query range according to the adjacent node subcategory identifier; and The corresponding target node information is determined within the second query range according to the target node parent category identifier, and the target data is determined and output according to the target node information.

5. A method for generating a data list, the method comprising: Obtain a data map corresponding to the target data, and determine the target data node according to the data map, wherein the data map includes at least two data nodes of different data categories and an association relationship between the data nodes; Determine the corresponding list column dimension based on the total number of data categories of each data node in the data graph; Traversing each node path of the data graph based on the association relationship between the data nodes, the node path is determined by taking the target data node as a starting point and taking the corresponding data node as an end point; storing the data nodes on each node path in a list position matching the data category corresponding to the column dimension of the list based on the corresponding data category, wherein each node path corresponds to the same row; as well as Until all node paths in the data graph are stored, a target data list corresponding to the data graph is generated.

6. The method according to claim 5, wherein: The step of storing the data nodes on each node path into a list position matching the data category corresponding to the list column dimension based on the corresponding data category includes: querying the data category corresponding to each data node on each node path in turn; and When the data category of the current data node does not match the data category corresponding to the list column dimension, the corresponding target data category is added to the target list column dimension according to the data category of the current data node, and the current data node is stored in the list position corresponding to the target data category.

7. A data query device, comprising: An acquisition module, configured to acquire current node information, a target node parent category identifier, and a node association list in response to a start instruction, wherein the current node information includes a current node category identifier and an association relationship with other nodes, the current node category identifier includes a current parent category identifier and a current child category identifier, and the node association list is generated by traversing each node path and the node category identifier of each node in the data graph corresponding to the current node information; A query instruction generating module, used to determine the adjacent node information corresponding to the current node information according to the association relationship, wherein the adjacent node information is directly associated with the current node information; Generate a query instruction according to the current parent category identifier and the current subcategory identifier, the adjacent node subcategory identifier corresponding to the adjacent node information, and the target node parent category identifier; as well as The query module is used to query the node association list based on the query instruction, obtain the target node information corresponding to the parent category identifier of the target node, and determine and output the target data according to the target node information.

8. A data list generating device, comprising: The data acquisition module is used to obtain the data map corresponding to the target data and determine the target data node according to the data map. The data map includes at least two data nodes with different data categories and the relationship between each data node. relation; A data traversal module, used to determine the corresponding list column dimension based on the total number of data categories of each data node in the data map; traverse each node path of the data map based on the association relationship between the data nodes, the node path is determined with the target data node as the starting point and the corresponding data node as the end point; as well as A list generation module, used for storing the data nodes on each node path into a list position matching the data category corresponding to the column dimension of the list based on the corresponding data category, wherein each node path corresponds to the same row; Until all node paths in the data graph are stored, a target data list corresponding to the data graph is generated.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 4 or 5 to 6 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 or 5 to 6 are implemented.

Citation Information

Patent Citations

  • System and method for dynamically querying inheritance data of version

    CN102402626A

  • Data search matching method and device, computer equipment and storage medium

    CN111177405A

  • Data query method and device based on knowledge graph and storage medium

    CN111930967A

  • Data query method and device, computer equipment and computer readable storage medium

    CN116340354A

  • Lifecycle reference partitioning for database objects

    US20150186447A1