A data retrieval method and device, computer equipment and storage medium

By generating a unified query identifier and sending unified data retrieval requests for each table sequentially, the problem of wasted network bandwidth when the browser and server retrieve large amounts of data is solved, resulting in a more efficient data retrieval success rate.

CN114547058BActive Publication Date: 2025-11-11BEIJING HENGAN JIAXIN SAFETY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210152869.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2025-11-11
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

When browsers and servers perform large-scale data retrieval, existing technologies suffer from wasted network bandwidth, especially when querying partitioned databases, where the same search criteria need to be transmitted multiple times.

Method used

By obtaining a unified data retrieval request, a unified query identifier is generated, and unified data retrieval requests for each table matching the number of tables are sent sequentially. The query results are then aggregated and updated, and finally, the aggregated results are fed back to the client as the target retrieval result.

Benefits of technology

It reduced network traffic consumption, improved the success rate of data retrieval, and reduced network bandwidth waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114547058B_ABST
    Figure CN114547058B_ABST
Patent Text Reader

Abstract

This invention discloses a data retrieval method, apparatus, computer device, and storage medium. The method includes: acquiring a unified data retrieval request input by a user; sending the unified data retrieval request to a server and receiving a unified query identifier and the number of sub-tables to be retrieved from the server; sending sub-table unified data retrieval requests matching the number of sub-tables to the server sequentially based on the unified query identifier; updating the aggregated retrieval results of each sub-table unified data retrieval request received from the server; and, upon determining that the processing of all sub-table query results is complete, using the currently updated aggregated retrieval results as the target retrieval result matching the unified data retrieval request. This invention solves the problem of wasted bandwidth due to the large amount of data processed during sub-table retrieval queries, reducing network traffic consumption and improving the success rate of data retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data retrieval method, apparatus, computer equipment and storage medium. Background Technology

[0002] With the continuous progress of the times, science and technology are also constantly developing. Browsers frequently need to make data retrieval requests to servers, and data retrieval queries need to be performed between the browser and the server. Therefore, the amount of data that needs to be accessed can sometimes be in the tens of thousands.

[0003] During the invention process, the inventor discovered the following shortcomings of the existing technology: Currently, when data retrieval and querying from a browser to a server involves a very large amount of data, the server will perform data partitioning. When the browser performs loop queries on the partitioned database, it needs to transmit the same search conditions to the server multiple times, resulting in a waste of network bandwidth and network traffic. Summary of the Invention

[0004] This invention provides a data retrieval method, apparatus, computer device, and storage medium, which can reduce network traffic consumption and improve the success rate of data retrieval.

[0005] In a first aspect, embodiments of the present invention provide a data retrieval method, executed by a client, comprising:

[0006] Obtain a unified data retrieval request input by the user, wherein the unified data retrieval request includes retrieval conditions;

[0007] The unified data retrieval request is sent to the server, and the server sends back the unified query identifier and the number of retrieval tables, wherein there are multiple retrieval tables.

[0008] Based on the unified query identifier, a unified data retrieval request for each sub-table is sent to the server sequentially, matching the number of sub-tables. The server then updates the aggregated retrieval results of the sub-table query results corresponding to the unified data retrieval request for each sub-table.

[0009] When it is determined that the processing of the table subquery results for all sub-tables is complete, the currently updated summary retrieval result is used as the target retrieval result that matches the unified data retrieval request.

[0010] Secondly, embodiments of the present invention provide a data retrieval method, executed by a server, comprising:

[0011] Receive a unified data retrieval request sent by the client, and extract retrieval conditions from the unified data retrieval request;

[0012] Based on the search criteria, determine the number of sub-tables corresponding to the search sub-tables, and generate a unified query identifier that matches the unified data retrieval request;

[0013] The number of table partitions and the unified query identifier are fed back to the client, and the unified query identifier and the search conditions are stored together.

[0014] Based on the unified data retrieval requests sent sequentially by the client according to the unified query identifier, which match the number of sub-tables, sub-table query results corresponding to each sub-table are generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially.

[0015] Thirdly, embodiments of the present invention also provide a data retrieval device, executed by a client, wherein the data retrieval device includes:

[0016] A unified data retrieval request acquisition module is used to acquire a unified data retrieval request input by a user, wherein the unified data retrieval request includes retrieval conditions;

