Data query method and distributed data network

By building a hierarchical query network and using intermediate data nodes to query and filter locally, the problem of low data query efficiency under the distributed data architecture is solved, and efficient and low-cost data query is achieved.

CN120336402AActive Publication Date: 2025-07-18BEIJING LINX SOFTWARE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510503257.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-10-21
Filing Date
2025-04-21
Publication Date
2025-07-18
Estimated Expiration
2045-04-21

AI Technical Summary

Technical Problem

Under the distributed data architecture, due to the high discreteness and volatility of the data nodes, the central node needs to summarize the data of each data node for unified screening and paging processing, resulting in low data query efficiency, high processing pressure for central nodes, and high query delays for nodes with far-reaching geographical locations.

Method used

Build a hierarchical query network, pass data query parameters at the hierarchy, so that intermediate data nodes can query and filter data locally, and the central node only processes the filter results to avoid the transmission and processing of large amounts of data in a centralized manner.

Benefits of technology

It reduces the cost of data query, improves query efficiency, avoids device updates and additional equipment, and ensures the efficiency and accuracy of data query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336402A_ABST
    Figure CN120336402A_ABST
Patent Text Reader

Abstract

The invention discloses a data query method and a distributed data network. The distributed data network comprises a central node and a hierarchical query network formed by data nodes, the hierarchical query network comprises at least one intermediate node layer arranged hierarchically and a tail end data node connected with the intermediate node layer at the tail end, and the intermediate node layer comprises a plurality of intermediate data nodes of the same hierarchy. The method comprises the following steps: after a central node generates data query parameters according to a single-page data volume carried by a data request sent by a client, the data query parameters are sent to each intermediate data node and an end data node in a hierarchical transmission manner. And the intermediate data node screens the response data of the local node and the child node, sends a screening result to the father node until the central node receives the screening result sent by the child node, determines to-be-displayed paging data based on the single-page data size and the screening result, and feeds back the to-be-displayed paging data to the client. By adopting the method, the data query cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of a prior Chinese application titled "Data Query Method and Distributed Data Network" with the application number 202411471346X, which was filed with the National Intellectual Property Administration on October 21, 2024. Technical Field

[0002] This application relates to the field of big data, and particularly to a data query method and a distributed data network. Background Art

[0003] With the development of digital technology, applications have gradually adopted a distributed computing architecture. The distributed computing architecture has advantages such as scalability and high efficiency. Especially in edge computing scenarios, multiple server nodes form a node domain, and each node domain is responsible for independent data processing and storage, effectively improving the processing efficiency of local data within each node domain.

[0004] However, in a distributed architecture, the geographical locations (such as provinces, cities, counties, towns, regions, etc.) and environments (such as coastal areas, plateaus, typhoons, etc.) of different service nodes (i.e., data nodes) are different, resulting in a high degree of discreteness between the data of different data nodes. The discreteness of the data of each data node can be reflected in the randomness of the data volume and time distribution: for example, for the same type of data, within the same time period, different data nodes generate different data and data volumes due to different geographical locations, environments, etc., that is, the data of different data nodes is discrete; for the same data node, the same type of data may also generate different data and data volumes due to different environmental factors such as climate and light at different times, that is, the data of the same data node has volatility.

[0005] Therefore, due to the high degree of discreteness between the data of each data node in a distributed data architecture and the volatility of the local data of the data node, there is a problem of difficult data query when querying data in a distributed data architecture. Specifically, it can be reflected in the following aspects: For the same query condition, the number of data that meet the query condition in different data nodes is different. For example, among the data of data node A, there are 30 data that meet the query condition, among the data of data node B, there are 5000 data that meet the query condition, and among the data of data node C, there are 400 data that meet the query condition. At this time, using the traditional method, after summarizing and transmitting the data that meet the query condition in all data nodes to the central node, and then the central node performs unified sorting, filtering, and paging display processing, it will result in a large amount of data transmitted in the distributed architecture, affecting the data query efficiency; at the same time, it will cause a large amount of data to be processed by the central node, affecting the performance of the central node, and further affecting the efficiency and accuracy of data query.

[0006] If a small amount of data required for querying paged data is reduced by restricting the query conditions to reduce the amount of query results of each data node, it is difficult to determine the query conditions applicable to all data nodes because of the large differences in the amount of data of different data nodes for the same query condition and the volatility of the local data of each data node.

[0007] For different query times, due to the randomness (volatility) of the local data of the data nodes in the time distribution, there are differences in the data query results under the distributed architecture at different query moments.

[0008] In addition, for data nodes that are geographically far from the central node, there is also a problem of high query latency during data query.

[0009] It can be understood that the discrete data targeted by this application refers to the data generated by different data nodes in different geographical locations and environments, rather than the data in the distributed data architecture where the data generated by the same data node is discretely stored in multiple other data nodes according to the load balancing technology; the data query method of this application is not an index query method for discretely stored data.

[0010] In summary, the technical problem targeted by this application is the high discreteness between the data of each data node under the distributed architecture, which causes the central node to aggregate the data that meets the query conditions in each data node and perform unified screening and paging processing on the large amount of query result data corresponding to all data nodes, resulting in a large data processing pressure on the central node and affecting the data query efficiency of the distributed architecture. Summary of the Invention

[0011] In view of the above defects or deficiencies in the prior art, it is desired to provide a data query method and a distributed data network that can reduce the data query cost of the application.

[0012] In a first aspect, this application provides a method. Applied to a distributed data network, the distributed data network includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with a hierarchical setting and end data nodes connected to the last intermediate node layer. The intermediate node layer includes multiple intermediate data nodes at the same level. The intermediate node layer closest to the central node is used to interact with the central node, the intermediate node layer closest to the end data nodes is used to interact with the end data nodes, and the remaining intermediate node layers are used to interact with the upper intermediate node layer or the lower intermediate node layer. The method includes: The central node receives a data request from the client, generates data query parameters according to the amount of data per page carried in the data request, and sends the data query parameters to the data nodes; the amount of data characterized by the data query parameters is greater than the amount of data characterized by the amount of data per page; the data request also includes a query time. The data nodes are used to query the data local to the data nodes according to the data query parameters to obtain local response data; among them, The intermediate data nodes send the data query parameters to the child nodes until the end data node receives the data query parameters, and receive the response data sent by the child nodes; the response data is obtained according to the data query parameters. The intermediate data nodes sort and filter the local response data of the intermediate data nodes and the response data of the received child nodes according to the data generation time from the nearest to the query time in the order from near to far, and send the filtering results to the parent nodes of the intermediate data nodes until the central node receives the filtering results sent by the child nodes of the central node; the amount of data corresponding to the filtering results is greater than the amount of data per page. The central node determines the paged data to be displayed based on the amount of data per page and the received filtering results, and sends a response message to the client, and the response message carries the paged data to be displayed.

