Data query method and device, equipment, medium and product

The central node system addresses resource overhead and inaccurate query results by dynamically determining query page numbers based on client requests and new data, ensuring accurate and efficient data retrieval across multiple systems.

CN119066112APending Publication Date: 2024-12-03CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411120606.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing data processing systems require large storage resources due to storing full data from multiple devices or systems, leading to high resource overhead and inaccurate query results when new data is generated.

Method used

A central node system that only triggers data queries upon request, determining the actual page number based on the client's query and new data additions, without pre-storing all data, thereby reducing resource overhead and ensuring accurate query results.

Benefits of technology

Reduces storage and network overhead while ensuring accurate query results by dynamically determining the query page number based on client requests and new data, avoiding duplication or omission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066112A_ABST
    Figure CN119066112A_ABST
Patent Text Reader

Abstract

The invention discloses a data query method and device, equipment, a medium and a product, and relates to the technical field of data processing. The data query method is applied to a center node, the center node is in communication connection with at least two data nodes, after receiving a data query request of a client, the center node triggers a data query operation and requests data of a corresponding page number from the corresponding data node, full data of each data node does not need to be stored in advance, the resource overhead is reduced, and the data query efficiency is improved. And when the data is newly added to the data node, the actually queried page number can be determined according to the current request page number of the client, the number of the newly added data and the paging size, so that the problem of repeated or missing query data is effectively avoided, and the accuracy of a data query result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data query method, device, equipment, medium and product. Background Art

[0002] With the development of science and technology and the popularization of the Internet, people's lifestyles have undergone tremendous changes. Especially for some service industries, people's demands for convenience and real-time services are growing.

[0003] For example, in some scenarios, users need to query multiple types of data, but due to the different types of data, the devices or systems that store the data are also different, and each device or system only provides a query interface for its own data. In order to meet the user's query needs, the current common practice is to establish a data processing node, which is responsible for collecting, storing and managing data from different systems or devices, and responding to the user's query requests and returning the query results to the user.

[0004] However, since the data processing node stores the data of each device or system, it takes up a large amount of storage space, resulting in a large resource overhead. Moreover, when the system or device generates new data, the data processing node cannot return accurate query results to the user. Summary of the invention

[0005] The embodiments of the present application provide a data query method, apparatus, device, medium and product, which can solve the problems of high resource overhead and inaccurate query results in related technologies when users need to query data across systems or devices.

[0006] In a first aspect, an embodiment of the present application provides a data query method, which is applied to a central node, the central node is in communication connection with at least two data nodes, each data node stores data by page, and each page in each data node contains the same amount of data;

[0007] The data query method includes:

[0008] Receive a first cross-node data query request sent by a client, the first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, the first data node includes at least two of the at least two data nodes;

[0009] In response to the first cross-node data query request, requesting each first data node to obtain first data corresponding to the first query page number;

[0010] In the case where new data is added to the target data node, the second query page number is determined according to the first query page number, the amount of new data, and the amount of data contained in each page, and the target data node is at least one of the first data nodes;

[0011] Requesting the target data node to obtain second data corresponding to the second query page number according to the second query page number;

[0012] A first data query result is determined according to the first data and the second data, and the first data query result is returned to the client.

[0013] In a second aspect, an embodiment of the present application provides a data query device, which is applied to a central node, the central node is communicatively connected to at least two data nodes, each data node stores data by page, and each page in each data node contains the same amount of data;

[0014] The data query device comprises: a receiving module, a requesting module, a determining module and a sending module;

[0015] A receiving module, configured to receive a first cross-node data query request sent by a client, wherein the first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, wherein the first data node includes at least two of the at least two data nodes;

[0016] A request module, configured to, in response to the first cross-node data query request, request each first data node to obtain first data corresponding to the first query page number;

[0017] a determination module, configured to determine, when new data is added to the target data node, a second query page number according to the first query page number, the amount of new data, and the amount of data contained in each page, wherein the target data node is at least one of the first data nodes;

[0018] The request module is further used to request the target data node to obtain the second data corresponding to the second query page number according to the second query page number;

[0019] The determination module is further used to determine the first data query result according to the first data and the second data;

[0020] The sending module is used to return the first data query result to the client.

[0021] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0022] processor;

[0023] a memory for storing computer program instructions;

[0024] When the computer program instructions are executed by a processor, the method according to the first aspect is implemented.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which implement the method described in the first aspect when the computer program instructions are executed by a processor.

[0026] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method described in the first aspect.

