Data query method and device, storage medium and computer program product

The method ensures continuous data query services by switching to a secondary database for conversion parameters when the primary fails, addressing service discontinuity in financial institutions.

CN120316136APending Publication Date: 2025-07-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410050558.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

In the prior art, when the data query service fails in Redis or network failure, it cannot provide quotation services to customers normally, resulting in poor continuity.

Method used

When the first database fails to obtain the conversion parameters or is unavailable, the conversion parameters of the target digital resource pair are obtained from the second database and sent to the terminal device to realize the continuity of the data query service.

Benefits of technology

Improve the continuity of data query services and improve customer experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316136A_ABST
    Figure CN120316136A_ABST
Patent Text Reader

Abstract

The invention provides a data query method and device, a storage medium and a computer program product, and the method comprises the steps that a query server receives a data query request sent by terminal equipment; the query server queries a first conversion parameter of the target digital resource pair from a first database according to the identification information of the target digital resource pair; when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries a second conversion parameter of the target digital resource pair from a second database according to the identification information of the target digital resource pair; and the query server sends the second conversion parameter to the terminal equipment. By adopting the method provided by the embodiment of the invention, when the conversion parameter of the first database in the quotation service fails to acquire or is unavailable, the conversion parameter of the second database is sent to the terminal equipment to be used by a client, so that the continuity of the data query service is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technologies, and in particular, to a data query method, apparatus, storage medium, and computer program product. Background Art

[0002] With the rapid development of human society, there are more and more exchange requirements between different types of digital resources. In order to ensure the accuracy and sensitivity of exchange rate prices, exchange rate quotation agencies for digital resource pairs (including two different types of digital resources) usually receive exchange rate updates from institutions such as banks at a frequency of hundreds of milliseconds, and then through technical components such as message systems and Remote Dictionary Server (Redis), process the exchange rate prices of banks within milliseconds to become the agency's own quotations to customers, that is, provide customers with exchange rate data query services. However, in order to pursue low latency of exchange rate prices, in the overall data link, once there is any service failure (such as Redis failure, network failure, etc.), the agency will not be able to provide quotation services to customers normally, resulting in the interruption of customers' data query services and poor continuity. Therefore, how to improve the continuity of data query services is an urgent problem to be solved. Summary of the Invention

[0003] Embodiments of this application provide a data query method, data query apparatus, storage medium, and computer program product, which can obtain conversion parameters of a digital resource pair from other data sources when the conversion parameters in a data source with high timeliness cannot be obtained or are unavailable, effectively improving the continuity of data query services and helping to enhance the customer experience.

[0004] On the one hand, embodiments of this application provide a data query method, where the method includes:

[0005] A query server receives a data query request sent by a terminal device, and the data query request includes identification information of a target digital resource pair;

[0006] The query server queries a first conversion parameter of the target digital resource pair from a first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by a pre-server through a data processing server;

[0007] When the first conversion parameter cannot be obtained or is unavailable, the query server queries a second conversion parameter of the target digital resource pair from a second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the pre-server at a first time interval;

[0008] The query server sends the second conversion parameter to the terminal device.

[0009] On the one hand, an embodiment of the present application provides another data query method, where the method includes:

[0010] The front-end server obtains the current conversion parameter of the target digital resource pair;

[0011] The front-end server writes the first conversion parameter of the target digital resource pair to the first database in real time through the data processing server according to the current conversion parameter of the target digital resource pair;

[0012] The front-end server writes the second conversion parameter of the target digital resource pair to the second database at a first time interval according to the current conversion parameter of the target digital resource pair, so that after the query server receives a data query request, when the acquisition of the first conversion parameter from the first database fails or the acquired first conversion parameter is unavailable, the second conversion parameter of the target digital resource pair is queried from the second database.

[0013] On the one hand, an embodiment of the present application provides a data query device, including units for executing the data query method. The device includes:

[0014] A receiving unit, configured to receive a data query request sent by a terminal device, where the data query request includes identification information of a target digital resource pair;

[0015] A query unit, configured to query the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, where the first conversion parameter of the target digital resource pair is written to the first database in real time by the front-end server through the data processing server;

[0016] The query unit is further configured to, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, query the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, where the second conversion parameter of the target digital resource pair is written to the second database by the front-end server at a first time interval;

[0017] A sending unit, configured to send the second conversion parameter to the terminal device.

[0018] On the one hand, an embodiment of the present application provides another data query device, including units for executing the data query method. The device includes:

[0019] An acquisition unit, configured to acquire the current conversion parameter of the target digital resource pair;

[0020] A processing unit, configured to write the first conversion parameter of the target digital resource pair to the first database in real time through a data processing server according to the current conversion parameter of the target digital resource pair.

[0021] The processing unit is further configured to write the second conversion parameter of the target digital resource pair to the second database at a first time interval according to the current conversion parameter of the target digital resource pair, so that after the query server receives a data query request, when the acquisition of the first conversion parameter from the first database fails or the acquired first conversion parameter is unavailable, the second conversion parameter of the target digital resource pair is queried from the second database.

[0022] On the one hand, an embodiment of the present application provides a server, including: a processor, a communication interface, and a memory, the processor, the communication interface, and the memory are interconnected, wherein the memory stores executable program code, and the processor is configured to call the executable program code to implement the data query method provided by the embodiment of the present application.

[0023] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are run on a computer, the computer is enabled to implement the data query method provided by the embodiment of the present application.

[0024] Correspondingly, an embodiment of the present application further provides a computer program product, the computer program product includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, it is used to implement the data query method provided by the embodiment of the present application.