[0017] The module for receiving the unified query identifier and the number of retrieval tables is used to send the unified data retrieval request to the server and receive the unified query identifier and the number of retrieval tables from the server, wherein the number of retrieval tables is multiple.

[0018] The summary retrieval result update module is used to send a unified data retrieval request for each sub-table to the server in succession according to the unified query identifier, and to update the summary retrieval results of the sub-table query results corresponding to each unified data retrieval request fed back by the server in succession.

[0019] The target retrieval result determination module is used to, when it is determined that the processing of the table query results of all sub-tables has been completed, take the currently updated summary retrieval result as the target retrieval result that matches the unified data retrieval request.

[0020] Fourthly, embodiments of the present invention also provide a data retrieval device, executed by a server, wherein the data retrieval device includes:

[0021] The search condition extraction module is used to receive a unified data search request sent by the client and extract search conditions from the unified data search request.

[0022] The unified query identifier generation module is used to determine the number of sub-tables corresponding to the search sub-tables based on the search conditions, and generate a unified query identifier that matches the unified data retrieval request.

[0023] The associated storage module is used to feed back the number of table partitions and the unified query identifier to the client, and to associate and store the unified query identifier and the search conditions.

[0024] The table query result feedback module is used to generate table query results corresponding to each table in turn according to the retrieval conditions based on the table unified data retrieval requests sent by the client in turn according to the unified query identifier and matching the number of tables, and to feed back each table query result to the client in turn.

[0025] Fifthly, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data retrieval method as described in any embodiment of the present invention.

[0026] In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data retrieval method as described in any embodiment of the present invention.

[0027] The technical solution provided by this invention involves: acquiring a unified data retrieval request input by a user; sending the unified data retrieval request to a server and receiving a unified query identifier and the number of sub-tables to be retrieved from the server; sending sub-table unified data retrieval requests matching the number of sub-tables to the server sequentially based on the unified query identifier; updating the aggregated retrieval results of the sub-table query results corresponding to each sub-table's unified data retrieval request, and updating the aggregated retrieval results when the processing of the sub-table query results for all sub-tables is completed; and using the currently updated aggregated retrieval results as the target retrieval result matching the unified data retrieval request. This solves the problem of wasted bandwidth due to the large amount of data processed when users perform sub-table retrieval queries, reduces network traffic consumption, and improves the success rate of data retrieval. Attached Figure Description

[0028] Figure 1 This is a flowchart of a data retrieval method provided in Embodiment 1 of the present invention;

[0029] Figure 2 This is a flowchart of another data retrieval method provided in Embodiment 2 of the present invention;

[0030] Figure 3 This is a schematic diagram of the structure of a data retrieval device provided in Embodiment 3 of the present invention;

[0031] Figure 4This is a schematic diagram of another data retrieval device provided in Embodiment 4 of the present invention;

[0032] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Detailed Implementation

[0033] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it.

[0034] It should also be noted that, for ease of description, the accompanying drawings show only the parts relevant to the invention and not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. The process may correspond to a method, function, procedure, subroutine, subprogram, etc.

[0035] The terms "first" and "second," etc., used in the specification, claims, and drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units may include steps or units not listed, but rather steps or units not listed.

[0036] Example 1

[0037] Figure 1 This is a flowchart of a data retrieval method provided in Embodiment 1 of the present invention. This embodiment is applicable to various situations requiring data retrieval by partitioning large amounts of data into tables. The method of this embodiment can be executed by a data retrieval device, which can be implemented by software and / or hardware. The device can be configured in a computer device, which can be a terminal device executed by a client. The present invention does not limit the type of computer device.

[0038] Accordingly, the method specifically includes the following steps:

[0039] S110. Obtain the unified data retrieval request input by the user.

[0040] The unified data retrieval request includes retrieval criteria.

[0041] A unified data retrieval request can be a data retrieval request sent by a client to a server. Specifically, when a client sends a unified data retrieval request to a server, the server performs data retrieval processing based on the received request. Search criteria can be data retrieval conditions entered by the user, and data retrieval processing is performed based on these conditions.

[0042] For example, suppose a user enters a unified data retrieval request in the client as "request to retrieve statistics on the province with the highest per capita annual income of Chinese citizens", the search criteria can be further specified as "statistics on the province with the highest per capita annual income of Chinese citizens".

[0043] S120. Send the unified data retrieval request to the server and receive the unified query identifier and the number of sub-tables for retrieval from the server.

[0044] The number of sub-tables is multiple.