[0027] In an embodiment of the present application, the central node is connected to at least two data nodes for communication, and the central node receives a first cross-node data query request sent by a client; in response to the first cross-node data query request, the central node requests each first data node to obtain the first data corresponding to the first query page number; in the case of new data added to the target data node, the second query page number is determined according to the first query page number, the number of new data added, and the number of data contained in each page; according to the second query page number, the target data node is requested to obtain the second data corresponding to the second query page number; according to the first data and the second data, the first data query result is determined, and the first data query result is returned to the client. That is, the central node of the embodiment of the present application triggers a data query operation after receiving the data query request from the client, and requests the corresponding data node for the data of the corresponding page number, without pre-saving the full amount of data of each data node, reducing resource overhead, and when the data node adds new data, the actual query page number can be determined according to the current request page number of the client and the number and paging size of the new data, effectively avoiding the problem of duplication or omission of query data, and improving the accuracy of the data query result. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 A schematic diagram of a scenario of a data query method provided in an embodiment of the present application;

[0030] Figure 2 A flowchart of a data query method provided in an embodiment of the present application;

[0031] Figure 3 A flowchart of another data query method provided in an embodiment of the present application;

[0032] Figure 4A schematic diagram of a first page of data provided in an embodiment of the present application;

[0033] Figure 5 A schematic diagram of data of a part of a page number after newly added data provided in an embodiment of the present application;

[0034] Figure 6 A flowchart of another data query method provided in an embodiment of the present application;

[0035] Figure 7 A schematic diagram of the interaction process between a client, a central node and a data node provided in an embodiment of the present application;

[0036] Figure 8 A structural diagram of a data query device provided in an embodiment of the present application;

[0037] Fig. 9 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0039] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0040] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0041] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0042] As mentioned above, different types of data are usually stored in different systems or devices. In order to meet the user's query needs for multiple types of data, related technologies have established a data processing node responsible for collecting, storing and managing data from different systems or devices. However, saving the full amount of data from each system or device requires a large amount of storage space, resulting in a very large resource overhead.

[0043] Furthermore, when the system or device generates new data, the data processing node cannot return accurate query results to the user.

[0044] To this end, the embodiments of the present application provide a data query method, device, equipment, medium and product. The central node will trigger the data query operation only after receiving the data query request from the client, and request the corresponding page number data from the corresponding data node. There is no need to pre-save the full data of each data node, which reduces resource overhead. Moreover, when new data is added to the data node, the central node can determine the actual queried page number based on the offset of the new data, effectively avoiding the problem of duplication or omission of query data, and improving the accuracy of data query results.

[0045] The data query method provided in the embodiment of the present application can be applied to application scenarios of querying data across systems or across devices.

[0046] For example, a specific application scenario is in the financial industry, where the user's account types are divided into one type of account such as a debit card, a second type of account such as a virtual account, and a third type of account such as a virtual coin purse. Different account types store different types of billing data. The user needs to query the billing data of at least two of the above accounts. Through the solution recorded in the embodiment of the present application, the central node does not need to pre-save the full amount of data of each data node, which reduces resource overhead, and when the data of the queried account is newly added, the accuracy of the query result can be guaranteed.

[0047] The data query method, device, equipment, medium and product provided in the embodiments of the present application are described below in combination with the above application scenarios and specific embodiments.

[0048] Figure 1 A schematic diagram of a scenario of a data query method provided in an embodiment of the present application, the scenario may include a client 100, a central node 101 and at least two data nodes 102, Figure 1Taking two data nodes 102 as an example, they correspond to data node A and data node C respectively. In actual application, more data nodes may be included. There may also be multiple clients 100. Figure 1 Take a client 100 as an example.

[0049] The client 100 is connected to the central node 101 in communication, and the central node 101 is connected to each data node 102 in communication. When the user needs to query data across nodes, the client 100 mainly sends a cross-node data query request to the central node 101. The client 100 can be, for example, a mobile phone, a computer, or other device.

[0050] The central node 101 mainly responds to the cross-node data query request sent by the client 100, requests the corresponding data node 102 to obtain data, and returns the data to the client 100 after processing. Exemplarily, the central node 101 can be a device such as a laptop, tablet computer, server, etc. with data processing function.

[0051] The data node 102 is used to store data. When storing data, it can be stored by page and by time, that is, each data node 102 can store multiple pages of data, and each page of data can be arranged in a certain order, for example, it can be arranged in reverse chronological order. The embodiment of the present application does not specifically limit the data content of each page of data. The number of data contained in each page in the same data node 102 can be the same, and the number of each page of data in different data nodes 102 can be the same. For example, each page can contain 10 pieces of data. The data node 102 can be, for example, a system or a device, and each data node 102 can correspond to a system or a device.

[0052] During the whole process, the central node 101 does not need to store the full amount of data of each data node 102, thereby greatly reducing storage space and resource overhead. At the same time, when data node 102 adds new data, the query result can be determined based on the client's current request page number and the offset of the new data, avoiding duplication and omission of query data and improving the accuracy of the query result.

[0053] Figure 2 A flowchart of a data query method provided in an embodiment of the present application, which can be applied to Figure 1 The central node shown is Figure 2 As shown, the data query method may include the following steps:

