Data query method and distributed data network

By building a hierarchical query network and processing distributed data queries using hierarchical transmission and screening, the problem of central node pressure caused by the discreteness of data nodes in a distributed architecture is solved, and efficient and low-cost data queries are achieved.

CN120336402BActive Publication Date: 2025-09-23BEIJING LINX SOFTWARE CORP
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Under the distributed architecture, the high degree of discreteness between the data of each data node requires the central node to aggregate the data that meets the query conditions in each data node and perform unified screening and paging processing, which leads to high data processing pressure on the central node and affects the efficiency and accuracy of data query.

Method used

Build a hierarchical query network, including a hierarchical intermediate node layer and terminal data nodes. Pass data query parameters and response data through the layers. The intermediate nodes sort and filter the data until the central node receives the filtering results and determines the paged data to be displayed based on the amount of single-page data, avoiding the centralized transmission and processing of large amounts of data.

Benefits of technology

It effectively reduces data query costs, improves data query efficiency, avoids equipment updates and upgrades and the addition of additional equipment, and achieves efficient data query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336402B_ABST
    Figure CN120336402B_ABST
Patent Text Reader

Abstract

The present application discloses 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 arranged in a hierarchical manner and an end data node connected to the end intermediate node layer. The intermediate node layer includes multiple intermediate data nodes of the same level. The method includes: after the central node generates data query parameters based on the amount of single-page data carried by the data request sent by the client, the data query parameters are sent to each intermediate data node and the end data node through hierarchical transmission. The intermediate data node filters the response data of the local and child nodes, and sends the filtering results to the parent node until the central node receives the filtering results sent by the child node, determines the paging data to be displayed based on the single-page data amount and the filtering results, and feeds back to the client. The use of this method can reduce the cost of data query.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application requests priority from the prior Chinese application filed with the State Intellectual Property Office on October 21, 2024, with application number 202411471346X and application name “Data Query Method and Distributed Data Network”. Technical Field

[0002] The present application relates to the field of big data, and in particular to a data query method and a distributed data network. Background Art

[0003] With the development of digital technology, applications have gradually adopted distributed computing architecture, which 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, different service nodes (i.e., data nodes) are located in different geographic locations (e.g., provinces, cities, counties, townships, regions, etc.) and environments (e.g., coastal areas, plateaus, typhoon areas, etc.), resulting in a high degree of discreteness in the data between different data nodes. The discreteness of data at each data node can be reflected in the randomness of data volume and temporal distribution. For example, for the same type of data, different data nodes may generate different amounts of data within the same time period due to differences in geographic location and environment, indicating that data at different data nodes is discrete. For the same data node, the same type of data may also generate different amounts of data due to differences in climate, lighting, and other environmental factors at different times, indicating that data at the same data node is volatile.

[0005] Therefore, due to the high degree of discreteness between the data of each data node in the distributed data architecture and the volatility of the data local to the data node, data query in the distributed data architecture is difficult. This can be reflected in the following aspects:

[0006] For the same query criteria, the amount of data that meets the query criteria varies across different data nodes. For example, data node A may have 30 items matching the query criteria, data node B may have 5,000 items matching the query criteria, and data node C may have 400 items matching the query criteria. Traditionally, all data matching the query criteria from all data nodes is aggregated and transmitted to a central node, which then performs unified sorting, filtering, and paging. This results in a large amount of data being transmitted across the distributed architecture, impacting data query efficiency. Furthermore, the central node must process a large amount of data, impacting its performance and, consequently, affecting the efficiency and accuracy of data queries.

[0007] If the query conditions are restricted to reduce the amount of data required for paginated data queries, the amount of data in the query results of each data node will be reduced. However, due to the large difference in the amount of data for the same query condition among different data nodes and the volatility of the local data of each data node, it is difficult to determine the query condition that is applicable to all data nodes.

[0008] For different query times, due to the randomness (volatility) of the time distribution of local data on data nodes, the data query results under the distributed architecture vary at different query times.

[0009] In addition, for data nodes that are geographically far away from the central node, there is also the problem of high query latency when querying data.

[0010] 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 generated by the same data node in a distributed data architecture that is discretely stored in multiple other data nodes according to load balancing technology; the data query method of this application is not an index query method for discretely stored data.

[0011] In summary, the technical problem addressed by this application is the high degree of discreteness between the data of each data node in a distributed architecture, which requires 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 high data processing pressure on the central node and affecting the data query efficiency of the distributed architecture. Summary of the Invention

[0012] In view of the above-mentioned 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 an application.

[0013] In a first aspect, the present 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 hierarchical intermediate node layer and an end data node connected to the endmost 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 node is used to interact with the end data node, and the remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer, the method comprising:

[0014] The central node receives a data request from a client, generates a data query parameter based on the single-page data volume carried in the data request, and sends the data query parameter to the data node; the data volume represented by the data query parameter is larger than the data volume represented by the single-page data volume; the data request also includes the query time;

[0015] The data node is used to query the local data of the data node according to the data query parameters and obtain the local response data;

[0016] The intermediate data node sends data query parameters to the child node until the end data node receives the data query parameters and receives the response data sent by the child node; the response data is obtained based on the data query parameters;