[0045] The unified query identifier can be a unique number generated by the server based on the unified data retrieval request received from the client. This unique number is used to identify the query. The unified query identifier can be a string. The number of shards for retrieval can be the number of shards stored on the server related to the statistical sorting request.

[0046] Continuing the previous example, the client sends a unified data retrieval request to the server. The server parses the request as "request to retrieve statistics on the provinces with the highest per capita annual income of Chinese citizens." Therefore, the search condition is "statistics on the provinces with the highest per capita annual income of Chinese citizens." The server then generates a unified query identifier "XYAB0558" based on the unified search condition, i.e., "statistics on the provinces with the highest per capita annual income of Chinese citizens." The server also obtains the number of retrieval tables, which is 2000. The server sends the unified query identifier "XYAB0558" and the number of retrieval tables "2000" to the client, which then receives and processes the data.

[0047] S130. Based on the unified query identifier, send a unified data retrieval request for each sub-table to the server in succession, matching the number of sub-tables, and update the summary retrieval results of the sub-table query results returned by the server in succession for each unified data retrieval request for each sub-table.

[0048] The unified data retrieval request for each partitioned table can be a data retrieval request sent by the client to the server. Specifically, when a client sends a unified data retrieval request to the server, the server performs a data retrieval query based on the received request. The partitioned table query result can be the retrieval information obtained by the server after each data retrieval of a partitioned table. The summary retrieval result can be a summary of previous partitioned table query results. Specifically, after the server completes the current data retrieval task, it obtains the current partitioned table query result and updates the summary retrieval result with the current partitioned table query result.

[0049] Optionally, based on the unified query identifier, a unified data retrieval request for each sub-table matching the number of sub-tables is sent to the server sequentially, and the sub-table query results corresponding to the unified data retrieval request for each sub-table are updated by summarizing the retrieval results. This includes: obtaining the current retrieval sub-table sequence number, which has a preset initial value; if it is determined that the current retrieval sub-table sequence number is less than or equal to the number of sub-tables, then a unified data retrieval request for each sub-table is constructed based on the statistical query identifier and the current retrieval sub-table sequence number, and the unified data retrieval request for each sub-table is sent to the server; upon receiving the sub-table query results from the server in response to the unified data retrieval request for each sub-table, the current summary retrieval result is updated using the sub-table query results; when it is determined that the update of the summary retrieval result is complete, the current retrieval sub-table sequence number is updated, and the operation of obtaining the current retrieval sub-table sequence number is returned, until the construction of unified data retrieval requests for all sub-tables is completed.

[0050] The current retrieval sub-table number can be the specific index number of the retrieval sub-table in the retrieval server.

[0051] Continuing the previous example, the client, based on the unified query identifier "XYAB0558" and the number of retrieval tables (2000), assumes that the current retrieval table number is 1, which means the preset initial value is determined to be 1. Since the current retrieval table number 1 is less than the number of 2000 tables, a unified data retrieval request is constructed based on the statistical query identifier "XYAB0558" and the current retrieval table number 1, and sent to the server to instruct the server to generate the retrieval table result corresponding to the current retrieval table number 1 and update the summary retrieval result.

[0052] Furthermore, upon confirming the completion of updating the summary search results, the current search sub-table number is updated to 2, and the process returns to retrieve the current search sub-table number until the construction of a unified data search request for all sub-tables is completed.

[0053] Correspondingly, once the current retrieval table number is updated to 2001, the client completes the current data retrieval task.

[0054] The advantage of this setup is that by comparing the current retrieval table number with the number of tables, the client sends the corresponding request command to the server. This makes the data retrieval process clearer and avoids unnecessary data processing, thereby reducing the waste of data resources.

[0055] S140. When it is determined that the processing of the table query results of all sub-tables has been completed, the currently updated summary retrieval result is used as the target retrieval result that matches the unified data retrieval request.

[0056] The target search result can be the corresponding search result obtained based on the unified data search request, that is, the summary search result.

[0057] Continuing the previous example, when the server performs data retrieval on 2000 retrieval tables according to a unified data retrieval request, it obtains the corresponding retrieval results for each table. After each retrieval, the summary retrieval results need to be updated. After completing the data retrieval task for 2000 retrieval tables, the corresponding target retrieval results can be obtained. Specifically, the target retrieval result for "the province with the highest per capita annual income of Chinese citizens" can be: Province A.