[0054] S210: Receive a first cross-node data query request sent by a client.

[0055] The first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, and the first data node includes at least two of the at least two data nodes.

[0056] S220. In response to the first cross-node data query request, request each first data node to obtain the first data corresponding to the first query page number.

[0057] S230: When new data is added to the target data node, determine the second query page number according to the first query page number, the amount of new data, and the amount of data contained in each page.

[0058] The target data node is at least one of the first data nodes.

[0059] S240: Request the target data node to obtain second data corresponding to the second query page number according to the second query page number.

[0060] S250: Determine a first data query result according to the first data and the second data, and return the first data query result to the client.

[0061] The central node of the embodiment of the present application triggers a data query operation after receiving a data query request from a client, and requests data of the corresponding page number from the corresponding data node. There is no need to pre-save the full data of each data node, thereby reducing resource overhead. Moreover, when new data is added to the data node, the actual queried page number can be determined based on the client's current requested page number and the amount and paging size of the new data, thereby effectively avoiding the problem of duplicate or missing query data and improving the accuracy of data query results.

[0062] The above steps are described in detail below:

[0063] In S210, the first cross-node data query request is a request sent by the client to query data in different data nodes. The embodiment of the present application does not limit the specific content of the data, for example, it may include billing data, communication data, etc.

[0064] The first cross-node data query request may include a first query page number and a first data node corresponding to the first query page number. Here, the first query page number may be any page number contained in the first data node. For example, the first query page number may include the first page of the first data node, that is, querying the first page of data of the first data node. Of course, the first query page number may also be querying the second page of data, the third page of data, etc. of the first data node.

[0065] The first data node may include at least two of the plurality of data nodes in communication with the central node, that is, the user wishes to query data across the nodes.

[0066] Exemplarily, after receiving the user's cross-node data query input, the client can send a first cross-node data query request to the central node. The cross-node data query input may include the user's touch input, voice input, or gesture input to the client, and the touch input here may include but is not limited to the user's single click, double click, long press, slide, and other inputs to the client.

[0067] In S220, the first data is data in the first data node corresponding to the first query page number. For example, if the first query page number is the first page, the first data is the first page data of the first data node.

[0068] After the central node receives the first cross-node data query request, it can request each first data node to obtain the first data corresponding to the first query page number. That is, the central node will trigger the data query operation and request the first data node to obtain the corresponding data only after receiving the first cross-node data query request. There is no need to pre-store the full data of each data node, nor to update the data in real time. This can not only greatly save storage space and reduce resource overhead, but also reduce network overhead caused by updating data and the risk of data leakage.

[0069] Exemplarily, after receiving the first cross-node data query request sent by the client, the central node can send a data acquisition request to the corresponding first data node based on the relationship between the first query page code and the first data node, and the data acquisition request can include the first query page code.

[0070] Taking the first data node including data node A and data node B as an example, assuming that the first query page number is the second page, the central node can send a first data acquisition request to data node A and a second data acquisition request to data node B in parallel. The first data acquisition request can include the first page, that is, requesting to obtain the first page of data of data node A. The second data acquisition request can include the first page, that is, requesting to obtain the first page of data of data node B. By requesting to obtain corresponding data from multiple data nodes in parallel, the query efficiency and timeliness of data can be improved.

[0071] In S230, the target data node is at least one of the above-mentioned multiple first data nodes, that is, there can be one or more data nodes that generate new data. When there are multiple data nodes that generate new data, the central node performs a similar processing on each data node that generates new data.

[0072] When the central node requests data from the data node, the data node can provide the central node with the total amount of data currently contained. The central node can determine whether the data node has new data based on the comparison of the total amount of data currently received with the total amount of data received last time. For example, if the total amount of data currently received is greater than the total amount of data received last time, it can be determined that the data node has generated new data and the data node is determined as the target data node.

[0073] For example, when a data node arranges data in reverse chronological order, if the data node generates new data, the new data is located at the front of the data node, that is, at the front of the first page of the data node, and other data on the first page are moved back in sequence. The amount of data contained in each page can be set according to actual needs, for example, each page can include 10 pieces of data.

[0074] The second query page number is a re-determined query page number, that is, the page number that the central node actually requests from the target data node. The second query page number may include multiple ones, and the second query page number may include the first query page number or may not include the first query page number, which is specifically related to the amount of newly added data, such as when the newly added data. For example, when the amount of newly added data is less than the paging size, the second query page number may include the first query page number, and when the amount of newly added data is greater than or equal to the paging size, the second query page number does not include the first query page number.

[0075] Taking into account that the newly added data will affect the data arrangement of the target data node, in order to avoid duplication or omission of query results, for example, the page number actually requested from the target data node can be determined based on the client's current request page number, that is, the first query page number, and the amount of newly added data and the paging size, that is, the amount of data contained in each page, to obtain the second query page number.

