A data query method, device, equipment and storage medium

By obtaining data query requests in a remote multi-live architecture system and performing downgrading query processing in the target data center, the response delay problem caused by cross-data center calls is solved, and the response time and service performance of the business system are improved.

CN114880543BActive Publication Date: 2024-11-08CHINA UNIONPAY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210534167.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-11-08
Estimated Expiration
2042-05-17

Smart Images

  • Figure CN114880543B_ABST
    Figure CN114880543B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data query method, device, equipment and storage medium, which relates to the field of data processing technology. The method includes: obtaining a data query request sent by a terminal device, if the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, then obtaining the data generation time of the target business data from the target session identifier, if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset association relationship, and the target query mode is a downgraded query mode, then performing downgrade query processing on the data query request in the target data center. Therefore, when the target business data associated with the target session identifier does not exist in the target data center, the data query request will not be directly sent to other data centers, but downgraded query processing will be performed in the target data center, effectively avoiding the response delay caused by calling data across centers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a data query method, device, equipment and storage medium. Background Art

[0002] With the rapid development of Internet technology, the scale of business systems is getting larger and larger, and the losses caused by each technical failure are immeasurable. In order to improve the disaster recovery capability and availability of business systems, current business systems generally adopt a multi-site active-active architecture, that is, setting up business systems and corresponding data centers in different geographical locations to provide business services.

[0003] However, in a multi-active architecture system, due to the uncertainty of the caller's choice of data center, it is inevitable that data will be called across data centers. Calling data across data centers will cause response delays in the business system, resulting in a decrease in the overall performance of the service. Summary of the invention

[0004] The embodiments of the present application provide a data query method, apparatus, device and storage medium for improving the response time of a business system.

[0005] On the one hand, an embodiment of the present application provides a data query method, which is applied to a business system, and the method includes:

[0006] Acquire a data query request sent by a terminal device, wherein the data query request includes a target session identifier and a target query mode;

[0007] If the target service data associated with the target session identifier does not exist in the target data center corresponding to the service system, obtaining the data generation time of the target service data from the target session identifier;

[0008] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship, and the target query mode is a degraded query mode, the data query request is subjected to downgrade query processing in the target data center.

[0009] Optionally, if the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, obtaining the data generation time of the target business data from the target session identifier includes:

[0010] Acquire a first center identifier of a data generation center corresponding to the target service data from the target session identifier;

[0011] If the target business data associated with the session identifier does not exist in the target data center corresponding to the business system, and the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target business data is obtained from the target session identifier.

[0012] Optionally, it also includes:

[0013] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship, and the target query mode is a compensation query mode, the data query request is sent to the data generation center corresponding to the target business data;

[0014] Receive the business data returned by the data generation center.

[0015] Optionally, it also includes:

[0016] Determining a decision threshold based on the data synchronization delay and a preset adjustment parameter;

[0017] If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

[0018] On the one hand, an embodiment of the present application provides a data query method, which is applied to an information collection system, and the method includes:

[0019] Receiving an information collection message sent by a terminal device, wherein the information collection message includes target service data;

[0020] Based on the information collection message, a target session identifier is generated, and the target session identifier and the target service data are associated and stored in a data generation center corresponding to the information collection system;

[0021] The target session identifier is sent to the terminal device so that the terminal device sends a data query request carrying the target session identifier and the target query mode to the business system, and instructs the business system to obtain the data generation time of the target business data from the target session identifier when it is determined that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset association relationship, and the target query mode is a degraded query mode, then downgrade query processing is performed on the data query request in the target data center.

[0022] Optionally, it also includes:

[0023] The target session identifier and the target service data are synchronized to other data centers.

[0024] Optionally, the associating and storing the target session identifier and the target service data in a data generation center corresponding to the information collection system includes:

[0025] Determining candidate similarities between the target business data and a plurality of historical business data in the data generation center respectively;

[0026] If there is at least one candidate similarity greater than a preset value among the obtained multiple candidate similarities, the historical business data corresponding to the maximum candidate similarity among the at least one candidate similarity is replaced with the target business data;

[0027] The target session identifier is added to the data generation center, and an association relationship is established between the historical device identifier corresponding to the historical business data and the target business data.