[0025] In an embodiment of the present application, a query server receives a data query request sent by a terminal device. The data query request includes identification information of a target digital resource pair. The query server queries a first conversion parameter of the target digital resource pair from a first database according to the identification information of the target digital resource pair. The first conversion parameter of the target digital resource pair is written into the first database in real time by a front-end server through a data processing server. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries a second conversion parameter of the target digital resource pair from a second database according to the identification information of the target digital resource pair. The second conversion parameter of the target digital resource pair is written into the second database by the front-end server at a first time interval. The query server sends the second conversion parameter to the terminal device. Through the embodiment of the present application, when the query server receives a data query request from the terminal device, it can obtain the first conversion parameter of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can obtain the second conversion parameter of the target digital resource pair in the second database and send it to the terminal device, thereby achieving the acquisition of the conversion parameter of the digital resource pair from other data sources (such as the second database) when the conversion parameter acquisition fails or is unavailable in a data source with higher timeliness (such as the first database), effectively improving the continuity of the data query service and helping to enhance the customer experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application. To more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0027] Figure 1A It is a schematic structural diagram of a data query system provided by an embodiment of the present application;

[0028] Figure 1B It is a schematic structural diagram of another data query system provided by an embodiment of the present application;

[0029] Figure 2 It is a schematic flowchart of a data query method provided by an embodiment of the present application;

[0030] Figure 3A It is a schematic flowchart of another data query method provided by an embodiment of the present application;

[0031] Figure 3B It is a schematic flowchart of yet another data query method provided by an embodiment of the present application;

[0032] Figure 4 is a schematic structural diagram of a data query device provided by an embodiment of the present application;

[0033] Figure 5 is a schematic structural diagram of another data query device provided by an embodiment of the present application;

[0034] Figure 6 is a schematic structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners

[0035] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0036] It should be noted that in this document, the term "including", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanations in the specific embodiments or further in combination with the context of the specific embodiments.

[0037] It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining". Furthermore, as used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It should be further understood that the terms "comprising", "including" indicate the presence of the stated features, steps, operations, elements, components, items, kinds, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or", "and / or", "including at least one of the following" and the like used in this application may be interpreted inclusively, or mean any one or any combination. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C", and again, "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C". An exception to this definition only occurs when the combination of elements, functions, steps, or operations are mutually exclusive in some way.

[0038] It should be understood that although the steps in the flowcharts in the embodiments of the present application are shown sequentially according to the indication of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this application, the execution of these steps has no strict order limitation, and they can be executed in other orders. Moreover, at least a part of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0039] Depending on the context, the words "if", "when" as used herein may be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" may be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".

[0040] Transaction exchange rate: It refers to the foreign exchange exchange rate provided by a bank or financial institution for customers to directly conclude transactions, including the buying and selling prices. Generally, it comes with tradable volumes, has a high update frequency, and has clear timeliness.

[0041] Streaming exchange rate: The exchange rate provider actively and continuously pushes the latest exchange rate information to customers through the Financial Information eXchange Protocol (FIX). Compared with the traditional way of customers asking the exchange rate provider, the streaming exchange rate is more frequent, timely, and has a large amount of data.

[0042] FIX protocol: It is an open protocol provided by the International FIX Association to promote the process of international trade electronization and establish a real-time electronic communication protocol among various participants, including investment managers, brokers, buyers, and sellers.

[0043] Remote Dictionary Server (Redis) is an open-source log-type, Key-Value database written in ANSI C language, supporting the network, and can be memory-based or persistent, and provides application programming interfaces (APIs) in multiple languages.

[0044] Third-party payment: Third-party payment refers to an independent institution with certain strength and reputation guarantee. It provides a network payment mode of a transaction payment platform that interfaces with the bank payment and settlement system by signing contracts with major banks. In the third-party payment mode, after the buyer selects the goods, the buyer uses the account provided by the third-party platform to pay the purchase price (pay to the third party), and the third party notifies the seller that the payment has arrived and requests the seller to ship the goods; after the buyer receives the goods, inspects the goods, and confirms, the buyer then notifies the third party to make the payment; the third party then transfers the funds to the seller's account.

[0045] The following introduces a data query system provided by an embodiment of the present application.

[0046] Please refer to Figure 1A , Figure 1A which is a schematic structural diagram of a data query system provided by an embodiment of the present application. As Figure 1AAs shown in the figure, the data query system includes a query server 101, a data processing server 102, a front-end server 103, a terminal device 104, a first database 105, and a second database 106. Among them, the query server 101 can communicate with the data processing server 102, the front-end server 103, the terminal device 104, the first database 105, and the second database 106 through the network for data communication. The data processing server 102 can communicate with the first database 105 and the second database 106 through the network for data communication. The query server 101, the data processing server 102, and the front-end server 103 may include cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal device 104 may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone), a desktop computer, a tablet computer, a handheld computer, a laptop computer, a mobile Internet device (MID), or a wearable device, etc. The first database 105 may include Redis, and the second database 106 may include Redis, MySQL, MongoDB, etc. The above communication methods, servers, terminal devices, and databases are only examples, not exhaustive, and include but are not limited to the above communication methods, servers, terminal devices, and databases.

[0047] In a feasible embodiment, the query server 101 receives a data query request sent by the terminal device 104. The query server 101 queries the first conversion parameter of the target digital resource pair from the first database 105 according to the identification information of the target digital resource pair in the data query request. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server 101 queries the second conversion parameter of the target digital resource pair from the second database 106 and sends the second conversion parameter to the terminal device 104. Among them, the first conversion parameter of the target digital resource pair is written into the first database 105 in real time by the pre-server 103 through the data processing server 102; the second conversion parameter of the target digital resource pair is written into the second database 106 by the pre-server 103 at a first time interval. The first time interval for writing the target digital resource pair can be determined according to the update frequency of the target digital resource pair (the faster the update, the shorter the first time interval; conversely, the slower the update, the longer the first time interval), or it can be a fixed time interval (such as 10 seconds). In this embodiment, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server 101 can query the second conversion parameter of the target digital resource pair from the second database 106 and send the second conversion parameter to the terminal device 104, effectively improving the continuity of the query service and the customer experience.