[0076] That is, when a data node generates new data, the embodiment of the present application can redetermine the page number requested by the central node to the target data node based on the page number currently requested by the client and the offset of the new data, ensuring that the queried data is not duplicated or missed.

[0077] In S240, the second data is the data included in the second query page number of the target data node. After the central node determines the second query page number, it can request the data of the second query page number from the target data node. Among them, when the second query page number includes multiple page numbers, the central node can request data from the target data node respectively in sequence, or can request data from the target data node at the same time.

[0078] Taking the second query page number including the third page and the fourth page as an example, the central node may first request the data of the third page from the target data node, and after receiving the data of the third page, continue to request the data of the fourth page from the target data node. Alternatively, the central node may request the data of the third page and the fourth page from the target data node at the same time.

[0079] In S250, illustratively, the central node may perform deduplication, integration, sorting, and other processing on the first data and the second data to obtain a first data query result. The specific processing method is related to the needs of the user.

[0080] Taking the first data node including data node A and data node B as an example, when the central node requests data node A and data node B for data of the second page, it is found that data node A generates new data. At this time, data node A can be determined as the target data node.

[0081] The first data here may include the second page data of data node B, and the second data may include the data of the second query page number of data node A. In some embodiments, the data of the second query page number of data node A may be deduplicated, and then the deduplicated data and the second page data of data node B may be arranged in chronological order to obtain the first query result, which is returned to the client.

[0082] In some embodiments, if the amount of deduplicated data is greater than the paging size, data of the same amount as the paging size can be selected in chronological order and sorted with the second page data of data node B to obtain the first query result and return it to the client.

[0083] While ensuring the accuracy of query results, it reduces the resource overhead and network overhead of the central node, reduces the risk of data leakage, and ensures the timeliness of query results.

[0084] Figure 3 A flowchart of another data query method provided in an embodiment of the present application, Figure 3 and Figure 2 The difference is that Figure 2 The S230 in the Figure 3 S2301-S2302 in.

[0085] S2301. Round the ratio of the amount of newly added data to the amount of data contained in each page to obtain a rounding result.

[0086] The rounding here may be rounding down, for example, if the ratio of the amount of newly added data to the amount of data contained in each page is a decimal between 0 and 1, the rounding result is 0. For another example, if the ratio of the amount of newly added data to the amount of data contained in each page is a decimal between 1 and 2, the rounding result is 1.

[0087] S2302: Determine a second query page number according to the first query page number and the rounding result.

[0088] Exemplarily, the page number corresponding to the cumulative sum of the first query page number and the rounding result can be determined as the second query page number. For example, if the first query page number is 2 and the rounding result is 0, then the second query page number is 2+0=2.

[0089] The first page of data of data node A is queried from the central node as follows Figure 4 As shown in the figure, 1-10 represent each piece of data. When the central node queries the second page of data, data node A generates 3 new pieces of data, such as Figure 5 The shaded part, in this case, the second page data queried by the central node is the second page data after the newly added data, that is, the three data at the end of the second page (numbered 18, 19, 20) are moved to the third page, and the three data at the end of the first page (numbered 8, 9, 10) are moved to the second page. As a result, the second page data obtained by the central node at this time is missing three data (numbered 18, 19, 20) and repeated three data (numbered 8, 9, 10). The repeated part has been obtained when querying the first page data.

[0090] To further improve the accuracy of the query result, illustratively, the above S2302 may include the following steps:

[0091] Perform modulo processing on the amount of newly added data and the amount of data contained in each page to obtain a modulo result;

[0092] When the modulo result is equal to 0, the page number corresponding to the cumulative sum of the first query page number and the rounding result is determined as the second query page number;

[0093] When the modulo result is greater than 0, the page number corresponding to the cumulative sum of the first query page number and the rounding result and the next page number of the page number corresponding to the cumulative sum are determined as the second query page number.

[0094] The remainder result here includes 0 or greater than 0. Exemplarily, when the remainder result is 0, the second query page number = the first query page number + [the number of newly added data / the page size], and when the remainder result is greater than 0, the second query page number = the first query page number + [the number of newly added data / the page size] + 1. Wherein, [the number of newly added data / the page size] represents the ratio of the number of newly added data to the page size is rounded.

[0095] Taking the first query page number equal to 2 as an example, if when the central node requests the second page data from data node A, data node A has added 13 new data, then the second query page number = the first query page number + [the number of new data / the page size] = 3. At the same time, because the number of new data%the page size>0, the second query page number = the first query page number + [the number of new data / the page size] + 1 = 4. That is, the second query page number is equal to 3 and 4, which means that the central node needs to continue to request the third and fourth pages of data from the data node.

