A method and apparatus for data query

By selecting asynchronous or synchronous query methods based on data volume, and combining the splitting of query information with progress management, the problems of excessive query time and failures in batch online contract signing information queries have been solved, achieving a more efficient query process and improved user experience.

CN116303566BActive Publication Date: 2026-05-05CHINA CONSTRUCTION BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-02-22
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

When performing batch online contract signing information queries, the large amount of data being queried increases the query time, which may exceed the maximum response time set by the system, causing query failure and affecting query efficiency and user experience.

Method used

Based on the amount of data to be queried and the preset quantity threshold, the query method is determined to be asynchronous or synchronous. The query information is split into multiple sub-information for querying, and asynchronous messages and query progress messages are generated. The query process is optimized by combining the query business identifier and the associated storage of result data.

Benefits of technology

It improves query efficiency and success rate, enhances user experience, and avoids query failures caused by excessive data volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303566B_ABST
    Figure CN116303566B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for data querying, relating to the field of big data technology. One specific embodiment of the method includes: responding to a data query request, acquiring the amount of data to be queried and query information; comparing the amount of data to be queried with a preset quantity threshold; if the amount of data to be queried is greater than the quantity threshold, determining that the data query method is asynchronous; otherwise, determining that the data query method is synchronous; and querying the result data corresponding to the data query request based on the data query method and the query information. This embodiment comprehensively considers synchronous and asynchronous queries, expanding the applicable scenarios for real estate online contract signing information queries, avoiding the problems of low query efficiency and query failures caused by excessively large query data volumes, improving query efficiency and success rate, and enhancing the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and in particular to a method and apparatus for data querying. Background Technology

[0002] With the popularization and promotion of internet technology, online property transaction information, as an important assessment tool, is used not only for property transactions but also for purposes such as seizure, mortgage, and identification of specific groups. Currently, the query of individual online transaction information is generally conducted synchronously, with subsequent business processes proceeding only after the results are obtained. However, some functional departments, due to business needs, often perform batch queries of online transaction information for multiple individuals by inputting the information of all those being queried at once.

[0003] In the process of realizing this invention, the inventors discovered the following problems in the prior art:

[0004] In scenarios involving bulk online contract signing information queries, the increased query time for large amounts of data not only consumes more of the user's waiting time but may also exceed the system's maximum response time, leading to query failures and impacting query efficiency and user experience. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and apparatus for data querying. The method determines whether the data query is synchronous or asynchronous based on the amount of data to be queried obtained from the data query request, and then performs the data query in combination with the query information obtained from the query request. By comprehensively considering synchronous and asynchronous queries, the applicable scenarios for real estate online contract signing information query are expanded, and the problems of low query efficiency and query failure caused by excessive query data volume are avoided. This improves query efficiency and query success rate, and enhances the user experience.

[0006] To achieve the aforementioned objective, according to one aspect of the present invention, a data query method is provided, comprising:

[0007] In response to a data query request, obtain the amount of data to be queried and the query information;

[0008] The amount of data to be queried is compared with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous query; otherwise, the data query method is determined to be synchronous query.

[0009] Based on the data query method and the query information, query the result data corresponding to the data query request.

[0010] Optionally, when the data query method is asynchronous, querying the result data corresponding to the data query request according to the data query method and the query information includes: generating an asynchronous message and a query progress message; the asynchronous message is used to asynchronously query the result data corresponding to the data query request.

[0011] Optionally, querying the result data corresponding to the data query request includes: splitting the query information into multiple query sub-information, performing data query based on each query sub-information to obtain the query result corresponding to the query sub-information, and generating the result data based on the query result corresponding to each query sub-information.

[0012] Optionally, the method further includes: after querying the result data corresponding to the data query request according to the data query method and the query information, storing the query service identifier and the result data together, wherein the query service identifier is determined according to the query information.

[0013] Optionally, the query service identifier and the result data can be stored in the form of key-value pairs.