[0013] Combined with the first aspect, in a possible implementation, the data request of the client further includes a data query condition; the data query parameters include a target data volume, a data query condition, and a query time; the target data volume is greater than the amount of data per page.

[0014] Combined with the first aspect, in a possible implementation, the data request of the client further includes a paging type; the paging type includes at least one of the first page, the next page, the previous page, and the page number of the paged data to be displayed.

[0015] Combined with the first aspect, in a possible implementation, the central node determines the paged data to be displayed based on the amount of data per page and the received filtering results, including: splitting all the filtering results according to the amount of data per page, determining the number of page numbers for paged display of all the filtering results, and the data corresponding to each page; sending the data and the number of page numbers of the first page to the client.

[0016] Combined with the first aspect, in a possible implementation, the central node determines the paged data to be displayed based on the amount of data per page and the received filtering results, including: splitting all the filtering results according to the amount of data per page, determining the number of page numbers for paged display of all the filtering results, and the data corresponding to each page; determining the paged data to be displayed according to the paging type and the currently displayed page, and obtaining the data of the paged data to be displayed according to the data corresponding to each page.

[0017] In combination with the first aspect, in a possible implementation, the central node determines the paged data to be displayed based on the single-page data volume and the received filtering results, including: sorting the filtering results in the order from the data generation time of each filtering result closest to the query time to the farthest; selecting the first N data in the sorted results as the paged data to be displayed according to the single-page data volume; N is the quantity represented by the single-page data volume.

[0018] In combination with the first aspect, in a possible implementation, the data query parameter further includes a query time condition, and the query time condition is used to limit the display data of the page corresponding to the paging type based on the data generation time.

[0019] In combination with the first aspect, in a possible implementation, when the paging type is the first page, the query time condition is that the data generation time is less than the query time; when the paging type is the next page, the query time condition is that the data generation time is less than the data generation time of the first target data in the display data of the current page; when the paging type is the previous page, the query time condition is that the data generation time is greater than the data generation time of the second target data in the display data of the current page; the first target data is the first display data of the current page after sorting the display data of each current page in the order from the data generation time closest to the query time to the farthest; the second target data is the first display data of the current page after sorting the display data of each current page in the order from the data generation time farthest from the query time to the closest.

[0020] In combination with the first aspect, in a possible implementation, the intermediate data node sorts and filters the response data of the intermediate data node locally and the response data of the received child nodes in the order from the data generation time closest to the query time to the farthest according to the data query parameter, including: querying the data that meets the data query condition and whose data generation time meets the query time condition in the local data of the intermediate data node to obtain the response data of the intermediate data node locally; sorting the response data of the intermediate data node locally and the response data of the received child nodes in the order from the data generation time closest to the query time to the farthest; selecting the first M data from the sorted results according to the target data volume and sending them to the parent node of the intermediate data node; M is the quantity represented by the target data volume, and M is an integer greater than N.

[0021] In a second aspect, the present application also provides a distributed data network. The distributed data network includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with hierarchical settings and end data nodes connected to the last intermediate node layer. The intermediate node layer includes a plurality of intermediate data nodes at the same level. The intermediate node layer closest to the central node is used to interact with the central node, and the intermediate node layer closest to the end data nodes is used to interact with the end data nodes. Each of the remaining intermediate node layers is used to interact with the upper or lower intermediate node layer. The central node is configured to receive a data request from a client, generate a data query parameter according to the amount of single-page data carried in the data request, and send the data query parameter to the data nodes; the amount of data represented by the data query parameter is greater than the amount of single-page data; the data request further includes a query time. The data nodes are configured to query the data local to the data nodes according to the data query parameter to obtain local response data; wherein, The intermediate data nodes are configured to send the data query parameter to the child nodes until the end data nodes receive the data query parameter, and receive the response data sent by the child nodes; sort and filter the local response data of the intermediate data nodes and the response data received from the child nodes according to the time distance from the data generation time to the query time in descending order, and send the filtering result to the parent node of the intermediate data node until the central node receives the filtering result sent by the child node of the central node; the amount of data corresponding to the filtering result is greater than the amount of single-page data; the response data is obtained according to the data query parameter. The central node is further configured to determine the paged data to be displayed based on the amount of single-page data and the received filtering result, and send a response message to the client, and the response message carries the paged data to be displayed.

[0022] The embodiments of the present application provide a data query method and a distributed data network. The distributed data network includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with hierarchical settings and end data nodes connected to the end intermediate node layer. The intermediate node layer includes multiple intermediate data nodes at the same level. The intermediate node layer closest to the central node is used to interact with the central node, and the intermediate node layer closest to the end data nodes is used to interact with the end data nodes. The remaining intermediate node layers are used to interact with the upper or lower intermediate node layer. After the central node generates data query parameters according to the single-page data volume carried in the data request sent by the client, the data query parameters are sent to the intermediate data nodes and end data nodes of each intermediate node layer in a hierarchical transmission manner. The data nodes are used to query the local data of the data nodes according to the data query parameters to obtain local response data. The intermediate data nodes query the local data according to the data query parameters to obtain local response data, and at the same time receive the response data sent by the child nodes. Then, the intermediate data nodes screen the local response data and the received response data of the child nodes, and send the screening results to the parent nodes of the intermediate data nodes. The intermediate data nodes at each level sequentially execute the above query and screening processes until the central node receives the screening results sent by the child nodes of the central node. Finally, the central node determines the paged data to be displayed based on the single-page data volume and the received screening results, and sends a response message carrying the paged data to be displayed to the client. The data query method provided by the embodiments of the present application constructs a distributed data network, hierarchically transmits the response data locally queried by each node in response to the user's data request to the central node, and screens the response data of at least one node during each level of transmission, distributing the transmission and screening processing of a large amount of data on the intermediate data nodes at each level, thereby avoiding the centralized transmission and processing of a large amount of data, ensuring the data query efficiency; the amount of data transmitted to the central node after hierarchical screening processing is small, avoiding the centralized processing of a large amount of data on the central node, and further avoiding the update and upgrade of equipment and the addition of additional equipment, and realizing the efficient query of data at the software level, effectively reducing the data query cost. Description of the Drawings