[0028] Optionally, it also includes:

[0029] If there is no candidate similarity greater than a preset value among the obtained multiple candidate similarities, determining a target device identifier based on the target service data;

[0030] An association relationship between the target session identifier, the target device identifier and the target service data is established and added to the data generation center.

[0031] On the one hand, an embodiment of the present application provides a data query device, the device comprising:

[0032] An acquisition module, used to acquire a data query request sent by a terminal device, wherein the data query request includes a target session identifier and a target query mode;

[0033] a judgment module, configured to obtain a data generation time of the target business data from the target session identifier if the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system;

[0034] A query module is used to perform downgrade query processing on the data query request in the target data center if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is a downgraded query mode.

[0035] Optionally, the judging module is specifically used for:

[0036] Acquire a first center identifier of a data generation center corresponding to the target service data from the target session identifier;

[0037] If the target business data associated with the session identifier does not exist in the target data center corresponding to the business system, and the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target business data is obtained from the target session identifier.

[0038] Optionally, the query module is further used to:

[0039] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship, and the target query mode is a compensation query mode, the data query request is sent to the data generation center corresponding to the target business data;

[0040] Receive the business data returned by the data generation center.

[0041] Optionally, the judging module is further used for:

[0042] Determining a decision threshold based on the data synchronization delay and a preset adjustment parameter;

[0043] If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

[0044] On the one hand, an embodiment of the present application provides a data query device, the device comprising:

[0045] A receiving module, used to receive an information collection message sent by a terminal device, wherein the information collection message includes target service data;

[0046] A storage module, used to generate a target session identifier based on the information collection message, and associate the target session identifier with the target service data and store them in a data generation center corresponding to the information collection system;

[0047] A sending module is used to send the target session identifier to the terminal device so that the terminal device sends a data query request carrying the target session identifier and a target query mode to the business system, and instructs the business system to obtain the data generation time of the target business data from the target session identifier when it is determined that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset association relationship, and the target query mode is a degraded query mode, then the data query request is downgraded in the target data center.

[0048] Optionally, a synchronization module is further included, and the synchronization module is specifically used to:

[0049] The target session identifier and the target service data are synchronized to other data centers.

[0050] Optionally, the storage module is specifically used for:

[0051] Determining candidate similarities between the target business data and a plurality of historical business data in the data generation center respectively;

[0052] If there is at least one candidate similarity greater than a preset value among the obtained multiple candidate similarities, the historical business data corresponding to the maximum candidate similarity among the at least one candidate similarity is replaced with the target business data;

[0053] The target session identifier is added to the data generation center, and an association relationship is established between the historical device identifier corresponding to the historical business data and the target business data.

[0054] Optionally, the storage module is further used for:

[0055] If there is no candidate similarity greater than a preset value among the obtained multiple candidate similarities, determining a target device identifier based on the target service data;

[0056] An association relationship between the target session identifier, the target device identifier and the target service data is established and added to the data generation center.

[0057] On the one hand, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data query method when executing the program.

[0058] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of the above-mentioned data query method.

[0059] In an embodiment of the present application, a data query request sent by a terminal device is obtained. If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data generation time of the target business data is obtained from the target session identifier. If the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time meet the preset association relationship, and the target query mode is a downgraded query mode, the data query request is downgraded in the target data center. Therefore, when the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data query request will not be directly sent to other data centers, but downgraded query processing will be performed in the target data center, effectively avoiding the response delay caused by calling data across centers. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0061] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present application;

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

[0063] Figure 3 A schematic diagram of a process for determining an association relationship provided in an embodiment of the present application;

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

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

[0066] Figure 6 A schematic diagram of the structure of a target session identifier provided in an embodiment of the present application;

[0067] Figure 7 A schematic diagram of a storage method provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of the structure of a data query device provided in an embodiment of the present application;

[0069] Fig. 9 A schematic diagram of the structure of a data query device provided in an embodiment of the present application;

[0070] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0072] Currently, in a multi-active architecture system, it is easy to call data across data centers in context stickiness scenarios. Context stickiness scenarios are when there is correlation between the operation objects corresponding to multiple operations performed by the terminal device, such as account registration and login scenarios, order creation and payment scenarios, etc.