[0058] The technical solution provided by this invention involves: acquiring a unified data retrieval request input by a user; sending the unified data retrieval request to a server and receiving a unified query identifier and the number of sub-tables to be retrieved from the server; sending sub-table unified data retrieval requests matching the number of sub-tables to the server sequentially based on the unified query identifier; updating the aggregated retrieval results of the sub-table query results corresponding to each sub-table's unified data retrieval request, and updating the aggregated retrieval results when the processing of the sub-table query results for all sub-tables is completed; and using the currently updated aggregated retrieval results as the target retrieval result matching the unified data retrieval request. This solves the problem of wasted bandwidth due to the large amount of data processed when users perform sub-table retrieval queries, reduces network traffic consumption, and improves the success rate of data retrieval.

[0059] Optionally, after using the currently updated aggregated search results as the target search results matching the unified data search request, the method further includes: constructing a successful search response based on the unified data search request, and feeding the successful search response back to the server to instruct the server to perform data cleaning.

[0060] Continuing from the previous example, when the client sends a successful retrieval response back to the server, the server needs to clear the stored unified query identifier "XYAB0558" and the search condition "the province with the highest per capita annual income of Chinese citizens".

[0061] The advantage of this setup is that when the client sends a successful retrieval response back to the server, the server needs to clear the relevant data. This avoids storing useless data on the server, which would otherwise waste memory resources and reduce bandwidth usage, thereby improving the data retrieval speed.

[0062] Example 2

[0063] Figure 2 This is a flowchart of another data retrieval method provided in Embodiment 2 of the present invention. This embodiment is applicable to various situations requiring data retrieval by partitioning large amounts of data into tables. The method of this embodiment can be executed by a data retrieval device, which can be implemented by software and / or hardware. The device can be configured in a computer device, which can be a server, and the method is executed by the server. The embodiments of the present invention do not limit the type of computer device.

[0064] Accordingly, the method specifically includes the following steps:

[0065] S210. Receive a unified data retrieval request sent by the client, and extract retrieval conditions from the unified data retrieval request.

[0066] For example, the server receives a unified data retrieval request from the client. Specifically, the unified data retrieval request is "to find the province with the highest per capita annual income of Chinese citizens". Based on the received unified data retrieval request, the server extracts the corresponding search criteria, specifically "to find the province with the highest per capita annual income of Chinese citizens".

[0067] S220. Based on the search conditions, determine the number of sub-tables corresponding to the search sub-tables, and generate a unified query identifier that matches the unified data retrieval request.

[0068] Continuing from the previous example, the server can generate a unified query identifier of "XYAB0558" based on the search criteria, namely "the province with the highest per capita annual income of Chinese citizens". The server can also obtain the number of 2000 search sub-tables.

[0069] S230. The number of table partitions and the unified query identifier are fed back to the client, and the unified query identifier and the search conditions are stored together.

[0070] Continuing from the previous example, the server will send the number of table partitions (2000) and the unified query identifier "XYAB0558" back to the client. The server will also store the unified query identifier "XYAB0558" and the search condition "the province with the highest per capita annual income of Chinese citizens" together.

[0071] S240. Based on the unified data retrieval requests for sub-tables sent sequentially by the client according to the unified query identifier, which match the number of sub-tables, generate sub-table query results corresponding to each sub-table sequentially according to the retrieval conditions, and feed back each sub-table query result to the client sequentially.

[0072] Optionally, based on the unified data retrieval requests for sub-tables sent sequentially by the client according to the unified query identifier, matching the number of sub-tables, sub-table query results corresponding to each sub-table are generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially. This includes: whenever a sub-table data detection request sent by the client is received, extracting the unified query identifier and the current retrieval sub-table sequence number included in the sub-table data detection request; determining the matching target sub-table based on the current retrieval sub-table sequence number; obtaining the retrieval conditions matching the unified query identifier, and generating sub-table query results corresponding to the target sub-table based on the retrieval conditions; and feeding back the sub-table query results to the client.

[0073] Continuing the previous example, the server retrieves data from the corresponding partitioned tables based on the unified data retrieval request sent by the client. Specifically, whenever the server receives a partitioned data detection request from the client, it extracts the unified query identifier "XYAB0558" and the current partitioned table number 1 included in the data detection request, and determines the matching target partitioned table based on the current partitioned table number 1.