[0023] By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, objects, and advantages of the present application will become more apparent: Figure 1 It is an architecture diagram of a distributed data network in an embodiment; Figure 2 It is another architecture diagram of a distributed data network in an embodiment; Figure 3 It is a flowchart of a data query method in an embodiment; Figure 4 Schematic diagram of paged display for the data query method in an embodiment; Figure 5 Another schematic diagram of paged display for the data query method in an embodiment; Figure 6 Another schematic flow diagram for the data query method in an embodiment; Figure 7 Another schematic flow diagram for the data query method in an embodiment; Figure 8 Another schematic flow diagram for the data query method in an embodiment; Figure 9 Another schematic flow diagram for the data query method in an embodiment. Detailed implementation manners

[0024] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. In addition, it should be noted that for the convenience of description, only the parts related to the invention are shown in the drawings.

[0025] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments. In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe the specific order of the objects.

[0026] With the development of digital technology, applications gradually adopt a distributed computing architecture. The distributed computing architecture has advantages such as scalability and high efficiency. Especially in the edge computing scenario, multiple server nodes form a node domain, and each node domain is responsible for independent data processing and storage, effectively improving the processing efficiency of local data within each node domain. However, due to the highly discrete characteristics of data, the distributed architecture also has problems such as difficult data search, query, and analysis.

[0027] In the traditional technology, data monitoring components (such as Prometheus, exporter, etc.) are often used to centrally collect and store data of discrete nodes, and then queries and analyses are performed based on the collected data. However, due to the huge amount of data collected in this way, the existing system architecture needs to be overall transformed, additional hardware devices such as storage devices need to be added, and servers, network infrastructure, etc. also need to be updated and upgraded to adapt to the analytical processing capabilities of large amounts of data, resulting in a relatively high application cost.

[0028] In the scenario of paging query, after centrally collecting data of discrete nodes (i.e., data nodes), a data query method that performs unified sorting and paging processing on a central server (i.e., the central node) has problems of slow response and network congestion due to the centralized transmission, overall sorting, searching, etc. of a large amount of data. Moreover, the processing of sorting, searching, etc. of all data is concentrated on the central server, resulting in a relatively large computing pressure on the central server and a problem of waste of computing resources.

[0029] Based on this, the embodiments of the present application provide a data query method and a distributed data network, which can realize efficient data query at the software level, avoid the update and upgrade of devices and the addition of extra devices, and thus effectively reduce the data query cost.

[0030] As Figure 1 shown, the distributed data network includes a central node 10 and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer 20 arranged hierarchically and end data nodes 30 connected to the last intermediate node layer. Each intermediate node layer 20 includes at least one intermediate data node 21. Among them, the intermediate node layer 20 closest to the central node 10 is used to interact with the central node 10, the intermediate node layer 20 closest to the end data nodes 30 is used to interact with the end data nodes 30, and the remaining intermediate node layers 20 are used to interact with the previous intermediate node layer or the next intermediate node layer.