[0073] In the account registration and login scenario, data center A in the remote multi-active architecture system receives the account registration request sent by the terminal device, stores the account and the corresponding password in data center A, and sends the stored account and password to data center B in the remote multi-active architecture system for synchronization.

[0074] If data center B receives an account login request sent by a terminal device before data center B completes the synchronization of the account and password, data center B cannot find the account and the corresponding password, and sends the account login request to data center A to complete the account login. Therefore, there is a situation where data is called across data centers, which will cause a response delay problem. In order to solve the above problems, this application proposes a data query method.

[0075] refer to Figure 1 , which is a data query system architecture diagram applicable to an embodiment of the present application, and the data query system architecture diagram at least includes a terminal device 101, a business system 102, and an information collection system 103.

[0076] The terminal device 101 is installed with a target application for data query and a target application for information collection, which may be a pre-installed client, a web application, or a small program embedded in other applications, etc. The terminal device 101 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.

[0077] The business system 102 is a backend server of the data query target application, providing services for data query. The business system 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0078] The information collection system 103 is the background server of the information collection target application, providing services for information collection. The information collection system 103 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0079] The terminal device 101 and the business system 102 can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. The terminal device 101 and the information collection system 103 can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. The business system 102 and the information collection system 103 can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.

[0080] The terminal device 101 responds to the user's information collection operation and sends an information collection message to the information collection system 103. The information collection system 103 receives the information collection message sent by the terminal device, wherein the information collection message includes the target business data. Based on the information collection message, a target session identifier is generated, and the target session identifier and the target business data are associated and stored in the data generation center corresponding to the information collection system. Then, the target session identifier is sent to the terminal device.

[0081] The terminal device 101 responds to the user's data query operation and sends a data query instruction to the business system 102. The business system 102 receives the data query instruction and obtains the data query request sent by the terminal device, wherein the data query request includes a target session identifier and a target query mode. If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data generation time of the target business data is obtained from the target session identifier; if the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time meet the preset association relationship, and the target query mode is a degraded query mode, the data query request is degraded in the target data center.

[0082] based on Figure 1 The system architecture diagram, the embodiment of the present application provides a process of a data query method, such as Figure 2 As shown, the process of this method is Figure 1 The business system 102 shown executes the following steps:

[0083] Step S201, obtaining a data query request sent by a terminal device.

[0084] Specifically, the data query request includes a target session identifier and a target query mode. The target query mode includes a degradation query mode and a compensation query mode.

[0085] Step S202: If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data generation time of the target business data is obtained from the target session identifier.

[0086] The time corresponding to when the target service data is generated is the data generation time, and the data center that generates the target service data is the data generation center. The target session identifier includes the first center identifier of the data generation center, the data generation time, and other filling information.

[0087] Specifically, if the target business data associated with the target session identifier exists in the target data center corresponding to the business system, a query success is returned to the terminal device;

[0088] If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the first center identifier of the data generation center corresponding to the target business data is obtained from the target session identifier; if the first center identifier is consistent with the second center identifier corresponding to the target data center, a query failure is returned to the terminal device; if the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target business data is obtained from the target session identifier.

[0089] Step S203, if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is a degraded query mode, the data query request is degraded in the target data center.

[0090] Specifically, if the data query time of the target service data, the data synchronization delay of the target service data, and the data generation time do not satisfy the preset association relationship, a query failure is returned to the terminal device.

[0091] The downgrade query mode has different processing methods for different application scenarios. For example, in the account registration and login scenario, the downgrade query processing is to return to the terminal device and try again later; in the risk verification scenario, the downgrade query processing is to not perform any query processing and directly proceed to subsequent business processing.

[0092] In an embodiment of the present application, a data query request sent by a terminal device is obtained. If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data generation time of the target business data is obtained from the target session identifier. If the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time meet the preset association relationship, and the target query mode is a downgraded query mode, the data query request is downgraded in the target data center. Therefore, when the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data query request will not be directly sent to other data centers, but downgraded query processing will be performed in the target data center, effectively avoiding the response delay caused by calling data across centers.

[0093] Optionally, the above steps also include: if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is a compensation query mode, then the data query request is sent to the data generation center corresponding to the target business data; and the business data returned by the data generation center is received.