[0048] In a feasible embodiment, as Figure 1B shown, in Figure 1ABased on the data query system shown, the data query system further includes a data source server 107 and a message component 108. The query server 101 further includes a downgraded query switch 1011. Among them, the message component 108 may include a message queue for enqueuing the latest conversion parameters of the target digital resource pair, so that the data processing server 102 can obtain the latest conversion parameters of the target digital resource pair from it; after receiving the conversion parameters of the target digital resource pair sent by the query server 101, the terminal device 104 can output the conversion parameters of the target digital resource pair, so that the user can timely know the conversion parameters of the target digital resource pair. The output method can be displayed on the terminal device 104 with sound or vibration prompts, or it can be in the form of voice broadcast; the data source server 107 may include 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms; the downgraded query switch 1011 is controlled by the query server 101, and the data source server 107 uses the FIX protocol (streaming exchange rate) to communicate with the front-end server 103 through the network. The data source server 107 may be a server of a financial institution such as a bank, and is used to push the latest conversion parameters of each digital resource pair to the front-end server 103. The above servers and communication methods are only examples, not exhaustive, and include but are not limited to the above servers and communication methods.

[0049] Among them, when the first conversion parameter acquisition fails or the first conversion parameter is unavailable, the query server 101 turns on the downgraded query switch 1011; when the downgraded query switch 1011 is turned on, the query server 101 can query the first conversion parameter from the first database 105 at a second time interval, obtain a query result, and determine the query success rate according to the query result. When the query success rate is greater than or equal to the preset success rate threshold, the downgraded query switch is turned off.

[0050] In a feasible embodiment, when the query server 101 receives a data query request from the terminal device 104 and determines that the downgraded query switch 1011 is turned on, it can query the second conversion parameter of the target digital resource pair in the data query request from the second database 106, obtain the adjustment amount of the conversion parameter of the target digital resource pair, determine the third conversion parameter according to the second conversion parameter and the adjustment amount of the conversion parameter, and send the third conversion parameter to the terminal device 104 so that the user knows the conversion parameter of the current target digital resource pair. Among them, the adjustment amount of the conversion parameter can be determined according to the historical conversion parameter or can be preset by relevant staff. In this embodiment, the query server 101 determines the third conversion parameter according to the second conversion parameter and the adjustment amount of the conversion parameter, which can effectively reduce the losses of the conversion parameter supplier.

[0051] The following introduces a data query method provided by an embodiment of the present application.

[0052] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a data query method provided by an embodiment of the present application. The data query method provided by an embodiment of the present application can be applied to the data query system shown above Figure 1A For example, the data query method is described below by taking the query server in the data query system as an example.

[0053] As Figure 2 shown, the data query method includes:

[0054] S201. The query server receives a data query request sent by the terminal device, and the data query request includes identification information of a target digital resource pair.

[0055] In an embodiment of the present application, the terminal device may send a data query request including identification information of a target digital resource pair to the query server. After receiving the data query request, the query server can query the conversion parameter of the target digital resource pair according to the identification information of the target digital resource pair.

[0056] In a feasible embodiment, the conversion parameter may be an exchange ratio (also referred to as an exchange rate) between two digital resources in the target digital resource pair.

[0057] S202. The query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by the preposed server through the data processing server.

[0058] In the embodiment of the present application, the query server may query the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair. The first conversion parameter of the target digital resource pair is written into the first database in real time by the front-end server through the data processing server.

[0059] In a feasible embodiment, the first conversion parameter may be a more time-sensitive transaction exchange rate between the two digital resources in the target digital resource pair.

[0060] S203. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair. The second conversion parameter of the target digital resource pair is written into the second database by the front-end server at a first time interval.

[0061] In the embodiment of the present application, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server may query the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair. The failure to obtain the first conversion parameter may mean that the first conversion parameter cannot be obtained from the first database (there is no first conversion parameter in the first database), or the first database has no response (for example, it cannot be obtained due to network reasons or the first database fails); the unavailability of the first conversion parameter may include that the first conversion parameter in the first database has not been updated for a long time, which may be caused by a failure of the front-end server or the data processing server; the second conversion parameter is written into the second database by the front-end server at a first time interval.

[0062] In a feasible embodiment, the second conversion parameter may be a reference exchange rate between the two digital resources in the target digital resource pair.

[0063] In a feasible embodiment, the query server obtains the target time corresponding to the first conversion parameter of the target digital resource pair. The target time includes the generation time of the first conversion parameter or the time when the first conversion parameter is written into the first database; if the time interval between the target time and the current time is greater than or equal to the first duration, the query server determines that the first conversion parameter is unavailable.

[0064] Specifically, after the query server obtains the first conversion parameter of the target digital resource pair, it can determine the time interval between the target time corresponding to the first conversion parameter and the current time according to the target time corresponding to the first conversion parameter. If the time interval is greater than or equal to the first duration, it is determined that the first conversion parameter is unavailable. The target time corresponding to the first conversion parameter can be the generation time of the first conversion parameter (the time sent by the data source server to the query server or the time when the data source server generates the first conversion parameter), or the time when the first conversion parameter is written into the first database; the first duration for each digital resource pair can be determined according to the update frequency of each digital resource pair; it can also be a fixed time (such as 10 seconds).

[0065] In a feasible embodiment, the target digital resource pair may include a first digital resource and a second digital resource, the first digital resource pair may include a first digital resource and a third digital resource, and the second digital resource pair may include a third digital resource and a second digital resource; the first conversion parameter of the target digital resource pair may be the exchange rate between the first digital resource and the second digital resource, the conversion parameter of the first digital resource pair may be the exchange rate between the first digital resource and the third digital resource, and the conversion parameter of the second digital resource pair may be the exchange rate between the third digital resource and the second digital resource; when the query server determines that the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can query the conversion parameter of the first digital resource and the conversion parameter of the second digital resource in the first database, and use the conversion parameter of the first digital resource and the conversion parameter of the second digital resource to determine the first conversion parameter of the target digital resource pair. In this embodiment, when the conversion parameter of the target digital resource pair is unavailable and the conversion parameters of the first digital resource pair and the second digital resource pair are available, the conversion parameter of the target digital resource pair can be directly determined by using the conversion parameters of the first digital resource pair and the second digital resource pair and provided to the user.

[0066] In a feasible embodiment, when the query server determines that the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can send a query instruction for the current conversion parameter of the target digital resource pair to the front-end server. After receiving the query instruction for the current conversion parameter of the target digital resource pair, the front-end server sends a query request for the current conversion parameter of the target digital resource pair to the data source server. The data source server sends the current conversion parameter of the target digital resource pair to the front-end server, and the front-end server sends the current conversion parameter of the target digital resource pair to the query server, so that the latest conversion parameter can be directly obtained in a timely manner through the front-end server and provided to the user.