[0031] The construction process of this distributed data network can be as follows: The central node 10 can first construct a hierarchical query network according to the identifiers of each data node. Specifically, all data nodes or some data nodes of the application can be grouped first, and a data node is selected as the intermediate data node 21 in each group of data nodes. Then, the multiple intermediate data nodes 21 selected from multiple groups of data nodes form an intermediate node layer 20 corresponding to one level (for example, level 1); Among them, the relevant node data of the intermediate data node 21 in an intermediate node layer 20 can be recorded in a list, and the list can include information such as the identification and address of the node. For example, it can be recorded as the following fields: [{node_name:node1-1, node_ip:192.101.1.1}, {node_name:node1-2, node_ip:192.101.1.2}, {node_name:node2-5, node_ip:192.102.1.5}, {node_name:node3-1, node_ip:192.103.1.1}, …, {node_name:node976-2057, node_ip:202.101.200.57].

[0032] Then, for each group of data nodes, the remaining data nodes in the group except the intermediate data node 21 are grouped again. For each group of data nodes after the re-grouping, one data node is selected as the intermediate data node 21 (which can be called the level-2 node) of the group of data nodes, and the remaining data nodes are grouped again until each group of data nodes after the re-grouping includes only one data node, that is, the terminal data node 30, then the hierarchical query construction is completed, and the central node 10 and this hierarchical query network form a distributed data network.

[0033] The following takes the application including 1000 data nodes as an example for illustration: The central node 10 first divides the 1000 data nodes into 10 groups, and each group can include 100 data nodes (the number of data nodes in each group can also be different). For each group of data nodes, 1 is selected from the 100 data nodes as the intermediate data node 21. Then the 10 intermediate data nodes 21 (such as 1-1, 1-2, …, 1-10) form a node group 20, which can be called the level-1 node group 20, and the intermediate data node 21 in the level-1 node group 20 can be called the level-1 intermediate data node; then, for each group of data nodes, the remaining 99 data nodes except the intermediate data node 21 are grouped again, and can be divided into 10 groups, among which 9 groups include 10 data nodes, and the last group includes 9 data nodes; for each group of data nodes, 1 is selected as the intermediate data node 21, then the 10 intermediate data nodes 21 (such as 2-1-1, 2-1-2, …, 2-1-10) form a level-2 node group 20, and the intermediate data node 21 in the level-2 node group can be called the level-2 intermediate data node; finally, for each group of data nodes, the remaining 9 or 8 data nodes except the intermediate data node 21 are grouped again, and can be divided into 9 groups or 8 groups, and each group includes 1 data node, that is, the terminal data node 30, and the distributed data network construction is completed.

[0034] It can be understood that the intermediate data node 21 has a parent node and child nodes, and the terminal data node 30 only has a parent node. The intermediate data node 21 and the terminal data node 30 constitute all or part of the data nodes of the application.

[0035] It should be noted that for the grouping identifier a-b-c of the intermediate data node, where a represents the grouping level of the intermediate data node 21, b represents the serial number of the parent node of the intermediate data node 21 in the node group 20 after grouping, and c represents the serial number of the intermediate data node in the node group 20 after grouping.

[0036] In a possible implementation, as Figure 2 shown, the central node 10 can be the management platform of the application and interact with the client. The central node 10 can build a distributed data network based on some data nodes of the application. For example, data nodes such as node2-5, node2-7, node2-8, node2-9, node10-72, node976-2058 do not participate in the construction of the distributed data network. When the central node 10 groups the data nodes, it can group them based on the geographical location of the nodes. For example, nodes in the same region are grouped into one group, or it can also group them based on other characteristics of the nodes. This application does not limit this. That is, the positions of different data nodes in the distributed data network are related to the geographical locations of the respective data nodes. For example, data nodes that are geographically far from the central node 10 have a relatively large difference in level from the central node 10 in the distributed data network, that is, the data transmission path is long, and they may be terminal data nodes 30, intermediate data nodes 21 that interact with the terminal data node 30, etc.

[0037] Regarding the problem of high data transmission delay for data nodes that are geographically far from the central node 10, a distributed data network can be built through model training: First, build an initial distributed data network. At this time, the initial distributed data network also includes the central node 10 and multiple data nodes. The multiple data nodes form a hierarchical query network. The hierarchical query network includes at least one intermediate node layer 20 with a hierarchical setting and terminal data nodes 30 connected to the last intermediate node layer. The intermediate node layer 20 includes multiple intermediate data nodes 21 at the same level. It's just that the positions of the current data nodes in the distributed data network are not determined yet.

[0038] Then, with the overall communication delay of the distributed data network being the lowest as the first goal and the communication delay between data nodes at adjacent levels (between intermediate data nodes at adjacent levels, or between an intermediate data node and a terminal data node at adjacent levels) being the lowest as the second goal, continuously adjust the positions of each data node in the initial distributed data network. It can be understood that the adjustment of the positions of data nodes in the distributed data network indicates changes in the types of each data node (intermediate data node or terminal data node), levels (which intermediate node layer it belongs to), the connection relationship between the central node and the intermediate data nodes, the connection relationships between intermediate data nodes, and the connection relationship between the intermediate data node and the terminal data node.

[0039] Calculate the communication delay of the adjusted initial distributed data network until the communication delay of the initial distributed data network reaches the first goal and the second goal, then stop adjusting the positions of the data nodes to obtain the distributed data network.

[0040] In addition, when the central node 10 groups the data nodes, it can construct the same number of threads according to the number of groups to enable multi-threaded data transmission simultaneously, improving the data query efficiency.

[0041] The distributed data network can be pre-constructed by the central node 10. After the central node 10 receives a data request sent by the client, it can directly perform data query based on the pre-constructed distributed network; or it can be constructed by the central node 10 after receiving the data request from the client, analyzing the data request, and selecting some data nodes based on the user's query requirements to improve the query accuracy.

[0042] Based on the above distributed data network, the data query method includes the steps as Figure 3 shown: Step 101: The central node 10 receives a data request from the client, generates a data query parameter according to the single-page data volume carried in the data request, and sends the data query parameter to the data node.

[0043] In the embodiment of the present application, data interaction can be carried out between the central node 10 in the distributed data network and the client. The central node 10 can receive a data request from the client, and the data request carries the single-page data volume, that is, the data volume displayed on a single page by the client. For example, if the client displays 20 pieces of data on a single page, then the single-page data volume is 20.

[0044] After receiving the data request, the central node 10 can analyze the data request, generate data query parameters according to the analysis result, and send the data query parameters to the intermediate data nodes 21, so that each intermediate data node 21 and the terminal data node 30 can query the data that meets the user data request instruction based on the data query parameters. Among them, the data request also includes the query time, that is, the time when the client generates the data request.

[0045] When the central node 10 sends the data query parameters, it can first send the data query parameters to the child nodes of the central node 10, that is, the first-level intermediate data nodes; then, the first-level intermediate data nodes send the data query parameters to their own child nodes, that is, the second-level intermediate data nodes, until the data query parameters are transmitted to the terminal data node 30 through the hierarchical sending method.

[0046] Among them, the single-page data volume can be manually set by the user on the client side, or determined by the client based on its own display parameters (such as screen size, font size, etc.).

[0047] Among them, the data volume represented by the data query parameters is greater than the single-page data volume. For example, the data volume represented by the data bureau query parameters can be 21, that is, after each data node (intermediate data node 21 or terminal data node 30) receives the data query parameters, it queries the local data of the data node according to the data query parameters to obtain the local response data. For example, 21 pieces of data that meet the user data request instruction can be obtained during the data query process. And for different types of data nodes (intermediate data nodes or terminal data nodes), their data processing methods are as follows: Step 102, the intermediate data node 21 sends the data query parameters to the child nodes until the terminal data node 30 receives the data query parameters and receives the response data sent by the child nodes.

[0048] In the embodiment of the present application, after the data query parameters are transmitted to the terminal data node 30, the terminal data node 30 can query in the local data according to the data query parameters to obtain multiple pieces of data that meet the user data request instruction, that is, obtain multiple pieces of data that meet the user's needs. Then, the terminal data node 30 can perform screening processing on the queried data based on the data volume represented by the data query parameters, and send the screened data to the parent node of the terminal data node 30, that is, the upper-level intermediate data node 21 of the terminal data node 30, so that the intermediate data node 21 receives the data sent by the child node, and this data is the response data of the terminal data node 30, that is, the data finally obtained after the terminal data node 30 responds to the data request of the client and queries in the local data according to the data query parameters.

[0049] It can be understood that the end data node 30 can first compare the amount of data queried with the amount of data represented by the data query parameter. If the amount of data queried does not reach the amount of data represented by the data query parameter, the queried data is the response data, and all the queried data is directly sent to the parent node; if the amount of data queried is greater than the amount of data represented by the data query parameter, the queried data is filtered until the amount of data after filtering reaches the amount of data represented by the data query parameter, and the filtered data is the response data, and the filtered data is sent to the parent node. That is, the amount of data sent by the end data node 30 to the upper intermediate data node 21 is less than or equal to the amount of data represented by the data query parameter.

[0050] For example, if the terminal data node 30 queries 15 pieces of data based on the data query parameter, all 15 pieces of data are sent to the parent node; if the terminal data node 30 queries 30 pieces of data based on the data query parameter, 21 pieces of data are screened out and sent to the parent node. That is, the amount of data sent by the terminal data node 30 to the upper intermediate data node 21 is in the range of 0 to 21.

[0051] Step 103, the intermediate data node 21 sorts and filters the local response data of the intermediate data node 21 and the response data received from the child node according to the data query parameters in the order of data generation time from near to far distance from the query time, and sends the filtering results to the parent node of the intermediate data node 21 until the central node 10 receives the filtering results sent by the child node of the central node 10.

[0052] In the embodiment of the present application, for the upper intermediate data node 21 of the terminal data node 30, according to the data query method of the above-mentioned terminal data node 30, the local data stored in the local database (for example, the relational database sqlite3) of the intermediate data node 21 is queried according to the data query parameters to obtain the local response data of the intermediate data node 21. Then, the intermediate data node 21 determines the local response data and the total data volume of the response data received from each terminal data node 30, and compares the total data volume with the data volume represented by the data query parameters. When the total data volume reaches the data volume represented by the data query parameters, all data are directly sent to the upper intermediate data node 21 of the intermediate data node 21; if the total data volume exceeds the data volume represented by the data query parameters, the local response data and the received response data are sorted in the order from the nearest to the farthest from the data generation time to the query time, and then the data volume represented by the query parameters is filtered to filter out multiple data with the top ranking, and the filtered data volume is equal to the data volume represented by the data query parameters, that is, greater than the single page data volume. Finally, the intermediate data node 21 sends the filtered data to the upper intermediate data node 21.

[0053] It can be understood that for each intermediate data node 21, after receiving the data query parameter, the local data is queried according to the data query parameter to obtain the local response data. Then, the local response data and the response data of the child nodes received from the child nodes are sorted and filtered in the order from the closest to the query time to the farthest, and the filtered data is sent to the upper-level intermediate data node 21.

[0054] That is, in response to the data request of the client, each node queries the local response data obtained according to the data query parameter, and passes and filters it sequentially through the intermediate data nodes 21 at all levels of the distributed data network until the central node 10 receives the screening results sent by each child node of the central node 10. Then, the response data of each node for the data request is transmitted to the central node 10.

[0055] The intermediate data node 21 can temporarily store the local response data and the response data of the received child nodes in the form of a list. For example, it is stored using the op_audit table, and various relevant information of the data can be included in this table, such as the data generation time, data type, etc. Specifically, it can be recorded through fields such as op_time, op_type, op_source, etc.

[0056] Step 104: The central node 10 determines the paged data to be displayed based on the single-page data volume and the received screening results, and sends a response message to the client. The response message carries the paged data to be displayed.

[0057] In the embodiment of the present application, after the central node 10 receives the data sent by each child node (i.e., the received screening results), it can screen the received data according to the single-page data volume of the client. The amount of data after screening is the single-page data volume. The data screened by the central node 10 is used as the paged data to be displayed, and a response message is generated based on the paged data to be displayed and sent to the client to instruct the client to display the paged data to be displayed.

[0058] In a possible implementation manner, the central node 10 can compare the data volume of the data sent by each received child node with the single-page data volume, and determine the viewing status of adjacent pages according to the comparison result. For example, as Figure 4 shown, the central node 10 receives a total of 210 pieces of data from 10 child nodes, which is greater than the single-page data volume of 20. Then, 20 pieces of data are screened out from the 210 pieces of data, and at the same time, it is determined that the next page of data can be queried. The central node 10 generates a response message based on the 20 pieces of screened data and the viewing status parameter that the next page is queryable, and sends it to the client, instructing the client to display the above 20 pieces of data, and at the same time setting the next page button on the display interface to a clickable state.

[0059] In a possible implementation manner, asFigure 5 As shown, the central node 10 divides the data received from each child node according to the single-page data volume, determines the number of page numbers for paging and displaying the data received from each child node, and the data corresponding to each page. Then, the central node 10 determines the paged data to be displayed from the data corresponding to each page, generates a response message based on the paged data to be displayed and the number of page numbers, and sends it to the client.

[0060] The data query method provided by the embodiments of the present application is applied to a distributed data network, which includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with hierarchical settings and end data nodes connected to the last intermediate node layer. The intermediate node layer includes multiple intermediate data nodes at the same level. The intermediate node layer closest to the central node is used to interact with the central node, and the intermediate node layer closest to the end data node is used to interact with the end data node. The remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer. After generating data query parameters according to the single-page data volume carried in the data request sent by the client, the central node sends the data query parameters to the intermediate data nodes and end data nodes of each intermediate node layer in a hierarchical transmission manner. The data nodes are used to query the local data of the data nodes according to the data query parameters to obtain local response data; the intermediate data nodes query the local data according to the data query parameters to obtain local response data, and at the same time receive the response data sent by the child nodes. Then, the intermediate data nodes screen the local response data and the received response data of the child nodes, and send the screening results to the parent nodes of the intermediate data nodes. The intermediate data nodes at each level sequentially execute the above query and screening processes until the central node receives the screening results sent by the child nodes of the central node. Finally, the central node determines the paged data to be displayed based on the single-page data volume and the received screening results, and sends a response message carrying the paged data to be displayed to the client. The data query method provided by the embodiments of the present application constructs a distributed data network, hierarchically transmits the response data locally queried by each node in response to the user's data request to the central node, and screens the response data of at least one node during each level of transmission, distributing the transmission and screening of a large amount of data on the intermediate data nodes at each level, thus avoiding the centralized transmission and processing of a large amount of data, ensuring the data query efficiency; the amount of data transmitted to the central node after hierarchical screening processing is small, avoiding the concentration of a large amount of data processing on the central node, and thus avoiding the update and upgrade of equipment and the addition of additional equipment, and realizing the efficient query of data at the software level, effectively reducing the data query cost.

[0061] In one embodiment, the data request of the client may include data query conditions in addition to the amount of data per page. Correspondingly, the central node 10 generates a target data volume greater than the amount of data per page (i.e., the data volume characterized by the data query parameter described above) based on the amount of data per page, so that the data query parameter may include the target data volume, the data query condition, and the query time.

[0062] Further, the data request of the client may further include a paging type; the paging type includes at least one of the first page, the next page, the previous page, and the page number of the page to be displayed, and is used to indicate the page number data that the user wants to view.

[0063] The foregoing embodiments provide a solution for the central node to determine the data of the page to be displayed according to the amount of data per page and the screening results sent by the sub-nodes. In another embodiment of the present application, all the screened data received by the central node can be directly paged and displayed, that is, the paging and display method as shown above Figure 5 The paging and display method. In this case, the central node executes different processes for determining paged data based on the first page and non-first pages.

[0064] When the user performs a data query on the client and views the query results for the first time (i.e., the data of the first page), this embodiment includes the steps as shown in Figure 6 shown: Step 201: Split all the screening results according to the amount of data per page, determine the number of page numbers for paging and displaying all the screening results, and the data corresponding to each page.

[0065] Step 202: Send the data of the first page and the number of page numbers to the client.

[0066] In the embodiments of the present application, after receiving the screening results sent by each sub-node, the central node 10 may first sort all the screening results. Specifically, it may determine the similarity between each data in the screening results and the data query conditions, and then sort the query results in descending order of similarity; it may also sort in the order from the time when the data is generated closest to the query time to the farthest.

[0067] Then, the central node 10 sequentially splits the sorted screening results, and the data volume of each split data is the amount of data per page. During the splitting process, each split data is sequentially marked with a page number until the data volume of the last split data is less than or equal to the amount of data per page, then the splitting of the screening results is completed, and the page number of the last split data is the number of page numbers for paging and displaying all the screening results.

[0068] Finally, the central node 10 generates a response message based on the first split data, that is, the data of the first page and the number of page numbers, and sends it to the client to instruct the client as above Figure 5The figure shows the data of the first page and the page number identifiers of each page.

[0069] When the user continues to view the data of other pages (except the first page), the process of determining the paged data includes the steps as Figure 7 shown below: Step 301: Split all the filtered results according to the amount of data per page, determine the number of page numbers for the paged display of all the filtered results, and the data corresponding to each page.

[0070] Step 302: Determine the page to be displayed according to the paging type and the currently displayed page, and obtain the data of the page to be displayed according to the data corresponding to each page.

[0071] In the embodiments of the present application, after splitting all the filtered results according to the above embodiments to obtain the data and the number of page numbers corresponding to each page, the page to be displayed is determined according to the paging type and the currently displayed page in the data request. For example, if the currently displayed page is the first page and the paging type is the next page, the page to be displayed is the second page; if the currently displayed page is the fifth page and the paging type is the previous page, the page to be displayed is the fourth page.

[0072] The page to be displayed can also be directly determined according to the paging type in the data request. For example, if the paging type is page number 3, it indicates that the user needs to view the data of the third page. Therefore, the page to be displayed is directly determined as the third page.

[0073] After determining the page to be displayed, the data of the page to be displayed is determined according to the data corresponding to each page recorded during data splitting, and a response message is generated based on the data of the page to be displayed and sent to the client to instruct the client to display the data of the page to be displayed.

[0074] In the method provided by the embodiments of the present application, the central node of the distributed data network splits all the filtered results sent by the sub-nodes according to the amount of data per page, determines the number of page numbers for the paged display of all the filtered results, and the data corresponding to each page. Then, it sends the data and the number of page numbers of the first page to the client, or determines the page to be displayed according to the paging type and the currently displayed page, and obtains the data of the page to be displayed according to the data corresponding to each page. In the embodiments of the present application, the response data queried by each node in response to the user's data request is hierarchically filtered and then transmitted to the central node. Finally, while ensuring the validity of the data transmitted to the central node, the amount of data is effectively reduced, avoiding the concentration of a large amount of data processing on the central node, thereby avoiding the update and upgrade of the device and the addition of additional devices, and realizing efficient data query at the software level, effectively reducing the data query cost.

[0075] The foregoing embodiments provide a solution in which the central node determines the paged data to be displayed according to the single-page data volume and the screening results sent by the child nodes. In another embodiment of the present application, only the data currently needed by the user is obtained in one data query. When the user views the data on other pages, a query is re-performed based on the distributed data network to ensure the accuracy of the data query results. That is, the embodiments of the present application implement the paged display method as follows Figure 4 shown, and this embodiment includes the steps as Figure 8 shown: Step 401: Sort the screening results in the order from the time when the data generation time of each screening result is close to the query time to far from the query time.

[0076] Step 402: Select the first N data from the sorted results as the data of the paged data to be displayed according to the single-page data volume.

[0077] Wherein, N is the quantity represented by the single-page data volume.

[0078] In the embodiments of the present application, after the central node 10 receives the screening results sent by each child node, it sorts all the screening results in the order from the time when the data generation time is close to the query time to far from the query time, and selects the first N data as the data of the paged data to be displayed, that is, selects the data of the single-page data volume as the data of the paged data to be displayed, and discards the remaining data.

[0079] In a possible implementation manner, the central node 10 first compares the data volume of the received screening results with the single-page data volume. If the data volume of the screening results is less than or equal to the single-page data volume, there is no need to perform a screening operation, and all the screening results are directly sent to the client for display. At the same time, it indicates that the query results obtained by the user through data query are less and can be completely displayed on one page. Therefore, the query status of adjacent pages is set to be unviewable, that is, the "previous page" and "next page" of the client are set to be in a non-clickable state.

[0080] If the data volume of the screening results received by the central node 10 is greater than the single-page data volume, then after sorting the screening results, the first N data are selected as the data of the paged data to be displayed, and the remaining data are discarded. At the same time, it indicates that the query results obtained by the user through data query are sufficient. Therefore, the query status of adjacent pages is set to be viewable, that is, the "previous page" and / or "next page" of the client are set to be in a clickable state.

[0081] In one embodiment, since the user needs to re-query the data corresponding to the paged data based on the distributed data network every time they view a page of data, in order to distinguish the data of different pages, different query conditions need to be set. Specifically, the central node can set different query conditions corresponding to different pages through the query time, and the intermediate data nodes implement the query of the corresponding paged data based on the query conditions.

[0082] That is, the data query parameter further includes a query time condition, and the query time condition is used to limit the display data of the corresponding page of the paging type based on the data generation time.

[0083] The process of the intermediate data node querying data based on the query time condition may include the following Figure 9 steps shown: Step 501: Query the data in the local data of the intermediate data node that meets the data query condition and whose data generation time meets the query time condition, and obtain the response data local to the intermediate data node.

[0084] Step 502: Sort the response data local to the intermediate data node and the response data of the received child nodes in ascending order of the time distance from the data generation time to the query time.

[0085] Step 503: Select the first M data from the sorted result according to the target data volume and send them to the parent node of the intermediate data node.

[0086] Wherein, M is the quantity represented by the target data volume, that is, M is an integer greater than N; preferably, M = N + 1.

[0087] Wherein, when the paging type is the first page, the query time condition is that the data generation time is less than the query time; when the paging type is the next page, the query time condition is that the data generation time is less than the data generation time of the first target data in the display data of the current page; when the paging type is the previous page, the query time condition is that the data generation time is greater than the data generation time of the second target data in the display data of the current page. Wherein, the current page is the paging currently displayed by the client.

[0088] Wherein, the first target data is the display data of the current page ranked first after sorting the display data of each current page in ascending order of the time distance from the data generation time to the query time. The second target data is the display data of the current page ranked first after sorting the display data of each current page in descending order of the time distance from the data generation time to the query time.

[0089] In the embodiment of the present application, the data request includes a paging type, and the paging type indicates the data of the paging that the user wants to view.

[0090] Wherein, meeting the data query condition and the query time condition can be expressed as the following Structured Query Language (SQL) statement: from op_audit where op_type = disk and op_time order by op_time desc limit x; x is the target data volume.

[0091] When the paging type is the first page, the query time is the current query time. The central node 10 generates a query time condition based on the query time carried in the data request: the data generation time is less than the query time, and it instructs the intermediate data node 21 or the end data node 30 to query the data that meets the data query condition and whose data generation time is before the current time, and obtains the local response data. Then the intermediate data node 21 receives the response data sent by the child node, sorts the local response data and the response data of the received child node in the order from the closest to the query time to the farthest from the query time in terms of data generation time, and selects the first M data before sorting and sends them to the parent node, that is, selects the data with the target data volume and sends them to the parent node, so as to realize the transfer of the response data at the level where the intermediate data node is located.

[0092] When the paging type is the next page, the central node 10 first determines the oldest data (the first target data) in the data of the current page, that is, the data whose data generation time is the farthest from the query time, and then determines that the query time condition is that the data generation time is less than the data generation time of the first target data in the data displayed on the current page. That is, the data of the next page is continuous with the data of the current page in terms of time. For example, if the query time of the data of the current page obtained is 9:45 and the data generation time of the data of the current page obtained is within the range of 9:30 - 9:45, then when querying the data of the next page, the query time condition is that the data generation time is before 9:30. After the intermediate data node 21 queries the local response data that meets the data query condition and the query time condition (for example, the data generation time is before 9:30), it selects M data and sends them to the parent node according to the above data sorting and screening method.

[0093] When the user needs to view updated data during the viewing process, that is, when the user clicks the "previous page" button, the central node 10 first determines the latest data (the second target data) in the data of the current page, that is, the data whose data generation time is the closest to the query time, and then determines that the query time condition is that the data generation time is greater than the data generation time of the second target data in the data displayed on the current page. That is, the data of the previous page is also continuous with the data of the current page in terms of time. For example, if the current page is the 3rd page and the data generation time of the data of the current page obtained is within the range of 10:10 - 10:30, then when querying the data of the previous page, the query time condition is that the data generation time is after 10:30. After the intermediate data node 21 queries the local response data that meets the data query condition and the query time condition (for example, the data generation time is after 10:30), it selects M data and sends them to the parent node according to the above data sorting and screening method.

[0094] In the method provided by the embodiment of the present application, the intermediate data node queries the local data to obtain the data that meets the data query condition and the data generation time meets the query time condition, so as to obtain the response data of the intermediate data node locally. Sort the response data of the intermediate data node locally and the response data of the received child nodes in the order from the nearest to the farthest distance between the data generation time and the query time. Select the first M data from the sorting result according to the target data volume, and send them to the parent node of the intermediate data node. Finally, the central node sorts the screening results received from the child nodes in the order from the nearest to the farthest distance between the data generation time and the query time, and selects the first N data from the sorting result according to the single-page data volume as the data to be displayed in pages. In the embodiment of the present application, only the data to be displayed in pages is queried each time a data query is performed. When the user needs to view the previous page or the next page of data, a new data query is performed to ensure the accuracy of the data to be displayed in pages queried.

[0095] In one embodiment, a distributed data network is provided. The distributed data network includes a central node, at least one node group arranged hierarchically, and end data nodes. Each node group includes at least one intermediate data node. The central node is configured to receive a data request from a client, generate data query parameters according to the single-page data volume carried in the data request, and send the data query parameters to the intermediate data node; the data volume represented by the data query parameters is greater than the single-page data volume; the intermediate data node is configured to send the data query parameters to the child nodes until the end data node receives the data query parameters, and receive the response data sent by the child nodes; screen the response data of the intermediate data node locally and the response data received from the child nodes according to the data query parameters, and send the screening result to the parent node of the intermediate data node until the central node receives the screening result sent by the child node of the central node; the response data is obtained according to the data query parameters; the central node is further configured to determine the data to be displayed in pages based on the single-page data volume and the received screening result, and send a response message to the client, and the response message carries the data to be displayed in pages.

[0096] In the embodiment of the present application, after receiving the data request, the central node 10 can analyze the data request, generate data query parameters according to the analysis result, and send the data query parameters to the intermediate data node 21, so that each intermediate data node 21 and the end data node 30 can query the data that meets the user data request instruction based on the data query parameters.

[0097] When the central node 10 sends the data query parameters, it can first send the data query parameters to the child nodes of the central node 10, that is, the first-level intermediate data nodes; then, the first-level intermediate data nodes send the data query parameters to their own child nodes, that is, the second-level intermediate data nodes, until the data query parameters are transmitted to the end data node 30 through hierarchical transmission.

[0098] After the data query parameters are passed to the end data node 30, the end data node 30 can query in the local data according to the data query parameters to obtain multiple data that meet the user data request instruction, that is, obtain multiple data that meet the user's needs. Then, the end data node 30 can screen the queried data based on the data volume characterized by the data query parameters, and send the screened data to the parent node of the end data node 30, that is, the upper-level intermediate data node 21 of the end data node 30. Thus, the intermediate data node 21 receives the data sent by the child node, and this data is the response data of the end data node 30, that is, the end data node 30 responds to the data request of the client, queries in the local data according to the data query parameters, and finally obtains the data.

[0099] For the upper-level intermediate data node 21 of the end data node 30, according to the data query method of the end data node 30 above, query the local data of the intermediate data node 21 according to the data query parameters to obtain the local response data of the intermediate data node 21. Then, the intermediate data node 21 determines the local response data and the total data volume of the response data received from each end data node 30, and compares the total data volume with the data volume characterized by the data query parameters. When the total data volume does not reach the data volume characterized by the data query parameters, directly send all the data to the upper-level intermediate data node 21 of the intermediate data node 21; if the total data volume exceeds the data volume characterized by the data query parameters, screen the local response data and the received response data, and the screened data volume is equal to the data volume characterized by the data query parameters. Finally, the intermediate data node 21 sends the screened data to the upper-level intermediate data node 21.

[0100] After the central node 10 receives the data sent by each child node (that is, the received screening result), it can screen the received data according to the single-page data volume of the client. The screened data volume is the single-page data volume. The data screened by the central node 10 is used as the paged data to be displayed, and a response message is generated based on the paged data to be displayed and sent to the client to instruct the client to display the paged data to be displayed.

[0101] When the distributed data network provided by the embodiments of the present application implements the data query function, the response data queried by each node in response to the user's data request is hierarchically transmitted to the central node, and the response data of at least one node is screened during each level of transmission. The transmission and screening processes of a large amount of data are distributed on the intermediate data nodes at each level, thereby avoiding the centralized transmission and processing of a large amount of data and ensuring the data query efficiency; the amount of data transmitted to the central node after hierarchical screening and processing is small, avoiding the centralized processing of a large amount of data on the central node, and further avoiding the update and upgrade of equipment and the addition of additional equipment. The efficient query of data can be realized at the software level, effectively reducing the data query cost. The distributed processing of data by the intermediate data nodes at each level can also avoid network congestion and further improve the data query efficiency.

[0102] It should be noted that although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be executed in a different order. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.

[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0104] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. 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), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0105] The above description is only the preferred embodiments of the present application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with (but not limited to) technical features with similar functions disclosed in the present application.