[0094] Specifically, the compensation query mode is generally used in scenarios with higher risk levels.

[0095] Multiple groups of historical session identifiers, historical device identifiers and historical business data are stored in the data production center, wherein the historical session identifiers and historical device identifiers are stored in the form of key-value pairs, and the historical device identifiers and historical business data are stored in the form of key-value pairs.

[0096] The data production center searches according to the target session identifier in the data query request, and determines the target historical session identifier that is the same as the target session identifier and the target historical device identifier corresponding to the target historical session identifier from multiple historical session identifiers. Then, the target historical business data corresponding to the target historical device identifier is searched according to the target historical device identifier, and the target historical business data is returned to the business system of the target data center.

[0097] In an embodiment of the present application, when the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, and the target query mode is a compensation query mode, sending the data query request to the data generation center can effectively avoid sending a large number of data query requests to the data generation center, thereby avoiding the situation of calling large quantities of data across centers.

[0098] Optionally, before the above step S203, the following is also included: Figure 3 The following steps are shown:

[0099] Step S301, determining a decision threshold based on data synchronization delay and preset adjustment parameters.

[0100] Specifically, the preset adjustment parameters include the timed detection interval and the retention value. The business system accesses the data synchronization component regularly according to the timed detection interval through the timed detection task, obtains the real-time data synchronization delay, and updates the data synchronization delay with the real-time data synchronization delay. The retention value is an empirical value and can be adjusted based on experience.

[0101] Step S302: If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

[0102] Specifically, the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time satisfy a preset correlation relationship: data query time - data generation time < data synchronization delay + timing detection interval + retention value.

[0103] In the embodiment of the present application, if the difference between the data query time and the data synchronization delay is less than the judgment threshold, it means that the data query is too fast and the target business data has not yet been synchronized from the data generation center to the target data center corresponding to the business system. Therefore, the business system can perform subsequent processing on the data query request according to the target query mode instead of directly sending the data query request to the data generation center.

[0104] In order to better explain the embodiment of the present application, the following takes a specific implementation scenario as an example to introduce a process of a data query method provided by the embodiment of the present application. The method consists of Figure 1 The business system 102 in the embodiment is executed as follows: Figure 4 As shown, the following steps are included:

[0105] Step S401, obtaining a data query request sent by a terminal device.

[0106] The data query request includes a target session identifier and a target query mode. The target query mode includes a degradation query mode and a compensation query mode.

[0107] Step S402, determining whether there is target business data associated with the target session identifier in the target data center corresponding to the business system, if yes, executing step S403; otherwise, executing step S404.

[0108] Step S403, returning a query success to the terminal device and ending.

[0109] Step S404: Acquire a first center identifier of a data generation center corresponding to the target business data from the target session identifier.

[0110] Step S405, determining whether the first center identifier is consistent with the second center identifier corresponding to the target data center, if so, executing step S408; otherwise, executing step S406.

[0111] Step S406: obtaining the data generation time of the target service data from the target session identifier.

[0112] Step S407, determine whether the following formula is satisfied: data query time - data generation time < data synchronization delay + timing detection interval + retention value, if so, execute step S409; otherwise, execute step S408.

[0113] Step S408, returning query failure to the terminal device and ending.

[0114] Step S409, determining whether the target query mode is a degraded query mode, if so, executing step S410; otherwise, executing step S411.

[0115] Step S410: Perform downgrade query processing on the data query request in the target data center.

[0116] Step S411, determine whether the target query mode is a compensation query mode, if so, execute step S412; otherwise, end.

[0117] Step S412: sending the data query request to the data generation center corresponding to the target business data.

[0118] Step S413, receiving the business data returned by the data generation center.

[0119] In an embodiment of the present application, if the difference between the data query time and the data synchronization delay is less than the judgment threshold, it means that the data query is too fast and the target business data has not yet been synchronized from the data generation center to the target data center corresponding to the business system.

[0120] When the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data query request will not be sent directly to other data centers. Instead, a judgment will be made based on the target query mode. If the target query mode is a degraded query mode, degraded query processing will be performed in the target data center, which can effectively avoid response delays caused by cross-center data calls. If the target query mode is a compensation query mode, the data query request will be sent to the data generation center, which can effectively avoid sending a large number of data query requests to the data generation center, thereby avoiding large-scale cross-center data calls.