[0017] The intermediate data node sorts and filters the local response data of the intermediate data node and the response data received from the child nodes according to the data query parameters, in the order of data generation time from the nearest to the query time, and sends the filtering results to the parent node of the intermediate data node until the central node receives the filtering results sent by the child nodes of the central node. The data volume corresponding to the filtering results is larger than the data volume of a single page.

[0018] The central node determines the page data to be displayed based on the single page data volume and the received filtering results, and sends a response message to the client, where the response message carries the page data to be displayed.

[0019] In combination with the first aspect, in a possible implementation, the client's data request also includes a data query condition; the data query parameters include a target data volume, a data query condition, and a query time; and the target data volume is greater than a single-page data volume.

[0020] In combination with the first aspect, in a possible implementation, the client's data request further includes a page turning type; the page turning type includes at least one of the following: first page, next page, previous page, and page number of a page to be displayed.

[0021] In combination with the first aspect, in a possible implementation method, the central node determines the paging data to be displayed based on the single-page data volume and the received filtering results, including: splitting all filtering results according to the single-page data volume, determining the number of pages for paging display of all filtering results, and the data corresponding to each page; sending the data of the first page and the number of pages to the client.

[0022] In combination with the first aspect, in a possible implementation method, the central node determines the paging data to be displayed based on the single-page data volume and the received filtering results, including: splitting all filtering results according to the single-page data volume, determining the number of pages for paging display of all filtering results, and the data corresponding to each page; determining the paging to be displayed according to the paging type and the currently displayed paging, and obtaining the data of the paging to be displayed according to the data corresponding to each page.

[0023] In combination with the first aspect, in a possible implementation method, the central node determines the paging data to be displayed based on the single-page data volume and the received filtering results, including: sorting each filtering result in order from the data generation time to the query time from near to far; selecting the top N sorted data from the sorted results according to the single-page data volume as the paging data to be displayed; N is the number represented by the single-page data volume.

[0024] 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 a page corresponding to the page turning type based on the data generation time.

[0025] In combination with the first aspect, in a possible implementation method, when the page turning type is the first page, the query time condition is that the data generation time is less than the query time; when the page turning 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 current page display data; when the page turning 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 current page display data; the first target data is the current page display data that is ranked first after sorting each current page display data in order from near to far in terms of the data generation time to the query time; the second target data is the current page display data that is ranked first after sorting each current page display data in order from far to near in terms of the data generation time to the query time.

[0026] In combination with the first aspect, in a possible implementation method, the intermediate data node sorts and filters the local response data of the intermediate data node and the response data received from the child node in order from the data generation time to the query time according to the data query parameters, including: querying the local data of the intermediate data node for data that meets the data query conditions and whose data generation time meets the query time conditions, to obtain the local response data of the intermediate data node; sorting the local response data of the intermediate data node and the response data received from the child node in order from the data generation time to the query time; selecting the top M data from the sorting results according to the target data volume, and sending them to the parent node of the intermediate data node; M is the number of representations of the target data volume, and M is an integer greater than N.

[0027] In a second aspect, the present application further provides 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 hierarchical intermediate node layer and an end data node connected to the end 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 node is used to interact with the end data node, and the remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer.

[0028] The central node is configured to receive a data request from a client, generate a data query parameter based on the single-page data volume carried in the data request, and send the data query parameter to the data node; the data volume represented by the data query parameter is greater than the single-page data volume; and the data request also includes a query time;

[0029] The data node is used to query the local data of the data node according to the data query parameter to obtain local response data; wherein,

[0030] The intermediate data node is used to send the data query parameters to the child nodes until the end data node receives the data query parameters and receives 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 of data generation time from the nearest to the query time according to the data query parameters, and send the filtering results to the parent node of the intermediate data node until the central node receives the filtering results sent by the child nodes of the central node; the data volume corresponding to the filtering results is greater than the data volume of the single page; the response data is obtained according to the data query parameters;

[0031] The central node is further configured to determine the paged data to be displayed based on the single page data volume and the received screening result, and send a response message to the client, where the response message carries the paged data to be displayed.

[0032] The embodiment of the present application provides a data query method and a distributed data network, wherein the distributed data network includes a central node and a hierarchical query network composed of data nodes, wherein the hierarchical query network includes at least one intermediate node layer arranged in a hierarchical manner and an end data node connected to the end intermediate node layer, wherein the intermediate node layer includes multiple intermediate data nodes of the same level, wherein 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 node is used to interact with the end data node, and the remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer. After the central node generates data query parameters based on the amount of single-page data carried in the data request sent by the client, the data query parameters are sent to the intermediate data nodes and the end data nodes of each intermediate node layer through hierarchical transmission. The data node is used to query the local data of the data node according to the data query parameters and obtain local response data. The intermediate data node also queries the local data according to the data query parameters and obtains local response data, while receiving the response data sent by the child node. The intermediate data node then filters the local response data and the received response data of the child node and sends the filtering results to the intermediate data node's parent node. The intermediate data nodes at each level sequentially perform the above query and filtering process until the central node receives the filtering results sent by the central node's child node. Finally, the central node determines the paged data to be displayed based on the single-page data volume and the received filtering results, and sends a response message containing the paged data to be displayed to the client. The data query method provided in the embodiment of the present application constructs a distributed data network, and transmits the response data hierarchically that each node has locally queried in response to the user's data request to the central node, and the response data of at least one node is screened during each level of transmission, and the transmission and screening processing 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 efficiency of data query; the amount of data transmitted to the central node after the hierarchical screening processing is small, avoiding the concentration of a large amount of data processing process on the central node, and further avoiding the update and upgrade of equipment and the addition of additional equipment, and realizing efficient data query at the software level, effectively reducing the cost of data query. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0034] Figure 1 is an architectural diagram of a distributed data network in one embodiment;