Claims

1. A data query method, characterized in that, Applied to a distributed data network, the distributed data network includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with a hierarchical setting and end data nodes connected to the last intermediate node layer. The intermediate node layer includes multiple intermediate data nodes at the same level. The intermediate node layer closest to the central node is used to interact with the central node, and the intermediate node layer closest to the end data nodes is used to interact with the end data nodes. The remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer. The method includes: The central node receives a data request from a client, generates data query parameters according to the amount of single-page data carried in the data request, and sends the data query parameters to the data nodes; the amount of data represented by the data query parameters is greater than the amount of data represented by the single-page data; the data request further includes a query time; The data nodes are used to query the data local to the data nodes according to the data query parameters to obtain local response data; wherein, The intermediate data nodes send the data query parameters to the child nodes until the end data nodes receive the data query parameters and receive the response data sent by the child nodes; the response data is obtained according to the data query parameters; The intermediate data nodes sort and filter the local response data of the intermediate data nodes and the response data of the received child nodes according to the time distance from the data generation time to the query time in descending order, and send the filtering result to the parent node of the intermediate data node until the central node receives the filtering result sent by the child node of the central node; the amount of data corresponding to the filtering result is greater than the amount of single-page data; The central node determines the paged data to be displayed based on the single-page data amount and the received filtering result, and sends a response message to the client, and the response message carries the paged data to be displayed.