[0014] Optionally, the method further includes: when the data query method is a synchronous query, querying result data corresponding to the data query request according to the data query method and the query information, including: synchronously querying the query result corresponding to the data query request according to the data query method and the query information, associating and storing the query business identifier and the query result to obtain the result data, and then generating a message to indicate that the query is completed, wherein the query business identifier is determined according to the query information.

[0015] Optionally, each of the query sub-information has a batch number, and the batch number has data volume information; after performing data query based on each of the query sub-information to obtain the query result corresponding to the query sub-message, the method further includes: determining the completed data volume of the currently completed query based on the batch number; and determining the query progress based on the completed data volume and the data volume to be queried.

[0016] Optionally, after determining the query progress based on the completed data volume and the data volume to be queried, the method further includes: in response to a query result retrieval request, determining whether the completed data volume is equal to the data volume to be queried; if they are not equal, returning the query progress; if they are equal, returning the result.

[0017] Optionally, the method further includes: before querying the result data corresponding to the data query request according to the data query method and the query information, determining the storage record corresponding to the result data according to the query service identifier, wherein the query service identifier is determined according to the query information.

[0018] According to a second aspect of the present invention, an apparatus for data querying is provided, comprising:

[0019] The module for obtaining the amount of data to be queried is used to respond to data query requests and obtain the amount of data to be queried and query information.

[0020] The query method determination module is used to compare the amount of data to be queried with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous query; otherwise, the data query method is determined to be synchronous query.

[0021] The data query module is used to query the result data corresponding to the data query request based on the data query method and the query information.

[0022] Optionally, the data query module is further configured to: split the query information into multiple query sub-information, perform data query based on each query sub-information to obtain the query result corresponding to the query sub-information, and generate the result data based on the query result corresponding to each query sub-information.

[0023] Optionally, the data query apparatus further includes a result data storage module, configured to: after querying the result data corresponding to the data query request according to the data query method and the query information, associate and store the query service identifier with the result data, wherein the query service identifier is determined according to the query information.

[0024] Optionally, each of the query sub-information has a batch number, and the batch number has data volume information; the data query device further includes a query progress determination module, used to: after performing data query based on each of the query sub-information and obtaining the query result corresponding to the query sub-message, determine the amount of completed data currently queried based on the batch number; and determine the query progress based on the amount of completed data and the amount of data to be queried.

[0025] According to a third aspect of the present invention, an electronic device for data querying is provided, comprising:

[0026] One or more processors;

[0027] Storage device for storing one or more programs.

[0028] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiments of the present invention.

[0029] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the present invention.

[0030] According to a fifth aspect of the present invention, a computer program product is provided. One such computer program product includes a computer program that, when executed by a processor, implements the data query method provided in the embodiments of the present application.

[0031] One embodiment of the invention has the following advantages or beneficial effects: by responding to a data query request, the amount of data to be queried and query information are obtained; the amount of data to be queried is compared with a preset quantity threshold; if the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous; otherwise, the data query method is determined to be synchronous. Based on the data query method and query information, the technical solution of querying the result data corresponding to the data query request achieves the determination of whether the data query method is synchronous or asynchronous based on the amount of data to be queried obtained from the data query request, and then combines this with the query information obtained from the query request to perform the data query. This comprehensively considers synchronous and asynchronous queries, expands the applicable scenarios for real estate online contract signing information queries, avoids the problem of low query efficiency and query failure caused by excessive query data volume, improves query efficiency and query success rate, and enhances the user experience. Attached Figure Description

[0032] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0033] Figure 1 This is a schematic diagram illustrating the main flow of a data query method according to an embodiment of this application;

[0034] Figure 2 This is a schematic diagram illustrating the main flow of a data query method according to an embodiment of this application;

[0035] Figure 3 This is a detailed flowchart illustrating the data query process according to an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram of the main modules of a data query device according to an embodiment of the present invention;