[0035] Figure 2 is another architectural diagram of a distributed data network in one embodiment;

[0036] Figure 3 1 is a flow chart of a data query method in one embodiment;

[0037] Figure 4 A schematic diagram of paging display of a data query method in one embodiment;

[0038] Figure 5 Another schematic diagram of paging display of a data query method according to an embodiment;

[0039] Figure 6 is another flowchart of a data query method in one embodiment;

[0040] Figure 7 is another flowchart of a data query method in one embodiment;

[0041] Figure 8 is another flowchart of a data query method in one embodiment;

[0042] Figure 9 FIG. 4 is another flow chart of a data query method in an embodiment. DETAILED DESCRIPTION

[0043] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

[0044] It should be noted that, in the absence of conflict, the embodiments in this 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 accompanying drawings and in combination with the embodiments. In addition, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects.

[0045] With the development of digital technology, applications are increasingly adopting distributed computing architectures, which offer advantages such as scalability and high efficiency. This is particularly true in edge computing scenarios, where multiple server nodes form a node domain, each responsible for independent data processing and storage. This effectively improves the efficiency of local data processing within each node domain. However, due to the highly discrete nature of data, distributed architectures also present challenges such as difficulty in data search, query, and analysis.

[0046] Traditional technologies often use data monitoring components (such as Prometheus and exporter) to centrally collect and store data from discrete nodes, and then perform queries and analysis based on the collected data. However, due to the huge amount of data collected, this approach requires a comprehensive transformation of the existing system architecture, the addition of additional hardware devices, such as storage devices, and the updating and upgrading of servers and network infrastructure to adapt to the analysis and processing capabilities of large data volumes, resulting in high application costs.

[0047] In the paging query scenario, after the data of discrete nodes (i.e., data nodes) are centrally collected, the data query method that uniformly sorts and paging processes them on the central server (i.e., central node) has problems of slow response and network congestion due to the centralized transmission, overall sorting, and search of large amounts of data. Moreover, the sorting and searching of the entire data are concentrated on the central server, which leads to high computing pressure on the central server and waste of computing resources.

[0048] 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 equipment updates and upgrades and the addition of additional equipment, thereby effectively reducing data query costs.

[0049] like Figure 1 As 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 in a hierarchical manner and an end data node 30 connected to the end 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 node 30 is used to interact with the end data node 30, and the remaining intermediate node layers 20 are used to interact with the previous intermediate node layer or the next intermediate node layer.

[0050] The construction process of the distributed data network can be as follows:

[0051] The central node 10 may first construct a hierarchical query network based on the identifiers of each data node. Specifically, all or part of the data nodes of the application may be grouped, and one data node is selected from each group of data nodes as the intermediate data node 21. The multiple intermediate data nodes 21 selected from the multiple groups of data nodes then form an intermediate node layer 20 corresponding to a level (e.g., level 1).

[0052] Among them, the relevant node data of the intermediate data node 21 in an intermediate node layer 20 can be recorded in a list, which may include the node's identification, address and other information. 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].

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

[0054] The following is an example of an application including 1000 data nodes: the central node 10 first divides the 1000 data nodes into 10 groups, each group can include 100 data nodes (the number of data nodes in each group can also be different), and for each group of data nodes, one is selected from the 100 data nodes as the intermediate data node 21, then the 10 intermediate data nodes 21 (for example, 1-1, 1-2, ..., 1-10) form a node group 20, which can be called a level 1 node group 20, and the intermediate data nodes 21 in the level 1 node group 20 can be called a level 1 intermediate data node; then, for each group of data nodes, the remaining 99 data nodes except the intermediate data node 21 are selected. After further grouping, the nodes can be divided into 10 groups, of which 9 groups include 10 data nodes and the last group includes 9 data nodes. For each group of data nodes, one is selected as the intermediate data node 21. Then, 10 intermediate data nodes 21 (for example, 2-1-1, 2-1-2, ..., 2-1-10) form a second-level node group 20. The intermediate data nodes 21 in the second-level node group can be called second-level intermediate data nodes. Finally, for each group of data nodes, the remaining 9 or 8 data nodes except the intermediate data node 21 are grouped again, which can be divided into 9 or 8 groups. Each group includes 1 data node, namely, the end data node 30. The distributed data network is constructed.

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

[0056] It should be noted that the above-mentioned grouping identifier abc for 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.

[0057] In one possible implementation, Figure 2 As shown, the central node 10 can be the management platform of the application, interacting with the client. The central node 10 can build a distributed data network based on some of the 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 be grouped based on the geographical location of the nodes. For example, nodes in the same area are grouped together. It can also be grouped based on other characteristics of the nodes. This application does not impose any restrictions on this. That is, the position of different data nodes in the distributed data network is related to the geographical location of each data node. For example, a data node that is geographically farther away from the central node 10 has a larger level difference with the central node 10 in the distributed data network, that is, the data transmission path is longer. It may be an end data node 30, an intermediate data node 21 that interacts with the end data node 30, etc.