[0067] S204. The query server sends the second conversion parameter to the terminal device.

[0068] In the embodiments of the present application, after the query server queries the second conversion parameter, it may send the second conversion parameter to the terminal device. When the first conversion parameter in the first database is unavailable, the user can also receive the second conversion parameter of the second database, effectively improving the continuity of the query service and the user experience.

[0069] In a feasible embodiment, the query server sending the second conversion parameter to the terminal device includes: the query server obtaining the conversion parameter adjustment amount of the target digital resource pair; the query server determining a third conversion parameter of the target digital resource pair according to the conversion parameter adjustment amount and the second conversion parameter; and the query server sending the third conversion parameter to the terminal device.

[0070] Specifically, after the query server queries the second conversion parameter from the second database, it can obtain the conversion parameter adjustment amount corresponding to the second conversion parameter (i.e., the conversion parameter adjustment amount of the target digital resource pair), then calculate the third conversion parameter according to the second conversion parameter and the conversion parameter adjustment amount corresponding to the second conversion parameter, and send the third conversion parameter to the terminal device. Among them, the target digital resource pair may include a first digital resource and a second digital resource, and the second conversion parameter may be the exchange rate of the first digital resource and the second digital resource with poor timeliness. Taking the query server as a third-party payment as an example, assuming that the second conversion parameter is 7.2 and the conversion parameter adjustment amount is 0.3, the calculation process of the third conversion parameter formula is 7.2*(1 + 0.03)=7.416, and the third conversion parameter can be obtained as 7.416. The conversion parameter of the target digital resource pair of 7.416 can be sent to the terminal device. In this embodiment, the third conversion parameter can be determined by using the second conversion parameter and its corresponding conversion parameter adjustment amount, and sending the larger third conversion parameter to the terminal device can effectively reduce the risk of third-party payment.

[0071] In a feasible embodiment, the query server obtains the fluctuation data of the conversion parameter of the target digital resource pair within a preset time period; the query server determines the fluctuation level of the conversion parameter of the target digital resource pair according to the fluctuation data; and the query server determines the conversion parameter adjustment amount of the target digital resource pair according to the fluctuation level.

[0072] Specifically, the query server can obtain the fluctuation data of the conversion parameters of the target digital resource pair within a preset time period, determine the fluctuation level of the conversion parameters of the target digital resource pair according to the fluctuation data, and determine the adjustment amount of the conversion parameters of the target digital resource pair according to the fluctuation level. Among them, the fluctuation level of the conversion parameters of the target digital resource pair can be determined according to the fluctuation degree of the conversion parameters of the target digital resource pair, and the greater the fluctuation degree, the higher the fluctuation level; when the fluctuation level of the conversion parameters of the target digital resource pair is relatively high, the adjustment amount of the conversion parameters of the target digital resource pair can be set relatively high. For example, the fluctuation levels are level 1, level 2, and level 3 respectively. When the fluctuation level is level 1, the adjustment amount of the conversion parameters is determined to be 0.1; when the fluctuation level is level 2, the adjustment amount of the conversion parameters is determined to be 0.2; when the fluctuation level is level 3, the adjustment amount of the conversion parameters is determined to be 0.3. In this embodiment, determining the adjustment amount of the conversion parameters of the target digital resource pair according to the fluctuation data of the conversion parameters of the target digital resource pair can effectively improve the accuracy of the third conversion parameter adjusted by the adjustment amount of the conversion parameters.

[0073] In a feasible embodiment, the query server obtains the switch state of the downgraded query switch; if the switch state indicates that the downgraded query switch is closed, the query server executes the step of querying the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair; if the switch state indicates that the downgraded query switch is open, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair.

[0074] Specifically, after receiving the data query request for querying the target digital resource pair, the query server can obtain the switch state of the downgraded query switch of the target digital resource pair. When the downgraded query switch is closed, the query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair; when the downgraded query switch is open, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair. Among them, one downgraded query switch can correspond to one or more digital resource pairs. In this embodiment, the query server can determine whether to query the conversion parameter of the target digital resource pair from the first database or the second database according to the switch state of the downgraded query switch of the target digital resource pair, effectively improving the acquisition efficiency of the conversion parameter of the target digital resource pair.

[0075] In a feasible embodiment, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server turns on the downgraded query switch.

[0076] Specifically, when the query server determines that the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can set the switch state of the downgraded query switch corresponding to the first conversion parameter to on.

[0077] In a feasible embodiment, when the switch state indicates that the downgraded query switch is on, the query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair at a second time interval, and obtains a query result; the query server determines the query success rate according to the query result, and turns off the downgraded query switch when the query success rate is greater than or equal to a preset success rate threshold.

[0078] Specifically, when the query server determines that the switch state of the downgraded query switch of the target digital resource pair is on, it can obtain the first conversion parameter of the target digital resource pair and the write time of the first conversion parameter from the first database at a frequency of the second time interval, and obtain a query result. When querying multiple times, the query success rate can be determined according to the query result. If the query success rate is greater than or equal to a preset success rate threshold (for example, 80%), the query server will turn off the downgraded query switch; among them, each time when the first conversion parameter can be queried and the write time interval of the first conversion parameter is less than the first duration, it is determined as a query success, otherwise it is determined as a query failure; it can be that when it is determined that the query is successful, the downgraded query switch is turned off.

[0079] Based on the above embodiments, the beneficial effects of the present application are as follows: The query server receives a data query request sent by a terminal device, and the data query request includes identification information of a target digital resource pair; the query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by the pre - server through the data processing server; when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the pre - server at a first time interval; the query server sends the second conversion parameter to the terminal device. Through the embodiments of the present application, when the query server receives a data query request from a terminal device, it can obtain the first conversion parameter of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can obtain the second conversion parameter of the target digital resource pair in the second database and send it to the terminal device, thereby realizing the acquisition of the conversion parameter of the digital resource pair from other data sources (such as the second database) when the conversion parameter acquisition fails or is unavailable in a data source with higher timeliness (such as the first database), effectively improving the continuity of the data query service and helping to enhance the customer experience.