[0037] Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0038] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0039] It should be noted that the collection, updating, analysis, use, transmission, and storage of user personal information involved in the technical solution of this invention all comply with relevant laws and regulations, are used for legitimate and reasonable purposes, and are not shared, disclosed, or sold outside of these legitimate uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken to selectively block the use or access to personal information data to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Furthermore, once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0040] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0041] Currently, in scenarios involving batch online contract signing information queries, the increased query time for large amounts of data not only consumes more of the user's waiting time but may also exceed the system's maximum response time, leading to query failures. This affects query efficiency and user experience, failing to adequately meet practical application needs.

[0042] To address the aforementioned problems in existing technologies, this invention proposes a data query method. The method determines whether to perform a synchronous or asynchronous query based on the amount of data obtained from the query request. It then combines this method with the query information obtained from the query request to perform the data query. By comprehensively considering both synchronous and asynchronous queries, this method expands the applicable scenarios for real estate online contract signing information queries, avoids the problems of low query efficiency and query failures caused by excessively large query data volumes, improves query efficiency and success rate, and enhances the user experience.

[0043] In the description of the embodiments of the present invention, the terms involved and their meanings are as follows:

[0044] SQL: A language for manipulating databases, including creating databases, deleting databases, querying records, modifying records, adding fields, etc.

[0045] Oracle: A relational database management system.

[0046] Figure 1 This is a schematic diagram illustrating the main flow of a data query method according to an embodiment of this application, such as... Figure 1 As shown, the data query method of this embodiment of the invention includes the following steps S101 to S103.

[0047] Step S101: In response to the data query request, obtain the amount of data to be queried and the query information.

[0048] Specifically, for certain functional departments, when needing to conduct batch inquiries into individual online contract signing information, they often import the personal identity and related information of thousands or tens of thousands of people into the query system at once. Then, based on the query requirements, they select the information to be queried in batches (e.g., information on all personal properties, contract information, property descriptions, and sales plans). Alternatively, they can batch edit based on default query information, selecting the data needed for this query from the default pool. Finally, after confirming all query conditions, they click submit to send a query request for property online contract signing information to the query system. Upon receiving the data query request, the query system retrieves the query information for all individuals to be queried, thus obtaining the volume of data to be queried.

[0049] Step S102: Compare the amount of data to be queried with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, determine that the data query method is asynchronous query; otherwise, determine that the data query method is synchronous query.

[0050] Specifically, the main difference between synchronous and asynchronous queries lies in their execution methods. Synchronous queries require the database operation to complete before subsequent business requests can be processed, while asynchronous queries can release threads to handle other business requests before the database operation is complete. Synchronous queries offer better control over the business process but are less efficient and time-consuming. Asynchronous queries, while consuming some resources and offering less control over the business process compared to synchronous queries, are more efficient and save query time. Considering the characteristics of these two query methods, this embodiment of the invention determines whether to use a synchronous or asynchronous query method for online contract signing information based on the amount of data to be queried obtained.

[0051] Furthermore, based on the processing capacity of the query system and business experience, quantity thresholds are set. When the amount of data to be queried exceeds the preset quantity threshold, it can be considered that the query task is large, and the efficiency of synchronous queries will decrease accordingly. When the amount of data to be queried is very large, the query time of synchronous queries may exceed the maximum response time set by the system, leading to the risk of query failure. Therefore, it is more appropriate to choose to use asynchronous queries. When the amount of data to be queried is not greater than the preset quantity threshold, it can be considered that the query task is moderate or small. Accordingly, the query time will not be too long. Synchronous queries with low resource consumption and controllable business processes are prioritized, ensuring the orderly execution of business processes without taking up too much waiting time for users.

[0052] Step S103: Query the result data corresponding to the data query request according to the data query method and the query information.

[0053] According to an embodiment of the present invention, the method further includes: when the data query method is a synchronous query, querying result data corresponding to the data query request according to the data query method and the query information, including: synchronously querying the query result corresponding to the data query request according to the data query method and the query information, associating and storing the query business identifier and the query result to obtain the result data, and then generating a message to indicate that the query is completed, wherein the query business identifier is determined according to the query information.