[0058] To address the problem of high data transmission latency for data nodes that are geographically far away from the central node 10, a distributed data network can be built through model training:

[0059] First, an initial distributed data network is constructed. This initial distributed data network also includes a central node 10 and multiple data nodes. These multiple data nodes form a hierarchical query network. The hierarchical query network includes at least one intermediate node layer 20 arranged in a hierarchical manner, and a terminal data node 30 connected to the terminal intermediate node layer. The intermediate node layer 20 includes multiple intermediate data nodes 21 at the same level. However, the positions of the data nodes in the distributed data network are currently undetermined.

[0060] Then, with the primary goal of minimizing overall communication latency in the distributed data network and the secondary goal of minimizing communication latency between data nodes at adjacent levels (between intermediate data nodes at adjacent levels, or between intermediate data nodes and end data nodes at adjacent levels), the positions of each data node in the initial distributed data network are continuously adjusted. It will be understood that adjustments to the positions of data nodes in the distributed data network indicate changes in their type (intermediate data node or end data node), level (intermediate node layer), connection relationships between central nodes and intermediate data nodes, connections between intermediate data nodes, and connections between intermediate data nodes and end data nodes.

[0061] The communication delay of the adjusted initial distributed data network is calculated until the communication delay of the initial distributed data network reaches the first target and the second target, and then the position adjustment of the data nodes is stopped to obtain a distributed data network.

[0062] 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, so that multi-threaded data can be transmitted simultaneously, thereby improving data query efficiency.

[0063] The distributed data network can be pre-built by the central node 10. After the central node 10 receives the data request sent by the client, it can directly perform data query based on the pre-built distributed network; or the central node 10 receives the data request from the client, analyzes the data request, selects some data nodes based on the user's query requirements and constructs it to improve the query accuracy.

[0064] Based on the above distributed data network, the data query method includes the following: Figure 3 Steps shown:

[0065] Step 101: The central node 10 receives a data request from a client, generates a data query parameter according to the amount of single-page data carried in the data request, and sends the data query parameter to a data node.

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

[0067] After receiving the data request, central node 10 analyzes the request, generates data query parameters based on the analysis results, and sends the data query parameters to intermediate data nodes 21. This allows each intermediate data node 21 and end data node 30 to query data that meets the user's data request instruction based on the data query parameters. The data request also includes the query time, which is the time when the client generates the data request.

[0068] When the central node 10 sends data query parameters, it can first send the data query parameters to the child node of the central node 10, that is, the level 1 intermediate data node; then, the level 1 intermediate data node sends the data query parameters to its own child node, that is, the level 2 intermediate data node, until the data query parameters are transmitted to the end data node 30 through hierarchical sending.

[0069] The single-page data size may be manually set by the user on the client, or may be determined by the client based on its own display parameters (eg, screen size, font size, etc.).

[0070] The data volume represented by the data query parameter is larger than the data volume of a single page. For example, the data volume represented by the data query parameter could be 21. This means that after receiving the data query parameter, each data node (intermediate data node 21 or end data node 30) queries the local data based on the query parameter and obtains local response data. For example, during the data query process, 21 pieces of data that meet the user's data request instruction can be obtained. For different types of data nodes (intermediate data nodes or end data nodes), the data processing method is as follows:

[0071] Step 102: The intermediate data node 21 sends data query parameters to the child nodes until the end data node 30 receives the data query parameters and receives response data sent by the child nodes.

[0072] In the embodiment of the present application, after the data query parameters are passed to the end data node 30, the end data node 30 can query the local data according to the data query parameters and obtain multiple data that meet the user's data request instructions, that is, obtain multiple data that meet the user's needs. The end data node 30 can then filter and process the queried data based on the data volume represented by the data query parameters, and send the filtered data to the parent node of the end data node 30, that is, the intermediate data node 21 at the previous level of the end data node 30. The intermediate data node 21 then receives the data sent by the child node, which is the response data of the end data node 30, that is, the data ultimately obtained by the end data node 30 after querying the local data according to the data query parameters in response to the client's data request.

[0073] It is understandable 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 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 represented by the data query parameter, the queried data is filtered until the filtered data reaches the amount represented by the data query parameter. The filtered data is the response data and is sent to the parent node. In other words, the amount of data sent by the end data node 30 to the upper-level intermediate data node 21 is less than or equal to the amount represented by the data query parameter.

[0074] For example, if the end data node 30 finds 15 pieces of data based on the data query parameters, all 15 pieces of data are sent to the parent node. If the end data node 30 finds 30 pieces of data based on the data query parameters, 21 pieces of data are filtered out and sent to the parent node. In other words, the amount of data sent by the end data node 30 to the upper-level intermediate data node 21 is within the range of 0 to 21.

[0075] 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.