[0080] Please refer to Figure 3A , Figure 3A which is a schematic flowchart of another data query method provided by the embodiments of the present application. The data query method provided by the embodiments of the present application can be applied to the above - mentioned Figure 1A data query system shown. Hereinafter, taking the application of this data query method to the pre - server in this data query system as an example for illustration. As Figure 3A shown, this data query method includes:

[0081] S301. The pre - server obtains the current conversion parameter of the target digital resource pair.

[0082] In the embodiments of the present application, the data source server can send the current conversion parameter of the target digital resource pair to the pre - server. Among them, the target digital resource pair is any one of each digital resource pair; the data source server uses the FIX protocol to actively push the current conversion parameter of the target digital resource pair to the data source server when the current conversion parameter of the target digital resource pair changes.

[0083] S302. The pre - server writes the first conversion parameter of the target digital resource pair into the first database in real time through the data processing server according to the current conversion parameter of the target digital resource pair.

[0084] In an embodiment of the present application, after receiving the current conversion parameters of the target digital resource pair, the front-end server immediately sends the current conversion parameters of the target digital resource pair to the data processing server. After processing the current conversion parameters of the target digital resource pair, the data processing server writes the first conversion parameters of the processed target digital resource pair into the first database and updates the write time of the first conversion parameters.

[0085] S303. The front-end server writes the second conversion parameters of the target digital resource pair into the second database at a first time interval according to the current conversion parameters of the target digital resource pair, so that after receiving a data query request, the query server queries the second conversion parameters of the target digital resource pair from the second database when the acquisition of the first conversion parameters from the first database fails or the acquired first conversion parameters are unavailable.

[0086] In an embodiment of the present application, after receiving the current conversion parameters of the target digital resource pair, the front-end server may write the second conversion parameters of the target digital resource pair into the second database at a first time interval. After receiving a data query request, when the acquisition of the first conversion parameters from the first database fails or the acquired first conversion parameters are unavailable, the query server may query the second conversion parameters of the target digital resource pair from the second database.

[0087] In a feasible embodiment, the front-end server writing the second conversion parameters of the target digital resource pair into the second database at a first time interval according to the current conversion parameters of the target digital resource pair includes: the front-end server obtains the target time corresponding to the second conversion parameters of the target digital resource pair in the second database, and the target time includes the generation time of the second conversion parameters or the time when the second conversion parameters are written into the second database; if the time interval between the target time and the current time is greater than or equal to the first time interval, and the current conversion parameters of the target digital resource pair are different from the second conversion parameters of the target digital resource pair in the second database, the front-end server updates the second conversion parameters of the target digital resource pair in the second database according to the current conversion parameters of the target digital resource pair.

[0088] Specifically, after receiving the current conversion parameters of the target digital resource pair, the front-end server can obtain the target time corresponding to the second conversion parameters of the target digital resource pair in the second database, determine the time interval between the target time corresponding to the second conversion parameters and the current time. If the time interval is greater than or equal to the first time interval and the current conversion parameters of the target digital resource pair are different from the second conversion parameters of the target digital resource pair in the second database, then replace the current conversion parameters of the target digital resource pair with the second conversion parameters of the target digital resource pair in the second database, and replace the current time with the target time corresponding to the second conversion parameters.

[0089] In a feasible embodiment, the front-end server obtains the update frequency of the target digital resource pair; the front-end server determines the first time interval according to the update frequency of the target digital resource pair.

[0090] Specifically, the front-end server can determine the first time interval for writing the second conversion parameters of the target digital resource pair into the second database according to the update frequency of the target digital resource pair. Determining the first time interval for writing into the second database through the update frequency of the target digital resource pair can make the determined first time interval more scientific and reasonable.

[0091] Based on the above embodiments, the beneficial effects of the present application are as follows: The query server receives a data query request sent by a terminal device, and the data query request includes the identification information of the target digital resource pair; the query server queries the first conversion parameters of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameters of the target digital resource pair are written into the first database in real time by the front-end server through the data processing server; when the acquisition of the first conversion parameters fails or the first conversion parameters are unavailable, the query server queries the second conversion parameters of the target digital resource pair from the second database according to the identification information of the target digital resource pair, and the second conversion parameters of the target digital resource pair are written into the second database by the front-end server at the first time interval; the query server sends the second conversion parameters to the terminal device. Through the embodiments of the present application, when the query server receives a data query request from a terminal device, it can obtain the first conversion parameters of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameters fails or the first conversion parameters are unavailable, it can obtain the second conversion parameters of the target digital resource pair in the second database and send them to the terminal device, thereby realizing the acquisition of the conversion parameters of the digital resource pair from other data sources (such as the second database) when the conversion parameters in a data source with higher timeliness (such as the first database) cannot be obtained, effectively improving the continuity of the data query service and helping to enhance the customer experience.

[0092] Please refer to Figure 3B ,Figure 3B It is a schematic flowchart of another data query method provided by an embodiment of the present application. The data query method provided by the embodiment of the present application can be applied to the above-mentioned Figure 1A shown data query system. Hereinafter, taking the application of this data query method to each server in this data query system as an example for illustration. As Figure 3B shown, this data query method includes:

[0093] S311. The front-end server writes the first conversion parameter of the target digital resource pair into the first database in real time through the data processing server according to the current conversion parameter of the target digital resource pair.

[0094] S312. The front-end server writes the second conversion parameter of the target digital resource pair into the second database at the first time interval according to the current conversion parameter of the target digital resource pair.

[0095] S313. The terminal device sends a data query request to the query server.

[0096] Among them, the data query request includes the identification information of the target digital resource pair.

[0097] S314. The query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair.

[0098] S315. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair.

[0099] S316. The query server sends the second conversion parameter to the terminal device.

[0100] Among them, the specific implementation manners of steps S311-S316 can refer to the relevant descriptions in the foregoing embodiments, and will not be elaborated here.