[0096] When the target data node generates new data, the embodiment of the present application re-determines the request page number of the central node to the target data node based on the client's current request page number and the offset of the new data, effectively avoiding duplication and omission of query data and improving the accuracy of the query results.

[0097] Figure 6 A flowchart of another data query method provided in an embodiment of the present application, Figure 6 and Figure 2 The difference is that Figure 2 The S240 in the Figure 6 S2401-S2404 in.

[0098] S2401. Determine a second data node other than a target data node from each first data node.

[0099] Taking the first data node including data node A and data node B as an example, if the target data node is data node A, the second data node is data node B. Of course, the target data node can also be data node A and data node B. In this case, the second data node is empty. When the second data node is empty, it does not affect the execution of the solution.

[0100] S2402. Delete the first data corresponding to the target data node obtained by the request.

[0101] Since the target data node generates new data, the data of the first query page number of the node previously obtained can be discarded, that is, the first data of the node previously obtained is deleted.

[0102] Taking the target data node as data node A and the first query page number as 2, the central node can discard the data of the second page requested this time, that is, the second page data after the newly added data, and request data from the target data node again in the manner of the above embodiment.

[0103] S2403. Deduplication is performed on the second data corresponding to the second query page number of the target data node requested to be obtained according to the third data corresponding to the third query page number of the target data node to obtain the deduplication second data.

[0104] The third query page number is the page number before the first query page number, for example, if the first query page number is 2, the third query page number is 1. The third data is the data of the third query page number, for example, when the third query page number is 1, the third data is the data of the first page of the target data node.

[0105] Still taking the example of adding 13 new data as an example, the data requested by the second query page number and the data requested by the third query page number are partially repeated, and the repeated parts are numbered 8, 9, and 10. Therefore, the second data corresponding to the second query page number can be deduplicated according to the third data corresponding to the third query page number to obtain the deduplicated second data.

[0106] For example, the second query page numbers are 2 and 3, and a total of 20 data are obtained, of which 3 data are repeated with the third data obtained previously. After deduplication, the obtained second data includes 17 items, numbered 11-27.

[0107] S2404. Determine a first data query result based on the deduplicated second data and the first data corresponding to the first query page number of the second data node.

[0108] Exemplarily, the deduplicated second data and the first data of the first query page number of the second data node may be sorted, integrated, or otherwise processed to obtain data corresponding to the second query page number requested by the client.

[0109] Considering that the second query page number re-determined at the target data node includes multiple page numbers, that is, the number of the second data after actual deduplication is greater than the paging size, in order to ensure the accuracy of the query result and meet the query requirements of the user, the above S2404 may include the following steps:

[0110] Filtering fourth data from the second data after deduplication in order from front to back, the amount of the fourth data being the same as the amount of data included in each page;

[0111] Integrate and sort the fourth data and the first data corresponding to the first query page number of the second data node to obtain an integrated and sorted result;

[0112] The integrated and sorted result is determined as the first data query result.

[0113] Here, the fourth data is the data with the same number and paging size that is selected from the second data after deduplication in order. Taking the target data node as data node A, the second data node as data node B, and the first query page number as 2 as an example, the second data after deduplication is numbered 11-27, and the number is 17>10, then the central node can select the data numbered 11-20 as the fourth data, and use the fourth data as the second page data, which corresponds exactly to the first page data requested previously, and there will be no duplication or omission.

[0114] The re-obtained fourth data and the second page data of data node B are integrated and sorted to obtain the cross-node second page data, thereby satisfying the user's cross-node query requirements.

[0115] When determining the first query result based on the deduplicated second data and the first data of the second data node, the embodiment of the present application first sequentially filters out data with the same quantity as the paging size from the deduplicated second data, and then integrates and sorts the filtered data and the first data, thereby effectively avoiding duplication and omission of query data and ensuring the accuracy of the first query result.

[0116] It should be understood that when a data node generates new data and the modulo result of the amount of new data and the paging size is greater than 0, the central node needs to request data of multiple pages from the data node for one request from the client. In order to ensure the accuracy of the query result, in some embodiments, when the modulo result of the amount of new data and the amount of data contained in each page is greater than 0, after returning the first data query result to the client, the data query method may further include the following steps:

[0117] receiving a second cross-node data query request sent by the client, where the second cross-node data query request includes a fourth query page number;

[0118] In response to the second cross-node data query request, requesting the target data node to obtain fifth data corresponding to a fifth query page number and requesting the second data node to obtain sixth data corresponding to a fourth query page number, the fifth query page number being greater than the fourth query page number;

[0119] A second data query result is determined according to the fifth data and the sixth data, and the second data query result is returned to the client.