[0076] In an embodiment of the present application, the intermediate data node 21 above the end data node 30 queries the local data stored in the local database (e.g., the relational database sqlite3) of the intermediate data node 21 according to the data query method described above for the end data node 30, based on the data query parameters, to obtain the local response data of the intermediate data node 21. The intermediate data node 21 then determines the local response data and the total amount of response data received from each end data node 30, and compares the total amount of data with the amount of data indicated by the data query parameters. If the total amount of data reaches the amount indicated by the data query parameters, all data is directly sent to the intermediate data node 21 above the intermediate data node 21. If the total amount of data exceeds the amount indicated by the data query parameters, the local response data and the received response data are sorted in order of the closest data generation time to the query time. The data is then filtered based on the data amount indicated by the query parameters, selecting multiple data with the highest rankings. The amount of data after filtering equals the amount of data indicated by the data query parameters, i.e., greater than the amount of data on a single page. Finally, the intermediate data node 21 sends the filtered data to the intermediate data node 21 above the end data node.

[0077] It can be understood that for each intermediate data node 21, after receiving the data query parameters, the local data is queried according to the data query parameters to obtain local response data; then, the local response data and the response data of the child node received from the child node are sorted and filtered in the order of the data generation time from the nearest to the query time, and the filtered data is sent to the upper-level intermediate data node 21.

[0078] That is, each node responds to the client's data request, and the local response data obtained according to the data query parameter query is transmitted and filtered in sequence through the intermediate data nodes 21 at each level of the distributed data network until the central node 10 receives the filtering results sent by each child node of the central node 10. Then the response data of each node to the data request are all transmitted to the central node 10.

[0079] The intermediate data node 21 can temporarily store local response data and received child node response data in the form of a list, for example, using the op_audit table for storage. The table can also include various relevant information of the data, such as data generation time, data type, etc., which can be specifically recorded through fields such as op_time, op_type, and op_source.

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

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

[0082] In a possible implementation, the central node 10 can compare the amount of data received from each sub-node with the amount of data on a single page, and determine the viewing status of adjacent pages based on the comparison result. Figure 4 As shown, the central node 10 receives a total of 210 data items from 10 child nodes, which is greater than the single-page data size of 20. The central node 10 then filters out 20 data items from the 210 data items and determines that the next page of data is available for query. Based on the 20 filtered data items and the next page view status parameter, the central node 10 generates a response message and sends it to the client, instructing the client to display the 20 data items and setting the next page button on the display interface to a clickable state.

[0083] In one possible implementation, Figure 5 As shown, the central node 10 divides the received data of each sub-node according to the amount of data per page, determines the number of pages for paging the data of each sub-node, and the data corresponding to each page. Then, the central node 10 determines the page data to be displayed from the data corresponding to each page, generates a response message based on the page data to be displayed and the number of pages, and sends it to the client.

[0084] The data query method provided in the embodiment 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 arranged in a hierarchical manner and an end data node connected to the end 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 node is used to interact with the end data node, and the remaining intermediate node layers are used to interact with the previous intermediate node layer or the next intermediate node layer. After the central node generates data query parameters based on the single-page data volume carried by the data request sent by the client, the data query parameters are sent to the intermediate data nodes and the end data nodes of each intermediate node layer through hierarchical transmission. The data node is used to query the local data of the data node according to the data query parameters and obtain local response data. The intermediate data node also queries the local data according to the data query parameters and obtains local response data, while receiving the response data sent by the child node. The intermediate data node then filters the local response data and the received response data of the child node and sends the filtering results to the intermediate data node's parent node. The intermediate data nodes at each level sequentially perform the above query and filtering process until the central node receives the filtering results sent by the central node's child node. Finally, the central node determines the paged data to be displayed based on the single-page data volume and the received filtering results, and sends a response message containing the paged data to be displayed to the client. The data query method provided in the embodiment of the present application constructs a distributed data network, and transmits the response data hierarchically that each node has locally queried in response to the user's data request to the central node, and the response data of at least one node is screened during each level of transmission, and the transmission and screening processing 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 efficiency of data query; the amount of data transmitted to the central node after the hierarchical screening processing is small, avoiding the concentration of a large amount of data processing process on the central node, and further avoiding the update and upgrade of equipment and the addition of additional equipment, and realizing efficient data query at the software level, effectively reducing the cost of data query.

[0085] In one embodiment, the client's data request may include data query conditions in addition to the single-page data volume. Accordingly, the central node 10 generates a target data volume (i.e., the data volume represented by the data query parameters described above) that is greater than the single-page data volume based on the single-page data volume. The data query parameters may include the target data volume, the data query conditions, and the query time.

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

[0087] The embodiment described above provides a solution for the central node to determine the paged data to be displayed based on the amount of single-page data and the filtering results sent by the received child nodes. In another embodiment of the present application, all the filtered data received by the central node can be directly paged and displayed, that is, as shown above Figure 5 In this case, the central node performs different paging data determination processes based on the home page and non-home page.

[0088] When a user performs a data query on the client and views the query results (i.e., the home page data) for the first time, this embodiment includes the following: Figure 6 Steps shown:

[0089] Step 201: Split all the screening results according to the amount of data on a single page, determine the number of pages for displaying all the screening results, and determine the data corresponding to each page.

[0090] Step 202: Send the first page data and the page number to the client.

[0091] In the embodiment of the present application, after receiving the screening results sent by each child node, the central node 10 can first sort all the screening results. Specifically, the similarity between each data in the screening results and the data query condition can be determined, and then the query results can be sorted in descending order of similarity. Alternatively, the sorting can be performed in descending order of the time since the data was generated.