[0101] Based on the above embodiments, the beneficial effects of the present application are as follows: The query server receives a data query request sent by a terminal device, and the data query request includes the identification information of a target digital resource pair; the query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by a preposed server through a data processing server; when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the preposed server at a first time interval; the query server sends the second conversion parameter to the terminal device. Through the embodiments of the present application, when the query server receives a data query request from a terminal device, it can obtain the first conversion parameter of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can obtain the second conversion parameter of the target digital resource pair in the second database and send it to the terminal device, thereby realizing the acquisition of the conversion parameter of the digital resource pair from other data sources (such as the second database) when the conversion parameter acquisition in a data source with higher timeliness (such as the first database) fails or is unavailable, effectively improving the continuity of the data query service and helping to enhance the customer experience.

[0102] The following introduces a data query device provided by an embodiment of the present application.

[0103] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a data query device provided by an embodiment of the present application. As Figure 4 shown, the data query device includes:

[0104] A receiving unit 401, configured to receive a data query request sent by a terminal device, where the data query request includes the identification information of a target digital resource pair;

[0105] A query unit 402, configured to query the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, where the first conversion parameter of the target digital resource pair is written into the first database in real time by a preposed server through a data processing server;

[0106] The query unit 402 is further configured to, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, query the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, where the second conversion parameter of the target digital resource pair is written into the second database by the preposed server at a first time interval;

[0107] A sending unit 403, configured to send the second conversion parameter to the terminal device.

[0108] In a feasible embodiment, the sending unit 403 is further configured to: obtain an adjustment amount of the conversion parameter of the target digital resource pair; a determining unit 404, configured to determine a third conversion parameter of the target digital resource pair according to the adjustment amount of the conversion parameter and the second conversion parameter; the sending unit 403 is further configured to: send the third conversion parameter to the terminal device.

[0109] In a feasible embodiment, an obtaining unit 405 is configured to obtain fluctuation data of the conversion parameter of the target digital resource pair within a preset time period; the determining unit 404 is further configured to: determine a fluctuation level of the conversion parameter of the target digital resource pair according to the fluctuation data; and determine an adjustment amount of the conversion parameter of the target digital resource pair according to the fluctuation level.

[0110] In a feasible embodiment, the obtaining unit 405 is further configured to obtain a switch state of a downgrade query switch; the querying unit 402 is further configured to: if the switch state indicates that the downgrade query switch is closed, perform the step of querying the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair; if the switch state indicates that the downgrade query switch is open, query the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair.

[0111] In a feasible embodiment, a processing unit 406 is configured to turn on the downgrade query switch when the obtaining of the first conversion parameter fails or the first conversion parameter is unavailable.

[0112] In a feasible embodiment, the querying unit 402 is configured to: when the switch state indicates that the downgrade query switch is open, query the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair at a second time interval to obtain a query result; the processing unit 406 is further configured to: determine a query success rate according to the query result, and turn off the downgrade query switch when the query success rate is greater than or equal to a preset success rate threshold.

[0113] In a feasible embodiment, the obtaining unit 405 is further configured to: obtain the target time corresponding to the first conversion parameter of the target digital resource pair, where the target time includes the generation time of the first conversion parameter or the time when the first conversion parameter is written into the first database; the determining unit 404 is further configured to: if the time interval between the target time and the current time is greater than or equal to the first duration, determine that the first conversion parameter is unavailable.

[0114] In a feasible embodiment, the data query device provided in the embodiments of the present application may be implemented in software. The data query device may be stored in a memory. It may be software in the form of a program and a plug-in, etc., and includes a series of units, including a receiving unit, a query unit, a sending unit, a determining unit, an obtaining unit, and a processing unit; among them, the receiving unit, the query unit, and the sending unit are used to implement the data query method provided in the embodiments of the present application.

[0115] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of another data query device provided in the embodiments of the present application. As Figure 5 shown, the data query device includes:

[0116] An obtaining unit 501, configured to obtain the current conversion parameter of the target digital resource pair;

[0117] A processing unit 502, configured to write the first conversion parameter of the target digital resource pair into the first database in real time through a data processing server according to the current conversion parameter of the target digital resource pair;

[0118] The processing unit 502 is further configured to write the second conversion parameter of the target digital resource pair into the second database at a first time interval according to the current conversion parameter of the target digital resource pair, so that after the query server receives a data query request, when the acquisition of the first conversion parameter from the first database fails or the acquired first conversion parameter is unavailable, the second conversion parameter of the target digital resource pair is queried from the second database.

[0119] In a feasible embodiment, when writing the second conversion parameter of the target digital resource pair to the second database at a first time interval according to the current conversion parameter of the target digital resource pair, the processing unit 502 is specifically configured to: obtain the target time corresponding to the second conversion parameter of the target digital resource pair in the second database, where the target time includes the generation time of the second conversion parameter or the time when the second conversion parameter is written to the second database; if the time interval between the target time and the current time is greater than or equal to the first time interval, and the current conversion parameter of the target digital resource pair is different from the second conversion parameter of the target digital resource pair in the second database, then update the second conversion parameter of the target digital resource pair in the second database according to the current conversion parameter of the target digital resource pair.

[0120] In a feasible embodiment, the obtaining unit 501 is further configured to: obtain the update frequency of the target digital resource pair; the processing unit 502 is further configured to: determine the first time interval according to the update frequency of the target digital resource pair.

[0121] In a feasible embodiment, the data query device provided by the embodiments of the present application can be implemented in a software manner. The data query device can be stored in a memory, and it can be software in the form of a program and a plug-in, etc., and includes a series of units, including an obtaining unit and a processing unit; wherein, the obtaining unit and the processing unit are used to implement the data query method provided by the embodiments of the present application.

[0122] In other feasible embodiments, the data query device provided by the embodiments of the present application can also be implemented in a combination of software and hardware. As an example, the data query device provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data query method provided by the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs, Application Specific Integrated Circuits), DSPs, programmable logic devices (PLDs, Programmable Logic Devices), complex programmable logic devices (CPLDs, Complex Programmable Logic Devices), field-programmable gate arrays (FPGAs, Field-Programmable Gate Arrays) or other electronic components.