[0054] Specifically, a query business identifier corresponding to the obtained query information is generated. In this embodiment of the invention, two types of threads are mainly run: a main thread and a sub-thread. The main thread counter is initialized to 1. Synchronous and asynchronous queries use the counter to manage thread occupancy and release. When it is determined that the online contract signing information query uses a synchronous query, the database is queried based on the query information to obtain the query result data. The query result and the corresponding query business identifier are then associated and stored in the result set. Subsequently, the value of the main thread counter is cleared to zero, indicating that the query is complete. At this point, the main thread is released, allowing it to respond to other requests.

[0055] According to another embodiment of the present invention, when the data query method is asynchronous query, querying the result data corresponding to the data query request according to the data query method and the query information includes: generating an asynchronous message and a query progress message; the asynchronous message is used to asynchronously query the result data corresponding to the data query request.

[0056] Specifically, if it's determined that the online contract signing information query is asynchronous, the main thread counter is immediately cleared, releasing the main thread and allowing it to respond to other requests. The online contract signing information query runs in a sub-thread, performing the query based on the information provided and generating corresponding asynchronous messages to asynchronously retrieve the result data.

[0057] According to one embodiment of the present invention, querying result data corresponding to the data query request includes: splitting the query information into multiple query sub-information, performing data query based on each query sub-information to obtain query results corresponding to the query sub-information, and generating the result data based on the query results corresponding to each query sub-information.

[0058] Specifically, considering that batch queries embed a large amount of query information into SQL, database performance bottlenecks can lead to query failures. For example, Oracle databases limit the maximum length of an IN query to 1000 characters, so querying the online contract signing information of tens of thousands of people at once will directly result in query failure. This embodiment of the invention splits the query information into multiple sub-queries, then queries the online contract signing information for each sub-query, and obtains the query result data based on the query results corresponding to each sub-query. Especially in asynchronous queries, where the amount of query information is large, it is even more necessary to split the query information. This embodiment of the invention uses 10 query records as a splitting unit, splitting the query information, querying the online contract signing information in batches using SQL for each sub-query, and storing the query results corresponding to each sub-query in a dedicated result set table to obtain the final result data.

[0059] By splitting the query information into batches as described above, database performance bottlenecks are avoided, ensuring both query success rate and database performance.

[0060] According to another embodiment of the present invention, each of the query sub-information has a batch number, and the batch number has data volume information; after performing data query based on each of the query sub-information to obtain the query result corresponding to the query sub-message, the method further includes: determining the completed data volume of the currently completed query based on the batch number; and determining the query progress based on the completed data volume and the data volume to be queried.

[0061] Specifically, in this embodiment of the invention, 10 query messages are used as a unit for splitting. Each group of query sub-messages is sequentially batch-numbered, for example, 00001 is the first group of query sub-messages, 00005 is the fifth group of query sub-messages. Accordingly, based on the batch number of the current query sub-message, the amount of completed information in the current completed query can be determined. Then, based on the data volume corresponding to each information volume, the amount of completed data in the current completed query can be determined. Finally, based on the amount of completed data and the amount of data to be queried obtained from the data query request, the query progress of the current online contract signing information can be obtained. Furthermore, through the query progress message generated above, the query progress can be queried, allowing users to obtain the query progress and improving the user experience.

[0062] According to another embodiment of the present invention, after determining the query progress based on the completed data volume and the data volume to be queried, the method further includes: in response to a query result retrieval request, determining whether the completed data volume is equal to the data volume to be queried; if they are not equal, returning the query progress; if they are equal, returning the result.

[0063] Specifically, for asynchronous queries, when a user needs to retrieve query results, they can send a query results retrieval request to the query system via the "Results Query" button on the page. Upon receiving the request, the query system determines whether the amount of completed data equals the amount of data to be queried, i.e., whether the query progress is 100% complete. If they are not equal, the query is incomplete; the system calls a query progress message to obtain the current query progress and returns it to the user. Based on the current progress, it estimates the remaining query time and returns the query progress and estimated waiting time to the user. If they are equal, the query is complete; the system calls an asynchronous message to retrieve the result data corresponding to the data query request and returns it to the user.