[0092] Next, the central node 10 splits the sorted filtering results in turn, and the data volume of each split data is the data volume of a single page. During the splitting process, each split data is marked with a page number in turn until the data volume of the last split data is less than or equal to the data volume of a single page. The splitting of the filtering results is completed, and the page number of the last split data is the number of pages displayed in the pagination of all filtering results.

[0093] Finally, the central node 10 generates a response message based on the first split data, that is, the first page data and the number of pages, and sends it to the client to instruct the client to Figure 5The figure shows the data of the first page and the page number labels.

[0094] When the user continues to view data on other pages (except the home page), the paging data determination process includes the following: Figure 7 Steps shown:

[0095] Step 301: Split all the filter results according to the amount of data on a single page, determine the number of pages for displaying all the filter results, and determine the data corresponding to each page.

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

[0097] In this embodiment of the present application, all the screening results are split according to the above embodiment. After obtaining the data and page number corresponding to each page, the page to be displayed is determined based on the paging type in the data request and the currently displayed page. For example, if the currently displayed page is page 1 and the paging type is next page, the page to be displayed is page 2; if the currently displayed page is page 5 and the paging type is previous page, the page to be displayed is page 4.

[0098] Alternatively, the page to be displayed may be directly determined based on the page type in the data request. For example, if the page type is page number 3, it indicates that the user wants to view the third page of data, and therefore, the page to be displayed is directly determined to be page 3.

[0099] 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 when the data is split. 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.

[0100] In the method provided in the embodiment of the present application, the central node of the distributed data network splits all the screening results sent by the child nodes according to the amount of single-page data, determines the number of pages displayed for all the screening results, and the data corresponding to each page. Then, the data of the first page and the number of page numbers are sent to the client, or the page to be displayed is determined according to the page turning type and the currently displayed page, and the data of the page to be displayed is obtained according to the data corresponding to each page. In the embodiment of the present application, each node responds to the user's data request query and transmits the response data to the central node after hierarchical filtering. The data finally transmitted to the central node ensures validity while effectively reducing the amount of data, avoiding the concentration of a large amount of data processing processes on the central node, thereby avoiding the update and upgrade of equipment and the addition of additional equipment. Efficient data query can be achieved at the software level, effectively reducing the cost of data query.

[0101] The embodiment described above provides a solution for the central node to determine the paging data to be displayed based on the amount of single-page data and the screening results sent by the received child nodes. In another embodiment of the present application, a data query only obtains the data that the user currently needs to view. When the user views other pages of data, the query is re-performed based on the distributed data network to ensure the accuracy of the data query results. That is, the embodiment of the present application implements the above Figure 4 The paging display mode shown in FIG. 1 includes the following Figure 8 Steps shown:

[0102] Step 401 : Sort the screening results in descending order of the distance from the data generation time to the query time.

[0103] Step 402: Select the top N data from the sorting results according to the amount of data on a single page as the data to be displayed in pages.

[0104] Wherein, N is the number of representations of single-page data volume.

[0105] In an embodiment of the present application, after the central node 10 receives the filtering results sent by each child node, it sorts all the filtering results in order from the data generation time to the query time, and selects the top N data in the sort as the data to be displayed in the page, that is, selects the data of a single page of data as the data to be displayed in the page, and discards the remaining data.

[0106] In one possible implementation, the central node 10 first compares the data size of the received filtering results with the data size of a single page. If the data size of the filtering results is less than or equal to the data size of a single page, no filtering operation is performed, and all filtering results are directly sent to the client for display. This also indicates that the user's data query results are relatively few and can be fully displayed on a single page. Therefore, the query status of the adjacent pages is set to unavailable, that is, the "Previous Page" and "Next Page" buttons on the client are set to unavailable.

[0107] If the amount of data in the filter results received by the central node 10 is greater than the amount of data in a single page, the first N data are sorted and selected as the data to be displayed in the page, and the remaining data are discarded. At the same time, it indicates that the user has obtained enough query results for the data query, so the query status of the adjacent pages is set to viewable, that is, the "previous page" and / or "next page" on the client are set to be clickable.

[0108] In one embodiment, since each time a user views a page of data, the data corresponding to the page needs to be queried again based on the distributed data network, different query conditions need to be set to distinguish data in different pages. The specific central node can set the query conditions corresponding to different pages according to the query time, and the intermediate data node implements the query of the corresponding page data based on the query conditions.

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

[0110] The data query process of the intermediate data node based on the query time condition may include the following: Figure 9 Steps shown:

[0111] Step 501: Search the local data of the intermediate data node for data that meets the data query condition and whose data generation time meets the query time condition, and obtain the local response data of the intermediate data node.

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

[0113] Step 503: Select the top M data from the sorting results according to the target data volume, and send them to the parent node of the intermediate data node.

[0114] Here, M is the number represented by the target data volume, that is, M is an integer greater than N; preferably, M=N+1.

[0115] When the paging type is "First Page," the query time condition is that the data generation time is less than the query time. When the paging type is "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 data displayed on the current page. When the paging type is "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 data displayed on the current page. The current page is the paging currently displayed on the client.

[0116] The first target data is the current page display data that is ranked first after sorting the current page display data in the order of data generation time from the nearest to the query time. The second target data is the current page display data that is ranked first after sorting the current page display data in the order of data generation time from the nearest to the query time.

[0117] In the embodiment of the present application, the data request includes a page turning type, and the page turning type indicates the paged data that the user wants to view.