[0121] based on Figure 1 The system architecture diagram, the embodiment of the present application provides a process of a data query method, such as Figure 5 As shown, the process of this method is Figure 1 The information collection system 103 shown in the figure performs the following steps:

[0122] Step S501: receiving an information collection message sent by a terminal device.

[0123] The information collection message includes target business data. The target business data is different for different business scenarios. In the order creation scenario, the target business data includes the order number, product name, product category, etc. In the account registration scenario, the target business data includes the account number and the corresponding password.

[0124] Step S502: Generate a target session identifier based on the information collection message, and associate the target session identifier with the target business data and store them in a data generation center corresponding to the information collection system.

[0125] Specifically, after the target session identifier and the target service data are stored in the data generation center, the target session identifier and the target service data are synchronized to other data centers.

[0126] Based on the first center identifier of the data generation center, the data generation time and other filling information, a target session identifier is generated, and genes are used to mark the first center identifier and the data generation time in the target session identifier, so that the business system can obtain the first center identifier and the data generation time from the target session identifier.

[0127] The other filling information may be any one of partial target service data, hash-coded target service data, etc. The other filling information is used to ensure the uniqueness of the generated target session identifier. The structure of the target session identifier is as follows: Figure 6 shown.

[0128] Step S503: Send the target session identifier to the terminal device.

[0129] Specifically, after the information collection system sends the target session identifier to the terminal device, the terminal device sends a data query request carrying the target session identifier and the target query mode to the business system, and instructs the business system to obtain the data generation time of the target business data from the target session identifier when it is determined that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time meet the preset association relationship, and the target query mode is a downgraded query mode, the data query request is downgraded in the target data center.

[0130] In the embodiment of the present invention, an information collection message sent by a terminal device is received, and then a target session identifier is generated based on the information collection message, and the target session identifier and the target business data are associated and stored in a data generation center corresponding to the information collection system. Then, the target session identifier is sent to the terminal device. In the present application, by associating the target session identifier and the target business data and storing them in a data generation center corresponding to the information collection system, it is convenient to search according to the target session identifier later.

[0131] Optionally, in the above step S502, the target session identifier and the target service data are associated and stored in a data generation center corresponding to the information collection system, specifically including: Figure 7 The following steps are shown:

[0132] Step S701 : determining candidate similarities between target business data and a plurality of historical business data in a data generation center.

[0133] Specifically, since the target business data includes information of multiple dimensions, the historical business data also includes information of multiple dimensions. The present application provides the following possible implementations for calculating the candidate similarity between the target business data and the historical business data:

[0134] A first possible implementation method is to use an edit distance method to calculate candidate similarities between target business data and historical business data.

[0135] A second possible implementation method is to use the Euclidean distance method to calculate the candidate similarity between the target business data and the historical business data.

[0136] Step S702, determining whether there is at least one candidate similarity greater than a preset value among the obtained multiple candidate similarities, if yes, executing step S703; otherwise, executing step S705.

[0137] Step S703: replace the historical business data corresponding to the maximum candidate similarity among at least one candidate similarity with the target business data.

[0138] Step S704: Add the target session identifier to the data generation center, and establish an association relationship with the historical device identifier corresponding to the historical business data and the target business data.

[0139] Step S705: determine the target device identifier based on the target service data.

[0140] Step S706: Establish an association relationship between the target session identifier, the target device identifier and the target service data and add them to the data generation center.

[0141] Specifically, the data generation center includes three groups of data, each group of data includes a historical session identifier, a historical device identifier, and historical business data, as shown in Table 1.

[0142] Table 1.

[0143] Historical session ID Historical Equipment Identification Historical business data 01 X01 100100 02 X01 100100 03 X04 110000

[0144] If the target session identifier is 05 and the target business data is 100101, the candidate similarities between the target business data 100101 and the three historical business data are set to 5, 5, and 3, respectively, and the preset value is 3. Therefore, the maximum candidate similarity is 5. Replace the historical business data 100100 with 100101, and then add the target session identifier 05 to the data production center, and establish an association relationship with the historical device identifier X01 and the target business data 100101, as shown in Table 2.