[0074] Furthermore, the system obtains the search criteria "the province with the highest per capita annual income of Chinese citizens" that matches the unified query identifier "XYAB0558", and generates the sub-table query results corresponding to the target sub-table based on the search criteria, and then feeds the sub-table query results back to the client.

[0075] The advantage of this setting is that, based on the unified query identifier and the current retrieval segment number included in the segment data detection request, the corresponding segment query results are generated, which can avoid the waste of network bandwidth caused by the client sending retrieval conditions to the server multiple times, thereby reducing the cost of network bandwidth.

[0076] Optionally, the method further includes: upon receiving a successful retrieval response from the client, clearing the stored unified query identifier and the retrieval conditions.

[0077] Continuing from the previous example, when the server receives a successful retrieval response, the server needs to clear the stored unified query identifier "XYAB0558" and the search condition "the province with the highest per capita annual income of Chinese citizens".

[0078] The advantage of this setting is that when the server confirms that it has received a successful retrieval response, the server needs to clear the relevant data. This avoids storing useless data on the server, which would waste memory resources and reduce bandwidth usage, thereby improving the data retrieval speed.

[0079] The technical solution provided by this invention receives a unified data retrieval request sent by a client and extracts retrieval conditions from the request. Based on the retrieval conditions, it determines the number of sub-tables corresponding to the retrieval sub-table and generates a unified query identifier matching the unified data retrieval request. The number of sub-tables and the unified query identifier are fed back to the client, and the unified query identifier and the retrieval conditions are stored together. Based on the unified data retrieval requests sent sequentially by the client according to the unified query identifier, each matching the number of sub-tables, a sub-table query result corresponding to each sub-table is generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially. This solves the problem of wasted bandwidth due to large data processing volumes during sub-table retrieval queries, reduces network traffic consumption, improves the success rate of data retrieval, and lowers network bandwidth costs.

[0080] Example 3

[0081] Figure 3 This is a schematic diagram of a data retrieval device provided in Embodiment 3 of the present invention. The data retrieval device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a terminal device to implement a data retrieval method according to the present invention. Figure 3 As shown, the device may specifically include: a unified data retrieval request acquisition module 310, a unified query identifier and retrieval sub-table number receiving module 320, a summary retrieval result update module 330, and a target retrieval result determination module 340.

[0082] The unified data retrieval request acquisition module 310 is used to acquire the unified data retrieval request input by the user, wherein the unified data retrieval request includes retrieval conditions.

[0083] The unified query identifier and the number of retrieval sub-tables receiving module 320 are used to send the unified data retrieval request to the server and receive the unified query identifier and the number of retrieval sub-tables fed back by the server, wherein the number of sub-tables is multiple.

[0084] The summary retrieval result update module 330 is used to send a unified data retrieval request for each sub-table to the server in succession according to the unified query identifier, and to update the summary retrieval result of the sub-table query result corresponding to each unified data retrieval request fed back by the server in succession.

[0085] The target retrieval result determination module 340 is used to take the currently updated summary retrieval result as the target retrieval result that matches the unified data retrieval request when it is determined that the processing of the table query results of all tables has been completed.

[0086] The technical solution provided by this invention involves: acquiring a unified data retrieval request input by a user; sending the unified data retrieval request to a server and receiving a unified query identifier and the number of sub-tables to be retrieved from the server; sending sub-table unified data retrieval requests matching the number of sub-tables to the server sequentially based on the unified query identifier; updating the aggregated retrieval results of the sub-table query results corresponding to each sub-table's unified data retrieval request, and updating the aggregated retrieval results when the processing of the sub-table query results for all sub-tables is completed; and using the currently updated aggregated retrieval results as the target retrieval result matching the unified data retrieval request. This solves the problem of wasted bandwidth due to the large amount of data processed when users perform sub-table retrieval queries, reduces network traffic consumption, and improves the success rate of data retrieval.

[0087] Based on the above embodiments, the summary retrieval result update module 330 can be specifically used for: obtaining the current retrieval sub-table sequence number, which has a preset initial value; if it is determined that the current retrieval sub-table sequence number is less than or equal to the number of sub-tables, then constructing a unified data retrieval request for the sub-tables based on the statistical query identifier and the current retrieval sub-table sequence number, and sending the unified data retrieval request for the sub-tables to the server; upon receiving the sub-table query results fed back by the server for the unified data retrieval request for the sub-tables, using the sub-table query results to update the current summary retrieval result; when it is determined that the update of the summary retrieval result is completed, updating the current retrieval sub-table sequence number, and returning to execute the operation of obtaining the current retrieval sub-table sequence number, until the construction of the unified data retrieval request for all sub-tables is completed.