[0123] Based on the above embodiments, the beneficial effects of the present application are as follows: The query server receives a data query request sent by a terminal device, and the data query request includes the identification information of the target digital resource pair; The query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by the pre-server through the data processing server; When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the pre-server at a first time interval; The query server sends the second conversion parameter to the terminal device. Through the embodiments of the present application, when the query server receives a data query request from a terminal device, it can obtain the first conversion parameter of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can obtain the second conversion parameter of the target digital resource pair in the second database and send it to the terminal device, thereby realizing the acquisition of the conversion parameter of the digital resource pair from other data sources (such as the second database) when the conversion parameter acquisition fails or is unavailable in a data source with higher timeliness (such as the first database), effectively improving the continuity of the data query service and helping to enhance the customer experience.

[0124] The following introduces a server provided by an embodiment of the present application.

[0125] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a server provided by an embodiment of the present application. As Figure 6 shown, the server in this embodiment may include: one or more processors 601, one or more communication interfaces 602, and a memory 603. The above-mentioned processors 601, communication interfaces 602, and memory 603 are connected through a bus 604. The memory 603 is used to store computer programs, and the computer programs include program instructions. The processor 601 is used to execute the program instructions stored in the memory 603.

[0126] In one embodiment, the server is the above-mentioned query server, and the processor 601 performs the following operations by running the executable program code in the memory 603:

[0127] The query server receives a data query request sent by a terminal device, and the data query request includes the identification information of the target digital resource pair;

[0128] The query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by the pre-server through the data processing server;

[0129] When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database, and the second conversion parameter of the target digital resource pair is written into the second database by the pre-server at a first time interval;

[0130] The query server sends the second conversion parameter to the terminal device.

[0131] In a feasible embodiment, the query server sends the second conversion parameter to the terminal device. The processor 601 is further configured to: the query server obtains an adjustment amount of the conversion parameter of the target digital resource pair; the query server determines a third conversion parameter of the target digital resource pair according to the adjustment amount of the conversion parameter and the second conversion parameter; the query server sends the third conversion parameter to the terminal device.

[0132] In a feasible embodiment, the processor 601 is further configured to: the query server obtains fluctuation data of the conversion parameter of the target digital resource pair within a preset duration; the query server determines a fluctuation level of the conversion parameter of the target digital resource pair according to the fluctuation data; the query server determines an adjustment amount of the conversion parameter of the target digital resource pair according to the fluctuation level.

[0133] In a feasible embodiment, the processor 601 is further configured to: the query server obtains the switch state of the downgraded query switch; if the switch state indicates that the downgraded query switch is closed, the query server executes the step of querying the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair; if the switch state indicates that the downgraded query switch is open, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair.

[0134] In a feasible embodiment, the processor 601 is further configured to: when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server turns on the downgraded query switch.

[0135] In a feasible embodiment, the processor 601 is further configured to: when the switch status indicates that the downgraded query switch is turned on, the query server queries the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair at a second time interval, and obtains a query result; the query server determines a query success rate according to the query result, and turns off the downgraded query switch when the query success rate is greater than or equal to a preset success rate threshold.

[0136] In a feasible embodiment, the processor 601 is further configured to: the query server obtains a target time corresponding to the first conversion parameter of the target digital resource pair, where the target time includes a generation time of the first conversion parameter or a time when the first conversion parameter is written into the first database; if a time interval between the target time and the current time is greater than or equal to a first duration, the query server determines that the first conversion parameter is unavailable.

[0137] In an embodiment, the server is the foregoing front-end server, and the processor 601 executes the following operations by running executable program code in the memory 603: the front-end server obtains a current conversion parameter of the target digital resource pair; the front-end server writes the first conversion parameter of the target digital resource pair into the first database in real time through a data processing server according to the current conversion parameter of the target digital resource pair; the front-end server writes the second conversion parameter of the target digital resource pair into the second database at a first time interval according to the current conversion parameter of the target digital resource pair, so that after the query server receives a data query request, when obtaining the first conversion parameter from the first database fails or the obtained first conversion parameter is unavailable, the query server queries the second conversion parameter of the target digital resource pair from the second database.

[0138] In a feasible embodiment, the front-end server writes the second conversion parameter of the target digital resource pair into the second database at a first time interval according to the current conversion parameter of the target digital resource pair. The processor 601 is further configured to: the front-end server obtains a target time corresponding to the second conversion parameter of the target digital resource pair in the second database, where the target time includes a generation time of the second conversion parameter or a time when the second conversion parameter is written into the second database; if a time interval between the target time and the current time is greater than or equal to the first time interval, and the current conversion parameter of the target digital resource pair is different from the second conversion parameter of the target digital resource pair in the second database, the front-end server updates the second conversion parameter of the target digital resource pair in the second database according to the current conversion parameter of the target digital resource pair.

[0139] In a feasible embodiment, the processor 601 is further configured to: the front-end server obtains the update frequency of the target digital resource pair; the front-end server determines the first time interval according to the update frequency of the target digital resource pair.

[0140] Based on the above embodiments, the beneficial effects of the present application are as follows: The query server receives a data query request sent by a terminal device, and the data query request includes identification information of a target digital resource pair; the query server queries a first conversion parameter of the target digital resource pair from a first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by the front-end server through a data processing server; when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries a second conversion parameter of the target digital resource pair from a second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the front-end server at the first time interval; the query server sends the second conversion parameter to the terminal device. Through the embodiments of the present application, when the query server receives a data query request from a terminal device, it can obtain the first conversion parameter of the target digital resource pair of the data query request in the first database. When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, it can obtain the second conversion parameter of the target digital resource pair in the second database and send it to the terminal device, thereby realizing the acquisition of the conversion parameter of the digital resource pair from other data sources (such as the second database) when the conversion parameter acquisition in a data source with higher timeliness (such as the first database) fails or is unavailable, effectively improving the continuity of the data query service and helping to enhance the customer experience.

[0141] The method steps in the embodiments of the present application can be adjusted, combined, and deleted according to actual needs.

[0142] The units in the embodiments of the present application can be combined, divided, and deleted according to actual needs.