[0064] Figure 2 This is a schematic diagram illustrating the main flow of a data query method according to an embodiment of this application; as shown below. Figure 2 As shown, the data query method of this embodiment includes the following steps S201 to S204.

[0065] Step S201: In response to the data query request, obtain the amount of data to be queried and the query information.

[0066] Specifically, users log in to the online contract signing information query system, enter the personal identity information of the person to be queried and the query information, and send a query request for the online contract signing information of the house to be queried to the query system. The query system obtains the query information of the person to be queried based on the received query request, and then obtains the amount of data to be queried.

[0067] Step S202: Compare the amount of data to be queried with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, determine that the data query method is asynchronous query; otherwise, determine that the data query method is synchronous query.

[0068] Specifically, taking into account the characteristics of synchronous and asynchronous query methods, the specific data query method is determined by the amount of data to be queried. In different scenarios, the preset quantity threshold can be adjusted adaptively to better meet the needs of various scenarios and improve query efficiency.

[0069] Step S203: Query the result data corresponding to the data query request according to the data query method and the query information.

[0070] Specifically, when the data query method is determined to be synchronous, a synchronous query is performed, combining the query information obtained from the data query request to perform the query, and after obtaining the query results, a message indicating the completion of the query is generated; when the data query method is determined to be asynchronous, an asynchronous query is performed, combining the query information obtained from the data query request to perform the query, and users can obtain asynchronous query results through asynchronous messages.

[0071] According to an embodiment of the present invention, the method further includes: before querying the result data corresponding to the data query request according to the data query method and the query information, determining the storage record corresponding to the result data according to the query service identifier, wherein the query service identifier is determined according to the query information.

[0072] Specifically, a query business identifier can be generated based on the query information obtained from the query request. Before querying the result data corresponding to the data query request according to the data query method and query information, the corresponding stored record can be retrieved from the result set table where the query results are stored in the query system based on the query business identifier. Based on the retrieved stored record, if the query request does not have specific timeliness requirements, the user can directly use the stored record as the query result, or perform another query based on the data query method and query information. If the query request has strict timeliness requirements, the timeliness of the data information in the stored record is used to determine whether the timeliness requirements are met. If they are met, the stored record can be directly used as the query result; otherwise, a further query is performed based on the data query method and query information.

[0073] Step S204: Associate and store the query service identifier and the result data. The query service identifier is determined based on the query information.

[0074] According to one embodiment of the present invention, the query service identifier and the result data are stored in the form of key-value pairs.

[0075] Specifically, considering that existing online contract signing information query systems only return query results to the user who made the query request without storing the result data, if the user needs to query the information again due to data loss or other reasons, they need to initiate the query request again and re-execute the query operation to obtain the query results, increasing the user's repeated waiting time. This embodiment of the invention generates a query business identifier corresponding to the query information using an identifier generation tool based on the obtained query information. After obtaining the result data, the query business identifier and the result data are associated and stored. This embodiment of the invention preferably uses key-value pairs to store the query business identifier and the corresponding result data, so that when the user queries the same query information again, they can retrieve the result data from the result set table containing the stored result data by using the query business identifier determined by the query information as the key.

[0076] In addition, the present invention does not specifically limit the timing of the generation of the query service identifier, as long as it is generated when or before the query service identifier is used.

[0077] By storing the above-mentioned results data, a convenient query service is provided for users. When the query information has historical query records, the previous query results data can be quickly retrieved, avoiding repeated queries, which saves users' query time and conserves resources.