[0088] Based on the above embodiments, a data cleaning module is also included, which can be specifically used to: after taking the currently updated aggregated search results as the target search results that match the unified data search request, construct a successful search response according to the unified data search request, and feed the successful search response back to the server to instruct the server to perform data cleaning.

[0089] The data retrieval device described above can execute the data retrieval method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0090] Example 4

[0091] Figure 4 This is a schematic diagram of another data retrieval device provided in Embodiment 4 of the present invention. The data retrieval device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a server to implement a data retrieval method according to the embodiments of the present invention. Figure 4 As shown, the device may specifically include: a search condition extraction module 410, a unified query identifier generation module 420, an association storage module 430, and a table query result feedback module 440.

[0092] The retrieval condition extraction module 410 is used to receive a unified data retrieval request sent by the client and extract retrieval conditions from the unified data retrieval request.

[0093] The unified query identifier generation module 420 is used to determine the number of sub-tables corresponding to the retrieval sub-tables according to the retrieval conditions, and generate a unified query identifier that matches the unified data retrieval request.

[0094] The associated storage module 430 is used to feed back the number of table partitions and the unified query identifier to the client, and to associate and store the unified query identifier and the search conditions.

[0095] The table query result feedback module 440 is used to generate table query results corresponding to each table according to the retrieval conditions based on the table unified data retrieval requests sent by the client according to the unified query identifier and matching the number of tables, and to feed back each table query result to the client.

[0096] The technical solution provided by this invention receives a unified data retrieval request sent by a client and extracts retrieval conditions from the request. Based on the retrieval conditions, it determines the number of sub-tables corresponding to the retrieval sub-table and generates a unified query identifier matching the unified data retrieval request. The number of sub-tables and the unified query identifier are fed back to the client, and the unified query identifier and the retrieval conditions are stored together. Based on the unified data retrieval requests sent sequentially by the client according to the unified query identifier, each matching the number of sub-tables, a sub-table query result corresponding to each sub-table is generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially. This solves the problem of wasted bandwidth due to large data processing volumes during sub-table retrieval queries, reduces network traffic consumption, improves the success rate of data retrieval, and lowers network bandwidth costs.

[0097] Based on the above embodiments, the table sub-query result feedback module 440 may specifically include: whenever a table sub-data detection request is received from the client, extracting the unified query identifier and the current searched table sub-table number included in the table sub-data detection request; determining the matching target table based on the current searched table sub-table number; obtaining the search conditions matching the unified query identifier, and generating a table sub-query result corresponding to the target table based on the search conditions; and feeding back the table sub-query result to the client.

[0098] Based on the above embodiments, a unified query identifier and search condition clearing module is also included, which can be specifically used to: clear the stored unified query identifier and search conditions when a successful search response is received from the client.

[0099] The data retrieval device described above can execute the data retrieval method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0100] Example 5

[0101] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Figure 5 As shown, the device includes a processor 510, a memory 520, an input device 530, and an output device 540; the number of processors 510 in the device can be one or more. Figure 5 Taking a processor 510 as an example; the processor 510, memory 520, input device 530, and output device 540 in the device can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0102] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the data retrieval method in this embodiment of the invention (e.g., unified data retrieval request acquisition module 310, unified query identifier and retrieval table number receiving module 320, summary retrieval result update module 330, and target retrieval result determination module 340). The processor 510 executes various functional applications and data processing of the device by running software programs, instructions, and modules stored in the memory 520, thereby implementing the aforementioned data retrieval method. This method includes: acquiring a unified data retrieval request input by a user, the unified data retrieval request including retrieval conditions; sending the unified data retrieval request to a server and receiving a unified query identifier and the number of sub-tables to be retrieved from the server, the number of sub-tables being multiple; according to the unified query identifier, sequentially sending sub-table unified data retrieval requests matching the number of sub-tables to the server, and updating the aggregated retrieval results of the sub-table query results sequentially fed back by the server corresponding to the unified data retrieval request for each sub-table; and, upon determining that the processing of the sub-table query results for all sub-tables is complete, using the currently updated aggregated retrieval result as the target retrieval result matching the unified data retrieval request.