[0145] Table 2.

[0146] Historical session ID Historical equipment identification Historical business data 01 X01 100101 02 X01 100101 03 X04 110000 05 X01 100101

[0147] In the embodiment of the present application, if there are historical business data with high similarity to the target business data in the data generation center, the target business data is used to update the historical business data, effectively ensuring that the data stored in the data generation center are the latest target business data. If there are no historical business data with high similarity to the target business data in the data generation center, the target device identifier is determined based on the target business data, and then the association relationship between the target session identifier, the target device identifier and the target business data is established and added to the data generation center to ensure the integrity of the data in the data generation center.

[0148] In order to better explain the embodiment of the present application, the following takes a specific implementation scenario as an example to introduce a process of a data query method provided by the embodiment of the present application. The method consists of Figure 1 The terminal device 101, the business system 102 and the information collection system 103 are interactively executed, wherein the business system 102 is located in the target data center and the information collection system 103 is located in the data generation center, including the following steps:

[0149] Step S801: The terminal device sends an information collection message to the information collection system, wherein the information collection message includes target service data, which is device information, including device serial number, device model, device resolution, device memory capacity, device battery capacity, IP address, GPS information, etc.

[0150] Step S802: the information collection system generates a target session identifier based on the information collection message, and determines candidate similarities between the target business data and a plurality of historical business data in the data generation center.

[0151] If at least one candidate similarity among the obtained multiple candidate similarities is greater than a preset value, the historical business data corresponding to the maximum candidate similarity among the at least one candidate similarity is replaced with the target business data. Then the target session identifier is added to the data generation center, and an association relationship is established with the historical device identifier corresponding to the historical business data and the target business data.

[0152] If there is no candidate similarity greater than a preset value among the obtained multiple candidate similarities, the target device identifier is determined based on the target service data, and then an association relationship between the target session identifier, the target device identifier and the target service data is established and added to the data generation center.

[0153] Step S803: the information collection system sends a target session identifier to the terminal device.

[0154] Step S804: the terminal device sends a data query request to the business system, wherein the data query request includes a target session identifier and a target query mode.

[0155] Step S805, the business system determines whether the target business data associated with the target session identifier exists in its corresponding target data center. If not, the first center identifier of the data generation center corresponding to the target business data is obtained from the target session identifier.

[0156] If the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target service data is obtained from the target session identifier.

[0157] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is a degraded query mode, the data query request is processed in a degraded manner in the target data center.

[0158] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is the compensation query mode, the data query request is sent to the data generation center corresponding to the target business data, and the business data returned by the data generation center is received.

[0159] In an embodiment of the present application, for the information collection system, if there are historical business data with a high similarity to the target business data in the data generation center, the target business data is used to update the historical business data, which effectively ensures that the data stored in the data generation center are the latest target business data. If there are no historical business data with a high similarity to the target business data in the data generation center, the target device identifier is determined based on the target business data, and then the association relationship between the target session identifier, the target device identifier and the target business data is established and added to the data generation center to ensure the integrity of the data in the data generation center. By associating the target session identifier and the target business data and storing them in the data generation center corresponding to the information collection system, it is convenient to search according to the target session identifier later.

[0160] For the business system, when the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, the data query request will not be sent directly to other data centers. Instead, a judgment will be made based on the target query mode. If the target query mode is a downgraded query mode, downgraded query processing will be performed in the target data center, which can effectively avoid response delays caused by cross-center data calls; if the target query mode is a compensation query mode, the data query request will be sent to the data generation center, which can effectively avoid sending a large number of data query requests to the data generation center, thereby avoiding large-scale cross-center data calls.

[0161] Based on the same technical concept, the present application embodiment provides a data query device, such as Figure 8 As shown, the data query device 900 includes:

[0162] An acquisition module 901 is used to acquire a data query request sent by a terminal device, wherein the data query request includes a target session identifier and a target query mode;

[0163] The judgment module 902 is used to obtain the data generation time of the target business data from the target session identifier if the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system;

[0164] The query module 903 is used to perform downgrade query processing on the data query request in the target data center if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset correlation relationship, and the target query mode is a downgraded query mode.