[0120] Here, the fourth query page number is the next page number of the first query page number, that is, for the client, after requesting the first page of data, it can continue to request the second data, then request the third page of data, and so on, that is, the client requests in sequence. The page number requested by the central node to the data node can be the same as or different from the page number requested by the client, which is related to whether the data node has added new data. For example, if the data node keeps the data unchanged, the central node can request the data node for the page number requested by the client. If the data of the data node is newly added, the central node needs to re-determine the page number requested from the data node.

[0121] That is, the page number requested by the central node to the node with newly added data is different from the page number requested by the node without newly added data. Only in this way can the page query requirements initiated by users be met.

[0122] When the fourth query page number is the next page number of the first query page number, the fifth query page number is the next page number of the second query page number, and accordingly, the fifth data is the data of the fifth query page number of the target data node, and the sixth data is the data of the fourth query page number of the second data node.

[0123] Taking the first query page number as 2 as an example, the above embodiment can determine that the second query page numbers are 3 and 4. When the fourth query page number is 3, the fifth query page number is 5. That is, the central node needs to request the fifth page data from the target data node and request the third page data from the second data node.

[0124] The method for determining the second query result is similar to the method for determining the first query result, and will not be described in detail here.

[0125] That is, when a data node generates new data, the embodiment of the present application can adaptively determine the actual request page numbers of different data nodes based on the data query request sent by the client, and request corresponding data from the corresponding data node based on the actual request page number, thereby ensuring the accuracy of the query results.

[0126] Combine the following Figure 7 The interaction process among the client, the central node and the data node is described, wherein the data node is taken as an example of data node A and data node B. Each page of data node A and data node B contains the same amount of data.

[0127] S700 : The client requests the first page of data of data node A and data node B from the central node.

[0128] S701: The central node requests the first page of data from data node A.

[0129] S702: The central node requests the first page of data from the data node B. S701 and S702 may be executed in parallel.

[0130] S703: Data node A returns the first page of data to the central node.

[0131] S704. Data node B returns the first page of data to the central node.

[0132] S705: Sort the received first page of data.

[0133] S706: Return the sorting result to the client.

[0134] S707: The client requests the central node for the second page data of data node A and data node B.

[0135] S708: The central node requests data node A for the second page of data.

[0136] S709: The central node requests the data node B for the second page of data.

[0137] S710. Data node B returns the second page of data to the central node.

[0138] S711. Data node A returns the second page of data after the newly added data to the central node.

[0139] S712: The central node discards the second page of data after the newly added data returned by data node A.