[0078] Figure 3 This is a detailed flowchart illustrating the data query process according to an embodiment of the present invention. The query system sets a quantity threshold. When a user logs into the query system, they send a data query request. The query system determines whether the amount of data to be queried obtained from the query request exceeds the preset quantity threshold. If it does, the query is asynchronous; otherwise, it is synchronous. For synchronous queries, after completion, the result data is stored, and the query progress is updated to "completed." For asynchronous queries, the query information is broken down and queried in batches according to the sub-information. The results of each query are stored, and the query progress is calculated and updated synchronously. Additionally, the query system supports user query results. After a user sends a request to the system to retrieve query results, the system determines whether the amount of completed data is equal to the amount of data to be queried. If they are equal, an asynchronous message is invoked to retrieve the result data corresponding to the data query request and return it to the user. If they are not equal, a query progress message is invoked to retrieve the current query progress and return it to the user. Based on the current query progress, the remaining query time is estimated, and the query progress and estimated waiting time are returned to the user, prompting them to wait.

[0079] Figure 4 This is a schematic diagram of the main modules of a data query device according to an embodiment of the present invention. Figure 4As shown, the data query device 400 mainly includes a data volume acquisition module 401, a query method determination module 402, and a data query module 403.

[0080] The data volume acquisition module 401 is used to obtain the data volume to be queried and query information in response to a data query request.

[0081] The query method determination module 402 is used to compare the amount of data to be queried with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous query; otherwise, the data query method is determined to be synchronous query.

[0082] The data query module 403 is used to query the result data corresponding to the data query request according to the data query method and the query information.

[0083] According to one embodiment of the present invention, the data query module 403 is further configured to generate an asynchronous message and a query progress message when the data query method is asynchronous query; the asynchronous message is used to asynchronously query the result data corresponding to the data query request.

[0084] According to another embodiment of the present invention, the data query module 403 is further configured to: query result data corresponding to the data query request, including: splitting the query information into multiple query sub-information, performing data query based on each query sub-information, obtaining query results corresponding to the query sub-information, and generating the result data based on the query results corresponding to each query sub-information.

[0085] According to an embodiment of the present invention, the data query apparatus 400 may further include a result data storage module (not shown in the figure), which is used to: after querying the result data corresponding to the data query request according to the data query method and the query information, store the query service identifier and the result data together, wherein the query service identifier is determined according to the query information.

[0086] According to another embodiment of the present invention, the query service identifier and the result data are stored in the form of key-value pairs.

[0087] According to another embodiment of the present invention, the data query module 403 is further configured to: when the data query method is synchronous query, synchronously query the query result corresponding to the data query request according to the data query method and the query information, associate and store the query business identifier and the query result to obtain the result data, and then generate a message to indicate that the query is completed, wherein the query business identifier is determined according to the query information.

[0088] According to another embodiment of the present invention, each of the query sub-information has a batch number, and the batch number has data volume information; the data query device 400 may further include a query progress determination module (not shown in the figure), used for: after performing data query according to each of the query sub-information and obtaining the query result corresponding to the query sub-message, determining the current completed data volume according to the batch number; and determining the query progress according to the completed data volume and the data volume to be queried.

[0089] According to an embodiment of the present invention, the data query apparatus 400 may further include a query result acquisition module (not shown in the figure), configured to: after determining the query progress based on the completed data volume and the data volume to be queried, in response to a query result acquisition request, determine whether the completed data volume is equal to the data volume to be queried; if they are not equal, return the query progress; if they are equal, return the result.

[0090] According to an embodiment of the present invention, the data query apparatus 400 may further include a storage record determination module (not shown in the figure), configured to: determine a storage record corresponding to the result data according to a query service identifier before querying the result data corresponding to the data query request according to the data query method and the query information, wherein the query service identifier is determined according to the query information.

[0091] Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied.

[0092] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0093] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as data query applications and online contract signing information query applications (for example only).

[0094] Terminal devices 501, 502, and 503 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0095] Server 505 can be a server providing various services, such as a backend management server (for example only) supporting data queries performed by users using terminal devices 501, 502, and 503. The backend management server can respond to a data query request by obtaining the amount of data to be queried and query information; comparing the amount of data to be queried with a preset quantity threshold; if the amount of data to be queried is greater than the quantity threshold, determining that the data query method is asynchronous; otherwise, determining that the data query method is synchronous; and processing the query results corresponding to the data query request according to the data query method and the query information, and feeding back the processing results (e.g., query results – for example only) to the terminal device.