[0165] Optionally, the judging module 902 is specifically configured to:

[0166] Acquire a first center identifier of a data generation center corresponding to the target service data from the target session identifier;

[0167] If the target business data associated with the session identifier does not exist in the target data center corresponding to the business system, and the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target business data is obtained from the target session identifier.

[0168] Optionally, the query module 903 is further used to:

[0169] If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship, and the target query mode is a compensation query mode, the data query request is sent to the data generation center corresponding to the target business data;

[0170] Receive the business data returned by the data generation center.

[0171] Optionally, the judging module 902 is further configured to:

[0172] Determining a decision threshold based on the data synchronization delay and a preset adjustment parameter;

[0173] If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

[0174] Based on the same technical concept, the present application embodiment provides a data query device, such as Fig. 9 As shown, the data query device 1000 includes:

[0175] The receiving module 1001 is used to receive an information collection message sent by a terminal device, wherein the information collection message includes target service data;

[0176] The storage module 1002 is used to generate a target session identifier based on the information collection message, and associate the target session identifier with the target service data and store them in a data generation center corresponding to the information collection system;

[0177] The sending module 1003 is used to send the target session identifier to the terminal device so that the terminal device sends a data query request carrying the target session identifier and the target query mode to the business system, and instructs the business system to obtain the data generation time of the target business data from the target session identifier when it is determined that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset association relationship, and the target query mode is a degraded query mode, then the data query request is downgraded in the target data center.

[0178] Optionally, a synchronization module 1004 is further included, and the synchronization module 1004 is specifically used for:

[0179] The target session identifier and the target service data are synchronized to other data centers.

[0180] Optionally, the storage module 1002 is specifically used for:

[0181] Determining candidate similarities between the target business data and a plurality of historical business data in the data generation center respectively;

[0182] If there is at least one candidate similarity greater than a preset value among the obtained multiple candidate similarities, the historical business data corresponding to the maximum candidate similarity among the at least one candidate similarity is replaced with the target business data;

[0183] The target session identifier is added to the data generation center, and an association relationship is established between the historical device identifier corresponding to the historical business data and the target business data.

[0184] Optionally, the storage module 1002 is further used for:

[0185] If there is no candidate similarity greater than a preset value among the obtained multiple candidate similarities, determining a target device identifier based on the target service data;

[0186] An association relationship between the target session identifier, the target device identifier and the target service data is established and added to the data generation center.

[0187] Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal or a server, such as Fig.10 As shown, it includes at least one processor 1101 and a memory 1102 connected to the at least one processor. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Fig.10 For example, the processor 1101 and the memory 1102 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0188] In the embodiment of the present application, the memory 1102 stores instructions that can be executed by at least one processor 1101. The at least one processor 1101 can execute the steps included in the above-mentioned data query method by executing the instructions stored in the memory 1102.

[0189] Among them, the processor 1101 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and perform data query by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102. Optionally, the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0190] Processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0191] Memory 1102, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0192] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned data query method.

[0193] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0194] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0197] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data query method, applied to a business system, characterized in that: include: Acquire a data query request sent by a terminal device, wherein the data query request includes a target session identifier and a target query mode; If the target service data associated with the target session identifier does not exist in the target data center corresponding to the service system, obtaining the data generation time of the target service data from the target session identifier; If the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time satisfy a preset correlation relationship, and the target query mode is a degraded query mode, then the data query request is subjected to degraded query processing in the target data center; The processing method corresponding to the degraded query mode is to return to the terminal device a request to try again later or not to perform any query processing and directly perform subsequent business processing; Also includes: Determining a decision threshold based on the data synchronization delay and a preset adjustment parameter; If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

2. The method according to claim 1, characterized in that If the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system, obtaining the data generation time of the target business data from the target session identifier includes: Acquire a first center identifier of a data generation center corresponding to the target service data from the target session identifier; If the target business data associated with the session identifier does not exist in the target data center corresponding to the business system, and the first center identifier is inconsistent with the second center identifier corresponding to the target data center, the data generation time of the target business data is obtained from the target session identifier.

3. The method according to claim 1, characterized in that Also includes: If the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship, and the target query mode is a compensation query mode, the data query request is sent to the data generation center corresponding to the target business data; Receive the business data returned by the data generation center.