[0140] S713. The central node requests the (client's current requested page number + [number of newly added data / page size])th page of data from data node A.

[0141] S714. Data node A returns the (client's current requested page number + [number of newly added data / page size])th page of data to the central node.

[0142] S715: If the amount of newly added data% of the page size>0, the central node continues to request the (client current request page number+[the amount of newly added data / the page size]+1)th page of data from data node A.

[0143] S716. Data node A returns the (client current request page number + [number of newly added data / page size] + 1)th page of data to the central node.

[0144] S717: De-duplicate, integrate and sort the data to obtain the second page of data.

[0145] S718. Return the second page data to the client.

[0146] The above takes the query of the first page of data and the second page of data as an example. In actual application, more pages of data can be queried according to the needs of the client until the query of data node A and data node B is completed, or the client stops the request and the query ends.

[0147] The central node of the embodiment of the present application does not need to store the full data of each data node, which reduces resource usage and network overhead and enhances data security. At the same time, when the data node generates new data, the actual request page number of the central node is re-determined based on the offset of the new data and the page number currently requested by the client, thereby ensuring duplication and omission of query data and improving the accuracy of the query results.

[0148] Figure 8 A structural diagram of a data query device provided in an embodiment of the present application, such as Figure 8 As shown, the data query device 800 may include: a receiving module 801, a request module 802, a determination module 803 and a sending module 804;

[0149] A receiving module 801 is configured to receive a first cross-node data query request sent by a client, wherein the first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, and the first data node includes at least two of the at least two data nodes;

[0150] A request module 802 is used to request, in response to the first cross-node data query request, to obtain first data corresponding to the first query page number from each first data node respectively;

[0151] A determination module 803 is used to determine a second query page number according to the first query page number, the amount of the newly added data, and the amount of data contained in each page when the target data node has newly added data, and the target data node is at least one of the first data nodes;

[0152] The request module 802 is further configured to request the target data node to obtain the second data corresponding to the second query page number according to the second query page number;

[0153] The determination module 803 is further used to determine the first data query result according to the first data and the second data;

[0154] The sending module 804 is used to return the first data query result to the client.

[0155] In an embodiment of the present application, the central node is connected to at least two data nodes for communication, and the central node receives a first cross-node data query request sent by a client; in response to the first cross-node data query request, the central node requests each first data node to obtain the first data corresponding to the first query page number; in the case of new data added to the target data node, the second query page number is determined according to the first query page number, the number of new data added, and the number of data contained in each page; according to the second query page number, the target data node is requested to obtain the second data corresponding to the second query page number; according to the first data and the second data, the first data query result is determined, and the first data query result is returned to the client. That is, the central node of the embodiment of the present application triggers a data query operation after receiving the data query request from the client, and requests the corresponding data node for the data of the corresponding page number, without pre-saving the full amount of data of each data node, reducing resource overhead, and when the data node adds new data, the actual query page number can be determined according to the current request page number of the client and the number and paging size of the new data, effectively avoiding the problem of duplication or omission of query data, and improving the accuracy of the data query result.

[0156] In some embodiments, the determination module 803 is specifically configured to:

[0157] The ratio of the amount of newly added data to the amount of data contained in each page is rounded to obtain a rounded result;

[0158] The second query page number is determined according to the first query page number and the rounding result.

[0159] In some embodiments, the determination module 803 is specifically configured to:

[0160] Perform modulo processing on the amount of newly added data and the amount of data contained in each page to obtain a modulo result;

[0161] When the modulo result is equal to 0, the page number corresponding to the cumulative sum of the first query page number and the rounding result is determined as the second query page number;

[0162] When the modulo result is greater than 0, the page number corresponding to the cumulative sum of the first query page number and the rounding result and the next page number of the page number corresponding to the cumulative sum are determined as the second query page number.

[0163] In some embodiments, the determination module 803 is specifically configured to:

[0164] Determine a second data node other than the target data node from each first data node;

[0165] Delete the first data corresponding to the target data node requested;

[0166] According to the third data corresponding to the third query page number of the target data node, deduplication processing is performed on the second data corresponding to the second query page number of the target data node requested to obtain, so as to obtain the deduplicated second data, wherein the third query page number is the previous page number of the first query page number;

[0167] A first data query result is determined according to the deduplicated second data and the first data corresponding to the first query page number of the second data node.

[0168] In some embodiments, the determination module 803 is specifically configured to:

[0169] Filtering fourth data from the second data after deduplication in order from front to back, the amount of the fourth data being the same as the amount of data included in each page;

[0170] Integrate and sort the fourth data and the first data corresponding to the first query page number of the second data node to obtain an integrated and sorted result;

[0171] The integrated and sorted result is determined as the first data query result.

[0172] In some embodiments, the receiving module 801 is further configured to, when the modulo result of the amount of newly added data and the amount of data included in each page is greater than 0, receive a second cross-node data query request sent by the client after the sending module 804 returns the first data query result to the client, the second cross-node data query request including a fourth query page number;

[0173] The request module 802 is further configured to, in response to the second cross-node data query request, request the target data node to obtain fifth data corresponding to a fifth query page number and request the second data node to obtain sixth data corresponding to a fourth query page number, the fifth query page number being greater than the fourth query page number;

[0174] The determination module 803 is further used to determine the second data query result according to the fifth data and the sixth data;

[0175] The sending module 804 is further configured to return the second data query result to the client.

[0176] Figure 8 Each module in the device shown has the function of realizing Figure 2-Figure 7 The functions of each step in the process can achieve the corresponding technical effects, so for the sake of brevity, they will not be described in detail here.

[0177] Based on the same inventive concept, the embodiment of the present application also provides an electronic device, which may be, for example, a mobile phone, a tablet computer, a laptop computer, a PDA, etc. Fig. 9 The electronic device provided in the embodiments of the present application is described in detail.

[0178] like Fig. 9 As shown, the electronic device 900 may include a processor 910 and a memory 920 for storing computer program instructions.

[0179] The processor 910 may include a central processing unit (CPU) or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0180] The memory 920 may include a large capacity memory for data or instructions. For example, but not limitation, the memory 920 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape or a universal serial bus (USB) drive or a combination of two or more of these. In one example, the memory 920 may include a removable or non-removable (or fixed) medium, or the memory 920 is a non-volatile solid-state memory. In one example, the memory 920 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0181] The processor 910 reads and executes the computer program instructions stored in the memory 920 to implement Figure 2-Figure 7 The method in the embodiment shown in the figure is achieved Figure 2-Figure 7 The corresponding technical effects achieved by executing the method in the illustrated embodiment are not described in detail here for the sake of brevity.

[0182] In one example, the electronic device 900 may further include a communication interface 930 and a bus 940. Fig. 9 As shown, the processor 910, the memory 920, and the communication interface 930 are connected via a bus 940 and communicate with each other.

[0183] The communication interface 930 is mainly used to implement communication between various modules, devices and / or equipment in the embodiments of the present application.

[0184] Bus 940 includes hardware, software or both, and each component of electronic device 900 is coupled to each other.For example, but not limitation, bus 940 may include accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, front side bus (Front Side Bus, FSB), hypertransmission (Hyper Transport, HT) interconnection, industry standard architecture (IndustryStandard Architecture, ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 940 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0185] The electronic device can execute the data query method in the embodiment of the present application after receiving the first cross-node data query request sent by the client, thereby realizing the combination Figure 2-Figure 7 The data query method described and Figure 8 Describe the data query device.