[0143] In the present application, for the description of the same or similar term concepts, technical solutions, and / or application scenarios, generally only the first occurrence is described in detail. When it appears repeatedly later, for the sake of brevity, it is generally not described again. When understanding the technical solutions and other contents of the present application, for the same or similar term concepts, technical solutions, and / or application scenarios that are not described in detail later, reference can be made to the relevant detailed descriptions before.

[0144] In the present application, the descriptions of the various embodiments have their own emphases. For the parts not described or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0145] The technical features of the technical solution of the present application can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as falling within the scope recorded in the present application.

[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, storage disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).

[0147] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A data query method, characterized in that The method includes: The query server receives a data query request sent by a terminal device, and the data query request includes identification information of a target digital resource pair; The query server queries a first conversion parameter of the target digital resource pair from a first database according to the identification information of the target digital resource pair, and the first conversion parameter of the target digital resource pair is written into the first database in real time by a pre - server through a data processing server; When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server queries a second conversion parameter of the target digital resource pair from a second database according to the identification information of the target digital resource pair, and the second conversion parameter of the target digital resource pair is written into the second database by the pre - server at a first time interval; The query server sends the second conversion parameter to the terminal device.

2. The method according to claim 1, wherein The query server sending the second conversion parameter to the terminal device includes: The query server obtains an adjustment amount of the conversion parameter of the target digital resource pair; The query server determines a third conversion parameter of the target digital resource pair according to the adjustment amount of the conversion parameter and the second conversion parameter; The query server sends the third conversion parameter to the terminal device.

3. The method according to claim 2, wherein The method further includes: The query server obtains fluctuation data of the conversion parameter of the target digital resource pair within a preset duration; The query server determines a fluctuation level of the conversion parameter of the target digital resource pair according to the fluctuation data; The query server determines an adjustment amount of the conversion parameter of the target digital resource pair according to the fluctuation level.

4. The method according to any one of claims 1-3, characterized in that The method further includes: The query server obtains the switch state of a downgraded query switch; If the switch state indicates that the downgraded query switch is closed, the query server executes the step of querying the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair; If the switch state indicates that the downgraded query switch is open, the query server queries the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair.

5. The method according to claim 4, characterized in that The method further includes: When the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, the query server turns on the downgraded query switch.

6. The method according to claim 4, wherein The method further includes: When the switch state indicates that the downgraded query switch is open, the query server queries the first conversion parameter of the target digital resource pair from the first database at a second time interval according to the identification information of the target digital resource pair to obtain a query result; The query server determines a query success rate according to the query result, and turns off the downgraded query switch when the query success rate is greater than or equal to a preset success rate threshold.

7. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The query server obtains the target time corresponding to the first conversion parameter of the target digital resource pair, where the target time includes the generation time of the first conversion parameter or the time when the first conversion parameter is written into the first database; If the time interval between the target time and the current time is greater than or equal to the first duration, the query server determines that the first conversion parameter is unavailable.

8. A data query method, characterized in that, The method includes: The front-end server obtains the current conversion parameter of the target digital resource pair; The front-end server, according to the current conversion parameter of the target digital resource pair, writes the first conversion parameter of the target digital resource pair into the first database in real time through the data processing server; The front-end server, according to the current conversion parameter of the target digital resource pair, writes the second conversion parameter of the target digital resource pair into the second database at a first time interval, so that after the query server receives a data query request, when the acquisition of the first conversion parameter from the first database fails or the acquired first conversion parameter is unavailable, it queries the second conversion parameter of the target digital resource pair from the second database.

9. The method according to claim 8, wherein The front-end server writing the second conversion parameter of the target digital resource pair into the second database at a first time interval includes: The front-end server obtains the target time corresponding to the second conversion parameter of the target digital resource pair in the second database, where the target time includes the generation time of the second conversion parameter or the time when the second conversion parameter is written into the second database; If the time interval between the target time and the current time is greater than or equal to the first time interval and the current conversion parameter of the target digital resource pair is different from the second conversion parameter of the target digital resource pair in the second database, the front-end server updates the second conversion parameter of the target digital resource pair in the second database according to the current conversion parameter of the target digital resource pair.

10. The method according to claim 8 or 9, characterized in that, The method further includes: The front-end server obtains the update frequency of the target digital resource pair; The front-end server determines the first time interval according to the update frequency of the target digital resource pair.

11. A data query device, characterized in that, The device includes: A receiving unit, configured to receive a data query request sent by a terminal device, where the data query request includes identification information of a target digital resource pair; A query unit, configured to query the first conversion parameter of the target digital resource pair from the first database according to the identification information of the target digital resource pair, where the first conversion parameter of the target digital resource pair is written into the first database in real time by the front-end server through the data processing server; The query unit is further configured to, when the acquisition of the first conversion parameter fails or the first conversion parameter is unavailable, query the second conversion parameter of the target digital resource pair from the second database according to the identification information of the target digital resource pair, where the second conversion parameter of the target digital resource pair is written into the second database by the front-end server at a first time interval; A sending unit, configured to send the second conversion parameter to the terminal device.

12. A data query device, characterized in that, The device includes: an acquisition unit configured to acquire the current conversion parameters of a target digital resource pair; a processing unit configured to write the first conversion parameters of the target digital resource pair to a first database in real time through a data processing server according to the current conversion parameters of the target digital resource pair; the processing unit is further configured to write the second conversion parameters of the target digital resource pair to a second database at a first time interval according to the current conversion parameters of the target digital resource pair, so that after a query server receives a data query request, when it fails to obtain the first conversion parameters from the first database or the obtained first conversion parameters are unavailable, it queries the second conversion parameters of the target digital resource pair from the second database.

13. A server, characterized in that, including: a processor, a communication interface, and a memory, where the processor, the communication interface, and the memory are interconnected. Among them, the memory stores executable program code, and the processor is configured to call the executable program code to implement the data query method according to any one of claims 1-7 or claims 8-10.

14. A computer-readable storage medium, characterized in that, Computer instructions are stored in the computer-readable storage medium, and when they run on a computer, they cause the computer to implement the data query method according to any one of claims 1-7 or claims 8-10.

15. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, they are used to implement the data query method according to any one of claims 1-7 or claims 8-10.