4. A data query method, applied to an information collection system, characterized in that: include: Receiving an information collection message sent by a terminal device, wherein the information collection message includes target service data; Based on the information collection message, a target session identifier is generated, and the target session identifier and the target service data are associated and stored in a data generation center corresponding to the information collection system; Sending the target session identifier to the terminal device so that the terminal device sends a data query request carrying the target session identifier and the target query mode to the business system, and instructing the business system to obtain the data generation time of the target business data from the target session identifier when determining that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time satisfy a preset association relationship, and the target query mode is a degraded query mode, then performing degraded query processing on the data query request in the target data center; The processing method corresponding to the degraded query mode is to return to the terminal device a request to try again later or not to perform any query processing and directly perform subsequent business processing; Also includes: Determining a decision threshold based on the data synchronization delay and a preset adjustment parameter; If the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy a preset correlation relationship.

5. The method according to claim 4, characterized in that Also includes: The target session identifier and the target service data are synchronized to other data centers.

6. The method according to claim 4, characterized in that The associating and storing the target session identifier and the target service data in a data generation center corresponding to the information collection system includes: Determining candidate similarities between the target business data and a plurality of historical business data in the data generation center respectively; If there is at least one candidate similarity greater than a preset value among the obtained multiple candidate similarities, the historical business data corresponding to the maximum candidate similarity among the at least one candidate similarity is replaced with the target business data; The target session identifier is added to the data generation center, and an association relationship is established between the historical device identifier corresponding to the historical business data and the target business data.

7. The method according to claim 6, characterized in that Also includes: If there is no candidate similarity greater than a preset value among the obtained multiple candidate similarities, determining a target device identifier based on the target service data; An association relationship between the target session identifier, the target device identifier and the target service data is established and added to the data generation center.

8. A data query device, characterized in that: include: An acquisition module, used to acquire a data query request sent by a terminal device, wherein the data query request includes a target session identifier and a target query mode; A judgment module, configured to obtain a data generation time of the target business data from the target session identifier if the target business data associated with the target session identifier does not exist in the target data center corresponding to the business system; A query module, configured to perform downgrade query processing on the data query request in the target data center if the data query time of the target business data, the data synchronization delay of the target business data, and the data generation time satisfy a preset correlation relationship, and the target query mode is a downgrade query mode; the processing method corresponding to the downgrade query mode is to return to the terminal device to retry later or not perform any query processing and directly perform subsequent business processing; The judgment module is also used to: determine a judgment threshold based on the data synchronization delay and the preset adjustment parameters; if the difference between the data query time and the data generation time is less than the judgment threshold, it is determined that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy the preset correlation relationship.

9. A data query device, characterized in that: include: A receiving module, used to receive an information collection message sent by a terminal device, wherein the information collection message includes target service data; A storage module, used to generate a target session identifier based on the information collection message, and associate the target session identifier with the target service data and store them in a data generation center corresponding to the information collection system; A sending module, used for sending the target session identifier to the terminal device, so that the terminal device sends a data query request carrying the target session identifier and a target query mode to the business system, and instructs the business system to obtain the data generation time of the target business data from the target session identifier when it is determined that the target business data associated with the target session identifier does not exist in the corresponding target data center; and if the data query time of the target business data, the data synchronization delay of the target business data and the data generation time meet the preset association relationship, and the target query mode is a degraded query mode, then the data query request is degraded in the target data center. The processing method corresponding to the degraded query mode is to return to the terminal device to retry later or not to perform any query processing, and directly perform subsequent business processing; The sending module is also used to: determine a judgment threshold based on the data synchronization delay and the preset adjustment parameters; if the difference between the data query time and the data generation time is less than the judgment threshold, determine that the data query time of the target business data, the data synchronization delay of the target business data and the data generation time satisfy the preset association relationship.

10. 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 program, the steps of any one of the methods of claims 1 to 7 are implemented.

11. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 7.

Citation Information

Patent Citations

  • Information query method, device and system and data processing method and device

    CN103838849A

  • Data migration method and device, equipment and storage medium

    CN113010496A

  • Data synchronization method, data synchronization apparatus, and distributed system

    US20160105502A1