[0118] The data query condition and 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, where x is the target data volume.

[0119] 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: if the data generation time is less than the query time, it instructs the intermediate data node 21 or the end data node 30 to query data that meets the data query condition and has a data generation time before the current time, and obtains local response data. The intermediate data node 21 then receives the response data sent by the child node, sorts the local response data and the received child node response data in order from the data generation time to the query time, and selects the top M data to send to the parent node, that is, selects the target amount of data and sends it to the parent node, realizing the transmission of the response data at the level of the intermediate data node.

[0120] When the paging type is next page, central node 10 first determines the oldest data in the current page (the first target data), that is, the data whose generation time is farthest from the query time. It then determines the query time condition to be 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 next page of data is temporally continuous with the current page data. For example, if the query time of the current page data obtained is 9:45, and the data generation time of the current page data obtained is within the range of 9:30-9:45, then when querying the next page of data, the query time condition is that the data generation time is before 9:30. After the intermediate data node 21 finds 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 according to the above data sorting and filtering method and sends them to the parent node.

[0121] When a user needs to view updated data during the viewing process, that is, when they click the "Previous Page" button, the central node 10 first determines the most recent data (the second target data) within the current page's data, i.e., the data whose generation time is closest to the query time. It then determines the query time condition to be that the data generation time is greater than the data generation time of the second target data within the data displayed on the current page. This means that the data on the previous page is also temporally continuous with the current page data. For example, if the current page is page 3 and the data generation time of the retrieved current page data is within the range of 10:10-10:30, then when querying the previous page data, the query time condition is that the data generation time is after 10:30. After the intermediate data node 21 retrieves local response data that meets both the data query condition and the query time condition (e.g., data generation time after 10:30), it selects M data items according to the aforementioned data sorting and filtering method and sends them to the parent node.

[0122] In the method provided in the embodiment of the present application, the intermediate data node searches the local data for data that meets the data query conditions and whose data generation time meets the query time conditions, and obtains the local response data of the intermediate data node. The local response data of the intermediate data node and the response data of the received child node are sorted in the order from the data generation time to the query time. The top M data are selected from the sorting result according to the target data volume, and sent to the parent node of the intermediate data node. Finally, the central node sorts the various screening results received from the child node in the order from the data generation time to the query time, and selects the top N data from the sorting result as the data to be displayed on the page according to the single-page data volume. In each data query, the embodiment of the present application only queries the data on the page to be displayed. When the user needs to view the previous or next page of data, the data query is performed again to ensure the accuracy of the queried data on the page to be displayed.

[0123] In one embodiment, a distributed data network is provided, comprising a central node, at least one hierarchically arranged node group, and an end data node, each node group comprising at least one intermediate data node. The central node is configured to receive a data request from a client, generate a data query parameter based on the single-page data volume carried in the data request, and send the data query parameter to the intermediate data node; the data volume represented by the data query parameter is greater than the single-page data volume; the intermediate data node is configured to send the data query parameter to the child node until the end data node receives the data query parameter and receives response data sent by the child node; the local response data of the intermediate data node and the received response data of the child node are filtered according to the data query parameter, and the filtering result is sent 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 response data is obtained according to the data query parameter; the central node is further configured to determine the paging data to be displayed based on the single-page data volume and the received filtering result, and send a response message to the client, the response message carrying the paging data to be displayed.

[0124] In an embodiment of the present application, after receiving a data request, the central node 10 can analyze the data request, generate data query parameters based on the analysis results, 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.

[0125] When the central node 10 sends data query parameters, it can first send the data query parameters to the child node of the central node 10, that is, the level 1 intermediate data node; then, the level 1 intermediate data node sends the data query parameters to its own child node, that is, the level 2 intermediate data node, until the data query parameters are transmitted to the end data node 30 through hierarchical sending.

[0126] After the data query parameters are passed to the end data node 30, the end data node 30 can query the local data according to the data query parameters and obtain multiple data that meet the user's data request instructions, that is, obtain multiple data that meet the user's needs. The end data node 30 can then filter the queried data based on the data volume represented by the data query parameters and send the filtered data to the parent node of the end data node 30, that is, the intermediate data node 21 at the previous level of the end data node 30. The intermediate data node 21 then receives the data sent by the child node, which is the response data of the end data node 30, that is, the data ultimately obtained by the end data node 30 after querying the local data according to the data query parameters in response to the client's data request.

[0127] For the upper-level intermediate data node 21 of the end data node 30, the local data of the intermediate data node 21 is queried according to the data query parameters in accordance with the data query method of the end data node 30, obtaining the local response data of the intermediate data node 21. The intermediate data node 21 then determines the local response data and the total amount of response data received from each end data node 30, and compares the total amount of data with the amount of data represented by the data query parameters. If the total amount of data reaches the amount represented by the data query parameters, all data is directly sent to the upper-level intermediate data node 21 of the intermediate data node 21. If the total amount of data exceeds the amount represented by the data query parameters, the local response data and the received response data are filtered, and the amount of data after filtering is equal to the amount of data represented by the data query parameters. Finally, the intermediate data node 21 sends the filtered data to the upper-level intermediate data node 21.