[0103] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs and modules, or program instructions / modules corresponding to the data retrieval method in the embodiments of the present invention (e.g., retrieval condition extraction module 410, unified query identifier generation module 420, association storage module 430 and table query result feedback module 440). The processor 510 executes various functional applications and data processing of the device by running software programs, instructions, and modules stored in the memory 520, thereby implementing the aforementioned data retrieval method. This method includes: receiving a unified data retrieval request sent by a client and extracting retrieval conditions from the unified data retrieval request; determining the number of sub-tables corresponding to the retrieval sub-tables based on the retrieval conditions, and generating a unified query identifier matching the unified data retrieval request; feeding back the number of sub-tables and the unified query identifier to the client, and storing the unified query identifier and the retrieval conditions together; and generating sub-table query results corresponding to each sub-table according to the retrieval conditions based on the sub-table unified data retrieval requests sent sequentially by the client according to the unified query identifier, and feeding back each sub-table query result to the client sequentially.

[0104] The memory 520 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 520 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include memory remotely located relative to the processor 510, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0105] Input device 530 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 540 may include display devices such as a display screen.

[0106] Example 6

[0107] Embodiment 6 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions, when executed by a computer processor, are used to perform a data retrieval method. The method includes: obtaining a unified data retrieval request input by a user, the unified data retrieval request including retrieval conditions; sending the unified data retrieval request to a server, and receiving a unified query identifier and the number of retrieval sub-tables from the server, the number of sub-tables being multiple; according to the unified query identifier, sequentially sending sub-table unified data retrieval requests matching the number of sub-tables to the server, and updating the aggregated retrieval results of the sub-table query results sequentially fed back by the server corresponding to the unified data retrieval request for each sub-table; upon determining that the processing of the sub-table query results for all sub-tables is complete, using the currently updated aggregated retrieval result as the target retrieval result matching the unified data retrieval request.

[0108] Alternatively, the method may include: receiving a unified data retrieval request sent by a client, and extracting retrieval conditions from the unified data retrieval request; determining the number of sub-tables corresponding to the retrieval sub-tables based on the retrieval conditions, and generating a unified query identifier matching the unified data retrieval request; feeding back the number of sub-tables and the unified query identifier to the client, and storing the unified query identifier and the retrieval conditions together; generating sub-table query results corresponding to each sub-table according to the retrieval conditions based on the retrieval conditions for each sub-table in turn, based on the unified data retrieval requests for sub-tables sent sequentially by the client according to the unified query identifier and matching the number of sub-tables, and feeding back each sub-table query result to the client sequentially.

[0109] Of course, the computer-readable instructions provided in the embodiments of the present invention, which include a computer-readable storage medium, are not limited to the method operations described above, but can also perform related operations in the data retrieval method provided in any embodiment of the present invention.

[0110] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0111] It is worth noting that in the embodiments of the above data retrieval device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0112] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A data retrieval method, executed by a client, characterized in that, include: Obtain a unified data retrieval request input by the user, wherein the unified data retrieval request includes retrieval conditions; The unified data retrieval request is sent to the server, and the server sends back the unified query identifier and the number of retrieval tables, wherein there are multiple retrieval tables. Based on the unified query identifier, a unified data retrieval request for each sub-table is sent to the server sequentially, matching the number of sub-tables. The server then updates the aggregated retrieval results of the sub-table query results corresponding to the unified data retrieval request for each sub-table. When it is determined that the processing of the table query results of all tables has been completed, the currently updated summary retrieval result is used as the target retrieval result that matches the unified data retrieval request. Specifically, based on the unified query identifier, a unified data retrieval request for each sub-table is sent to the server sequentially, matching the number of sub-tables. The process also involves updating the aggregated retrieval results of the sub-table query returned by the server for each unified data retrieval request, including: Obtain the current search sub-table index, which has a preset initial value; If it is determined that the current retrieval table number is less than or equal to the number of tables, then a unified data retrieval request for the table is constructed based on the unified query identifier and the current retrieval table number, and the unified data retrieval request for the table is sent to the server; Upon receiving the table query results from the server in response to the unified data retrieval request for the table, the current summary retrieval results are updated using the table query results. When it is determined that the update of the summary search results is completed, the current search sub-table number is updated, and the operation of obtaining the current search sub-table number is returned until the construction of the unified data search request for all sub-tables is completed; The unified query identifier is a unique number generated by the server based on the unified data retrieval request received from the client.