[0096] It should be noted that the data query method provided in this embodiment of the invention is generally executed by server 505, and correspondingly, the data query device is generally set in server 505.

[0097] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0098] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing terminal devices or servers of the present invention. Figure 6 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0099] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 505 is also connected to the bus 604.

[0100] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0101] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0102] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0104] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including: a module for acquiring the amount of data to be queried, a module for determining the query method, and a data query module.

[0105] In some cases, the names of these modules do not constitute a limitation on the module itself. For example, a data query module can also be described as "a module for querying result data corresponding to the data query request based on the data query method and the query information".

[0106] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to: in response to a data query request, acquire the amount of data to be queried and query information; compare the amount of data to be queried with a preset quantity threshold, and if the amount of data to be queried is greater than the quantity threshold, determine that the data query method is asynchronous; otherwise, determine that the data query method is synchronous; and query result data corresponding to the data query request according to the data query method and the query information.

[0107] The technical solution of the present invention has the following advantages or beneficial effects: by responding to a data query request, the amount of data to be queried and query information are obtained; the amount of data to be queried is compared with a preset quantity threshold; if the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous; otherwise, the data query method is determined to be synchronous; the technical solution of querying the result data corresponding to the data query request according to the query method and query information realizes that the data query method is determined to be synchronous or asynchronous based on the amount of data to be queried obtained from the data query request, and then combined with the query information obtained from the query request to perform data query, comprehensively considering synchronous and asynchronous queries, expanding the applicable scenarios of real estate online contract signing information query, avoiding the problem of low query efficiency and query failure caused by excessive query data volume, improving query efficiency and query success rate, and enhancing the user experience.

[0108] The specific embodiments described herein do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for data querying, characterized in that, include: In response to a data query request regarding online property transaction information, obtain the amount of data to be queried and the query information; The amount of data to be queried is compared with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous query; otherwise, the data query method is determined to be synchronous query. A query service identifier is generated based on the query information obtained from the query request, and the corresponding stored record is retrieved from the result set table where the query results are stored in the query system based on the query service identifier. For the stored record corresponding to the query service identifier, if there is no time limit requirement in the data query request, the stored record is used as the result data corresponding to the data query request, or the result data corresponding to the data query request is queried according to the data query method and the query information. If the data query request has a timeliness requirement, determine whether the timeliness of the data information in the stored record meets the timeliness requirement. If the timeliness of the data information meets the timeliness requirement, use the stored record as the result data corresponding to the data query request. If the timeliness of the data information does not meet the timeliness requirement, query the result data corresponding to the data query request according to the data query method and the query information. When querying the result data corresponding to the data query request according to the data query method and the query information, synchronous query and asynchronous query use a counter to realize the occupation and release of the thread. Synchronous query and asynchronous query run on the main thread and child thread respectively, and the counter of the main thread is initialized to 1. When the data query method is synchronous query, after storing the obtained query results and the corresponding query business identifier in the result set, the value of the main thread's counter is cleared to zero, the main thread is released, and the main thread is allowed to respond to other requests. When the data query method is asynchronous, the counter of the main thread is cleared to zero, the main thread is released, and the asynchronous query runs in the child thread; The query information is divided into multiple query sub-information, each of which has a batch number and the batch number has data volume information. The query results corresponding to the data query request include: Data is queried according to each of the query sub-information to obtain the query result corresponding to the query sub-information; the amount of completed information of the current completed query is determined according to the batch number, and the amount of completed data of the current completed query is determined according to the amount of data corresponding to each information amount; the query progress is determined according to the amount of completed data and the amount of data to be queried; the result data is generated according to the query result corresponding to each of the query sub-information. After determining the query progress based on the completed data volume and the data volume to be queried, the method further includes: responding to a query result retrieval request, determining whether the completed data volume is equal to the data volume to be queried; if they are not equal, calling a query progress message to obtain the current query progress, estimating the remaining query time based on the current query progress, and returning the query progress and the estimated remaining query time; if they are equal, returning the result.