2. The method according to claim 1, wherein The data request of the client further includes a data query condition; The data query parameters include a target data amount, the data query condition, and the query time; the target data amount is greater than the single-page data amount.

3. The method according to claim 2, wherein The data request of the client further includes a paging type; the paging type includes at least one of the first page, the next page, the previous page, and the page number of the paged data to be displayed.

4. The method according to claim 2, wherein The central node determines the paged data to be displayed based on the single-page data amount and the received filtering result, including: Splitting all the filtering results according to the single-page data amount, determining the number of page numbers for paging display of all the filtering results, and the data corresponding to each page; Sending the data of the first page and the number of page numbers to the client.

5. The method according to claim 3, wherein The central node determines the paged data to be displayed based on the single-page data amount and the received filtering result, including: Splitting all the filtering results according to the single-page data amount, determining the number of page numbers for paging display of all the filtering results, and the data corresponding to each page; Determine the page to be displayed according to the paging type and the currently displayed paging, and obtain the data of the page to be displayed according to the data corresponding to each paging.

6. The method according to claim 3, wherein The central node determines the data of the page to be displayed based on the single-page data volume and the received filtering results, including: Sort each of the filtering results in the order from the time when the data of each filtering result is generated, which is closer to the query time to the time farther from the query time; Select the first N data in the sorting result as the data of the page to be displayed according to the single-page data volume; N is the quantity represented by the single-page data volume.