2. The method according to claim 1, characterized in that, After using the currently updated aggregated search results as the target search results matching the unified data retrieval request, the method further includes: A successful retrieval response is constructed based on the unified data retrieval request, and the successful retrieval response is fed back to the server to instruct the server to perform data cleanup.

3. A data retrieval method, executed by a server, characterized in that, include: Receive a unified data retrieval request sent by the client, and extract retrieval conditions from the unified data retrieval request; Based on the search criteria, determine the number of sub-tables corresponding to the search sub-tables, and generate a unified query identifier that matches the unified data retrieval request; The number of table partitions and the unified query identifier are fed back to the client, and the unified query identifier and the search conditions are stored together. Based on the unified data retrieval requests for the sub-tables sent sequentially by the client according to the unified query identifier, which match the number of sub-tables, the sub-table query results corresponding to each sub-table are generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially. Specifically, based on the unified data retrieval requests sent sequentially by the client according to the unified query identifier, matching the number of sub-tables, sub-table query results corresponding to each sub-table are generated sequentially according to the retrieval conditions, and each sub-table query result is fed back to the client sequentially, including: Whenever a table data detection request is received from the client, the unified query identifier and the current table retrieval sequence number included in the table data detection request are extracted; Based on the current retrieval table number, determine the target table to be matched; Obtain the search conditions that match the unified query identifier, and generate the table query results corresponding to the target table based on the search conditions; The results of the table partitioning query are then sent back to the client.

4. The method according to claim 3, characterized in that, The method further includes: Upon receiving a successful retrieval response from the client, the stored unified query identifier and the retrieval conditions are cleared.

5. A data retrieval device, executed by a client, characterized in that, include: A unified data retrieval request acquisition module is used to acquire a unified data retrieval request input by a user, wherein the unified data retrieval request includes retrieval conditions; The module for receiving the unified query identifier and the number of retrieval tables is used to send the unified data retrieval request to the server and receive the unified query identifier and the number of retrieval tables from the server, wherein the number of retrieval tables is multiple. The summary retrieval result update module is used to send a unified data retrieval request for each sub-table to the server in succession according to the unified query identifier, and to update the summary retrieval results of the sub-table query results corresponding to each unified data retrieval request fed back by the server in succession. The target retrieval result determination module is used to take the currently updated summary retrieval result as the target retrieval result that matches the unified data retrieval request when it is determined that the processing of the table query results of all tables has been completed. The summary retrieval result update module is configured to: obtain the current retrieval sub-table number, which has a preset initial value; if it is determined that the current retrieval sub-table number is less than or equal to the number of sub-tables, construct a unified data retrieval request for the sub-table based on the unified query identifier and the current retrieval sub-table number, and send the unified data retrieval request to the server; upon receiving the sub-table query results from the server in response to the unified data retrieval request, update the current summary retrieval result using the sub-table query results; and when it is determined that the update of the summary retrieval result is complete, update the current retrieval sub-table number and return to execute the operation of obtaining the current retrieval sub-table number, until the construction of the unified data retrieval request for all sub-tables is completed. The unified query identifier is a unique number generated by the server based on the unified data retrieval request received from the client.

6. A data retrieval device, executed by a server, characterized in that, include: The search condition extraction module is used to receive a unified data search request sent by the client and extract search conditions from the unified data search request. The unified query identifier generation module is used to determine the number of sub-tables corresponding to the search sub-tables based on the search conditions, and generate a unified query identifier that matches the unified data retrieval request. The associated storage module is used to feed back the number of table partitions and the unified query identifier to the client, and to associate and store the unified query identifier and the search conditions. The table query result feedback module is used to generate table query results corresponding to each table according to the retrieval conditions based on the table unified data retrieval requests sent by the client according to the unified query identifier and matching the number of tables, and to feed back each table query result to the client. The table partition query result feedback module is configured to: whenever a table partition data detection request is received from the client, extract the unified query identifier and the current table partition number included in the table partition data detection request; determine the target table to be matched based on the current table partition number; obtain the search conditions that match the unified query identifier, and generate a table partition query result corresponding to the target table based on the search conditions; and feed the table partition query result back to the client.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data retrieval method as described in any one of claims 1-2, or implements the data retrieval method as described in any one of claims 3-4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the data retrieval method as described in any one of claims 1-2, or implements the data retrieval method as described in any one of claims 3-4.

Citation Information

Patent Citations

  • Data query method and device

    CN110737676A