[0128] After the central node 10 receives the data sent by each child node (i.e., the received filtering results), it can filter the received data according to the single-page data volume of the client. The filtered data volume is the single-page data volume. The data filtered by the central node 10 is used as the paging data to be displayed, and a response message is generated based on the paging data to be displayed and sent to the client to instruct the client to display the paging data to be displayed.

[0129] The distributed data network provided by the embodiment of the present application transmits the response data obtained by each node in response to the user's data request to the central node in a hierarchical manner when implementing the data query function, and filters 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, thereby avoiding the centralized transmission and processing of a large amount of data and ensuring the efficiency of data query; the amount of data transmitted to the central node after the hierarchical screening process is small, avoiding the concentration of a large amount of data processing on the central node, thereby avoiding the update and upgrade of equipment and the addition of additional equipment, and realizing efficient data query at the software level, effectively reducing the cost of data query. The distributed processing of data by the intermediate data nodes at each level can also avoid network congestion and further improve the efficiency of data query.

[0130] It should be noted that although the operations of the present method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the illustrated operations must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.

[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the 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 above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases 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 processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0133] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in this 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 arranged in a hierarchical manner and an end data node connected to the endmost 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 node is used to interact with the end data node, and 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 a data query parameter based on the single-page data volume carried in the data request, and sends the data query parameter to the data node; the data volume represented by the data query parameter is greater than the data volume represented by the single-page data volume; and the data request also includes a query time; The data node is used to query the local data of the data node according to the data query parameter to obtain local response data; wherein, The intermediate data node sends the data query parameters to the child node until the end data node receives the data query parameters, and receives response data sent by the child node; the response data is obtained according to the data query parameters; The intermediate data node sorts and filters the local response data of the intermediate data node and the response data received from the child nodes according to the data query parameters in the order of the data generation time from the nearest to the query time, and sends the filtering results to the parent node of the intermediate data node until the central node receives the filtering results sent by the child nodes of the central node; the data volume corresponding to the filtering results is greater than the data volume of the single page; The central node determines the paged data to be displayed based on the single-page data volume and the received screening result, and sends a response message to the client, where the response message carries the paged data to be displayed.

2. The method according to claim 1, characterized in that The data request from the client also includes data query conditions; The data query parameters include a target data volume, the data query condition, and the query time; the target data volume is greater than the single-page data volume.

3. The method according to claim 2, characterized in that The data request from the client further includes a page turning type; the page turning 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.

4. The method according to claim 2, characterized in that The central node determines the paging data to be displayed based on the single page data volume and the received screening result, including: Splitting all the filtering results according to the amount of data on a single page, determining the number of pages for displaying all the filtering results in pages, and the data corresponding to each page; The first page of data and the page number are sent to the client.

5. The method according to claim 3, characterized in that The central node determines the paging data to be displayed based on the single page data volume and the received screening result, including: Splitting all the filtering results according to the amount of data on a single page, determining the number of pages for displaying all the filtering results in pages, and the data corresponding to each page; The page to be displayed is determined according to the page turning type and the currently displayed page, and the data of the page to be displayed is acquired according to the data corresponding to each page.

6. The method according to claim 3, characterized in that The central node determines the paging data to be displayed based on the single page data volume and the received screening result, including: Sorting the screening results in descending order of the time at which the data of the screening results were generated from the query time; According to the single-page data volume, the top N data are selected from the sorting results as the paging data to be displayed; N is the number represented by the single-page data volume.

7. The method according to claim 3, characterized in that The data query parameters further include a query time condition, and the query time condition is used to limit the display data of the page corresponding to the page turning type based on the data generation time.

8. The method according to claim 7, characterized in that When the page turning type is the first page, the query time condition is that the data generation time is less than the query time; when the page turning 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 data displayed on the current page; when the page turning 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 data displayed on the current page; The first target data is the current page display data that is ranked first after sorting each of the current page display data in the order from near to far of the data generation time. The second target data is the current page display data that is ranked first after sorting each of the current page display data in the order from far to near of the data generation time.

9. The method according to claim 8, characterized in that The intermediate data node sorts and filters the local response data of the intermediate data node and the response data received from the child nodes according to the data query parameters in the order of the data generation time from the nearest to the query time, including: Searching the local data of the intermediate data node for data that meets the data query condition and whose data generation time meets the query time condition, and obtaining local response data of the intermediate data node; Sort the local response data of the intermediate data node and the response data received from the child node in the order of the data generation time from the nearest to the query time; The top M data are selected from the sorting results according to the target data volume and sent to the parent node of the intermediate data node; M is the number 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 arranged in a hierarchical manner and an end data node connected to the end 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 node is used to interact with the end data node, and the remaining intermediate node layers are 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 a data query parameter based on the single-page data volume carried in the data request, and send the data query parameter to the data node; the data volume represented by the data query parameter is greater than the single-page data volume; and the data request also includes a query time; The data node is used to query the local data of the data node according to the data query parameter to obtain local response data; wherein, The intermediate data node is used to send the data query parameters to the child nodes until the end data node receives the data query parameters and receives 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 of data generation time from the nearest to the query time according to the data query parameters, and send the filtering results to the parent node of the intermediate data node until the central node receives the filtering results sent by the child nodes of the central node; the data volume corresponding to the filtering results is greater than the data volume of the single page; 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 single page data volume and the received screening result, and send a response message to the client, where the response message carries 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