[0186] In addition, in combination with the data query method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data query methods in the above embodiment is implemented.

[0187] In addition, in combination with the address processing method in the above embodiments, the embodiments of the present application also provide a computer program product, including a computer program, which is executed by at least one processor to implement the various processes of any one of the data query methods in the above embodiments, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0188] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0189] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0190] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0191] The above reference is according to the method of the present application embodiment, the flow chart of the device (system) and the computer program product and / or the block diagram of the present application embodiment. It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0192] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A data query method, characterized in that: Applied to a central node, the central node is in communication connection with at least two data nodes, each of the data nodes stores data in pages, and each page in each data node contains the same amount of data; The data query method comprises: Receive a first cross-node data query request sent by a client, where the first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, where the first data node includes at least two of the at least two data nodes; In response to the first cross-node data query request, respectively requesting each of the first data nodes to obtain first data corresponding to the first query page number; In the case where new data is added to the target data node, a second query page number is determined according to the first query page number, the amount of new data, and the amount of data contained in each page, and the target data node is at least one of the first data nodes; Requesting the target data node to obtain second data corresponding to the second query page number according to the second query page number; A first data query result is determined according to the first data and the second data, and the first data query result is returned to the client.

2. The method according to claim 1, characterized in that The determining the second query page number according to the first query page number, the amount of newly added data, and the amount of data contained in each page includes: Rounding the ratio of the amount of the newly added data to the amount of data contained in each page to obtain a rounding result; The second query page number is determined according to the first query page number and the rounding result.

3. The method according to claim 2, characterized in that The determining the second query page number according to the first query page number and the rounding result includes: Performing a modulo process on the amount of the newly added data and the amount of data contained in each page to obtain a modulo result; When the modulo result is equal to 0, a page number corresponding to the cumulative sum of the first query page number and the rounding result is determined as the second query page number; When the modulo result is greater than 0, the page number corresponding to the cumulative sum of the first query page number and the rounding result and the next page number of the page number corresponding to the cumulative sum are determined as the second query page number.

4. The method according to any one of claims 1 to 3 is characterized in that: The determining a first data query result according to the first data and the second data includes: Determine a second data node other than the target data node from each of the first data nodes; Deleting the first data corresponding to the target data node obtained by the request; Deduplication processing is performed on the second data corresponding to the second query page number of the target data node requested to be obtained according to the third data corresponding to the third query page number of the target data node, so as to obtain the deduplication-free second data, wherein the third query page number is the previous page number of the first query page number; The first data query result is determined according to the deduplicated second data and the first data corresponding to the first query page number of the second data node.

5. The method according to claim 4, characterized in that The determining the first data query result according to the deduplicated second data and the first data corresponding to the first query page number of the second data node includes: Filtering fourth data from the second data after deduplication in order from front to back, the amount of the fourth data being the same as the amount of data included in each page; Integrate and sort the fourth data and the first data corresponding to the first query page number of the second data node to obtain an integrated and sorted result; The integrated and sorted result is determined as the first data query result.

6. The method according to claim 4, characterized in that When the modulo result of the amount of the newly added data and the amount of data contained in each page is greater than 0, after returning the first data query result to the client, the method further includes: Receive a second cross-node data query request sent by the client, where the second cross-node data query request includes a fourth query page number; In response to the second cross-node data query request, request the target data node to obtain fifth data corresponding to a fifth query page number and request the second data node to obtain sixth data corresponding to the fourth query page number, the fifth query page number being greater than the fourth query page number; A second data query result is determined according to the fifth data and the sixth data, and the second data query result is returned to the client.

7. A data query device, characterized in that: Applied to a central node, the central node is in communication connection with at least two data nodes, each of the data nodes stores data in pages, and each page in each data node contains the same amount of data; The data query device comprises: a receiving module, a requesting module, a determining module and a sending module; The receiving module is configured to receive a first cross-node data query request sent by a client, wherein the first cross-node data query request includes a first query page number and a first data node corresponding to the first query page number, and the first data node includes at least two of the at least two data nodes; The request module is configured to, in response to the first cross-node data query request, request each of the first data nodes to obtain the first data corresponding to the first query page number; The determination module is used to determine the second query page number according to the first query page number, the amount of newly added data and the amount of data contained in each page when new data is added to the target data node, and the target data node is at least one of the first data nodes; The request module is further configured to request, according to the second query page number, the target data node to obtain second data corresponding to the second query page number; The determining module is further used to determine a first data query result according to the first data and the second data; The sending module is used to return the first data query result to the client.

8. An electronic device, characterized in that: include: processor; a memory for storing computer program instructions; When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 6.