7. The method according to claim 3, wherein The data query parameter further includes a query time condition, and the query time condition is used to limit the display data of the page corresponding to the paging type based on the data generation time.

8. The method according to claim 7, wherein When the paging type is the first page, the query time condition is that the data generation time is less than the query time; when the paging type is the next page, the query time condition is that the data generation time is less than the data generation time of the first target data in the currently displayed data of the page; when the paging type is the previous page, the query time condition is that the data generation time is greater than the data generation time of the second target data in the currently displayed data of the page; The first target data is the currently displayed data of the page that ranks first after sorting each of the currently displayed data of the page in the order from the time when the data is generated, which is closer to the query time to the time farther from the query time; the second target data is the currently displayed data of the page that ranks first after sorting each of the currently displayed data of the page in the order from the time when the data is generated, which is farther from the query time to the time closer to the query time.

9. The method according to claim 8, wherein The intermediate data node sorts and filters the response data of the intermediate data node locally and the response data of the received child nodes according to the data query parameter in the order from the time when the data is generated, which is closer to the query time to the time farther from the query time, including: Query in the local data of the intermediate data node for the data that meets the data query condition and whose data generation time meets the query time condition to obtain the response data of the intermediate data node locally; Sort the response data of the intermediate data node locally and the response data of the received child nodes in the order from the time when the data is generated, which is closer to the query time to the time farther from the query time; Select the first M data in the sorting result according to the target data volume and send them to the parent node of the intermediate data node; M is the quantity represented by the target data volume, and M is an integer greater than N.