2. The method according to claim 1, characterized in that, When the data query method is asynchronous, the result data corresponding to the data query request is queried according to the data query method and the query information, including: Generate asynchronous messages and query progress messages; the asynchronous messages are used to asynchronously query the result data corresponding to the data query request.

3. The method according to claim 1, characterized in that, The method further includes: After querying the result data corresponding to the data query request according to the data query method and the query information, the query service identifier and the result data are associated and stored. The query service identifier is determined according to the query information.

4. The method according to claim 3, characterized in that, The query service identifier and the result data are stored in key-value pairs.

5. The method according to claim 1, characterized in that, The method further includes: When the data query method is synchronous query, the result data corresponding to the data query request is queried according to the data query method and the query information, including: synchronously querying the query result corresponding to the data query request according to the data query method and the query information, associating and storing the query business identifier and the query result to obtain the result data, and then generating a message to indicate that the query is completed, wherein the query business identifier is determined according to the query information.

6. A data query apparatus, characterized in that, include: The module for obtaining the amount of data to be queried is used to respond to data query requests regarding online housing transaction information and obtain the amount of data to be queried and the query information. The query method determination module is used to compare the amount of data to be queried with a preset quantity threshold. If the amount of data to be queried is greater than the quantity threshold, the data query method is determined to be asynchronous query; otherwise, the data query method is determined to be synchronous query. The storage record determination module is used to generate a query business identifier based on the query information obtained from the query request, and to query the corresponding storage record from the result set table where the query results are stored in the query system based on the query business identifier. The data query module is used to, for the stored record corresponding to the query business identifier, if there is no time limit requirement in the data query request, use the stored record as the result data corresponding to the data query request, or query the result data corresponding to the data query request according to the data query method and the query information; If the data query request has a timeliness requirement, determine whether the timeliness of the data information in the stored record meets the timeliness requirement. If the timeliness of the data information meets the timeliness requirement, use the stored record as the result data corresponding to the data query request. If the timeliness of the data information does not meet the timeliness requirement, query the result data corresponding to the data query request according to the data query method and the query information. Specifically, when querying result data corresponding to the data query request according to the data query method and the query information, synchronous and asynchronous queries use counters to implement thread occupation and release. Synchronous and asynchronous queries run on the main thread and child thread, respectively, and the main thread's counter is initialized to 1. When the data query method is synchronous, after storing the obtained query results and the corresponding query business identifier in the result set, the main thread's counter is cleared to zero, the main thread is released, and the main thread is allowed to respond to other requests. When the data query method is asynchronous, the main thread's counter is cleared to zero, the main thread is released, and the asynchronous query runs in the child thread. The query information is divided into multiple query sub-information, each of which has a batch number and the batch number has data volume information. The data query module is also used for: Data is queried according to each of the query sub-information to obtain the query result corresponding to the query sub-information; the amount of completed information of the current completed query is determined according to the batch number, and the amount of completed data of the current completed query is determined according to the amount of data corresponding to each information amount; the query progress is determined according to the amount of completed data and the amount of data to be queried; the result data is generated according to the query result corresponding to each of the query sub-information. The query result retrieval module is used to, after determining the query progress based on the completed data volume and the data volume to be queried, respond to the query result retrieval request, determine whether the completed data volume is equal to the data volume to be queried; if they are not equal, call the query progress message to obtain the current query progress, estimate the remaining query time based on the current query progress, and return the query progress and the estimated remaining query time; if they are equal, return the result.

7. The apparatus according to claim 6, characterized in that, The data query device further includes a result data storage module, which is used to: after querying the result data corresponding to the data query request according to the data query method and the query information, associate and store the query service identifier with the result data, wherein the query service identifier is determined according to the query information.

8. A mobile electronic device terminal, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data query processing method and system

    CN109492138A

  • Query method, query device and query system

    CN111177478A

  • Data processing method and device

    CN113641713A