10. A distributed data network, characterized in that, The distributed data network includes a central node and a hierarchical query network composed of data nodes. The hierarchical query network includes at least one intermediate node layer with hierarchical settings and end data nodes connected to the last intermediate node layer. The intermediate node layer includes multiple intermediate data nodes of the same level. The intermediate node layer closest to the central node is used to interact with the central node, the intermediate node layer closest to the end data nodes is used to interact with the end data nodes, and each of the remaining intermediate node layers is used to interact with the previous intermediate node layer or the next intermediate node layer. The central node is configured to receive a data request from a client, generate data query parameters according to the amount of single-page data carried in the data request, and send the data query parameters to the data node; the amount of data characterized by the data query parameters is greater than the amount of single-page data; the data request further includes a query time; The data node is configured to query the data local to the data node according to the data query parameters to obtain local response data; wherein, The intermediate data node is configured to send the data query parameters to the child nodes until the end data node receives the data query parameters, receive the response data sent by the child nodes; sort and filter the local response data of the intermediate data node and the received response data of the child nodes in the order from the time of data generation closest to the query time to the farthest from the query time according to the data query parameters, and send the filtering result to the parent node of the intermediate data node until the central node receives the filtering result sent by the child nodes of the central node; the amount of data corresponding to the filtering result is greater than the amount of single-page data; the response data is obtained according to the data query parameters; The central node is further configured to determine the paged data to be displayed based on the amount of single-page data and the received filtering result, and send a response message to the client, the response message carrying the paged data to be displayed.

Citation Information

Patent Citations

  • Method for distribution storage and paging querying of real-time data

    CN103778135A

  • Paging query system and method for real-time data

    CN112948468A

  • System and method for resolving distributed network search queries to information providers

    US20030050924A1