CN114266572A - Collection method, collection device, collection equipment and collection equipment of exchange rate data - Google Patents

Collection method, collection device, collection equipment and collection equipment of exchange rate data Download PDF

Info

Publication number
CN114266572A
CN114266572A CN202111592451.5A CN202111592451A CN114266572A CN 114266572 A CN114266572 A CN 114266572A CN 202111592451 A CN202111592451 A CN 202111592451A CN 114266572 A CN114266572 A CN 114266572A
Authority
CN
China
Prior art keywords
exchange rate
rate data
time
provider
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111592451.5A
Other languages
Chinese (zh)
Inventor
孙阳明
陈德林
刘贞平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202111592451.5A priority Critical patent/CN114266572A/en
Publication of CN114266572A publication Critical patent/CN114266572A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a collection method, a collection device, collection equipment, a collection equipment and a collection equipment of exchange rate data, and belongs to the technical field of data acquisition and processing. The method comprises the following steps: acquiring real-time exchange rate data of at least one time point in a first period from a data provider; determining historical exchange rate data of a first time period according to real-time exchange rate data of a plurality of different time points in the first time period; historical exchange rate data for a first time period is stored in a distributed storage system, the distributed system being configured to provide the exchange rate data to a plurality of different service consumers. By adopting the technical scheme provided by the embodiment of the application, the stability of the acquired exchange rate data can be improved.

Description

Collection method, collection device, collection equipment and collection equipment of exchange rate data
Technical Field
The present application relates to the field of data acquisition and processing technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for collecting exchange rate data.
Background
For business processing such as e-commerce, live broadcast application, finance and the like, conversion among various currency types is often involved.
In the related art, in order to handle a service involving a plurality of currencies, recent exchange rate data that is open free of charge is acquired through a network query. However, in the process of multiple queries, the providers of the exchange rate data are various, so that the obtained exchange rate data has large fluctuation and is not stable enough.
Disclosure of Invention
The embodiment of the application provides a collection method, a collection device, collection equipment, a storage medium and a program product of exchange rate data. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided a method for collecting exchange rate data, the method including:
acquiring real-time exchange rate data of at least one time point in a first period from a data provider;
determining historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period;
storing the historical exchange rate data for the first time period in a distributed storage system, the distributed system being configured to provide exchange rate data to a plurality of different service consumers.
According to an aspect of an embodiment of the present application, there is provided an apparatus for collecting exchange rate data, the apparatus including:
the data acquisition module is used for acquiring real-time exchange rate data of at least one time point in a first period from a data provider;
the data determining module is used for determining historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period;
and the data storage module is used for storing the historical exchange rate data of the first period into a distributed storage system, and the distributed system is used for providing the exchange rate data to a plurality of different service users.
According to an aspect of the embodiments of the present application, there is provided a computer-readable storage medium, in which a computer program is stored, the computer program being loaded and executed by a processor to implement the above collection method of exchange rate data.
According to an aspect of the embodiments of the present application, there is provided a computer program product, which includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the collection method of the exchange rate data.
The technical scheme provided by the embodiment of the application can bring the following beneficial effects:
the obtained exchange rate data are stored in the distributed storage system, so that the exchange rate data obtained by each service user are the same, and the stability of the obtained exchange rate data is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
FIG. 1 is a schematic illustration of an environment for implementing an embodiment provided by an embodiment of the present application;
FIG. 2 is a flow diagram of a method for collecting exchange rate data provided by one embodiment of the present application;
FIG. 3 is a flow chart of a method for collecting exchange rate data according to another embodiment of the present application;
FIG. 4 is a schematic illustration of currency conversion provided by one embodiment of the present application;
FIG. 5 is a schematic diagram of a distributed storage system provided by one embodiment of the present application;
FIG. 6 is a schematic diagram of a distributed storage system provided by another embodiment of the present application;
FIG. 7 is a block diagram of an apparatus for collecting exchange rate data provided by one embodiment of the present application;
fig. 8 is a block diagram of an apparatus for collecting exchange rate data according to another embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
According to the method provided by the embodiment of the application, the execution main body of each step can be a computer device, and the computer device refers to an electronic device with data calculation, processing and storage capabilities. The Computer device may be a terminal such as a PC (Personal Computer), a tablet, a smartphone, a wearable device, a smart robot, or the like; or may be a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services.
The technical solution of the present application will be described below by means of several embodiments.
Refer to fig. 1, which illustrates a schematic diagram of an environment for implementing an embodiment of the present application. The implementation environment may be implemented as a collection system 10 of exchange rate data. As shown in fig. 1, the system 10 includes: an exchange rate service system 11, a service consumer 12 and a data provider 13. Wherein:
in some embodiments, the exchange rate service system 11 obtains and stores the exchange rate data from the data provider 13. Alternatively, the exchange rate service system 11 may be the computer device described above, or may be provided on a computer device. The service user 12 is used to query and obtain the exchange rate data required in the process of processing the service from the exchange rate service system 11. Optionally, the service user may be an e-commerce system, a financial system, a live application system, and the like, which is not specifically limited in this embodiment of the present application.
Optionally, the exchange rate service system 11 includes an exchange rate query module 14, an exchange rate configuration module 15 and an exchange rate routing module 16. Wherein, the exchange rate query module 14 is used for providing the exchange rate data query service to the service user 12, the exchange rate configuration module 15 is used for calculating the exchange rate data of some currency pairs, and the exchange rate routing module 16 is used for obtaining the exchange rate data from the data provider 13.
Referring to fig. 2, a flowchart of a collection method of exchange rate data according to an embodiment of the present application is shown. The method comprises the following steps (201-203):
step 201, obtaining real-time exchange rate data of at least one time point in a first time period from a data provider.
In some embodiments, a data provider refers to a data source that is capable of providing real-time exchange rate data, such as a website or a functional module in the website that provides real-time exchange rate data specifically. The first period may be within a certain day, a certain week, a certain month, and the like, which is not specifically limited in this embodiment of the application. Illustratively, the first period of time refers to a day and the at least one time point is one or more time points in the day. For example, the at least one time point may be three time points of 00:30, 12:00 and 23:00 in a certain day, and the real-time exchange rate data refers to exchange rate data provided by the data provider and corresponding to the three time points of 00:30, 12:00 and 23:00 in the certain day respectively.
Optionally, the real-time exchange rate data is acquired from a fixed data provider, so that fluctuation of the acquired exchange rate data can be reduced, and stability of the exchange rate data can be improved. Optionally, the exchange rate data provided by the data provider is provided for paid offering or paid offering, and this is not particularly limited in the embodiment of the present application.
Step 202, determining historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period.
In some embodiments, for two currencies, if the at least one point in time comprises a plurality of points in time, the historical exchange rate data for the first time period may be an average of real-time exchange rate ratios of the two currencies at the at least one point in time; if at least one time point includes only one time point, the historical exchange rate data of the first time period is the real-time exchange rate ratio of the two currencies at the time point.
Step 203, storing the historical exchange rate data of the first time period in the distributed storage system.
In some embodiments, a distributed storage system may employ KV (Key-Value) storage, the distributed storage system being used to provide exchange rate data to a plurality of different service users. Communication connection is established between a plurality of different service users and the distributed storage system, and historical exchange rate data in a first period of time is stored in the storage system for each service user to inquire.
Optionally, the real-time exchange rate data of at least one time point in the first time period is stored in the distributed storage system. Under the condition that the historical exchange rate data of the first time interval is lost or cannot be inquired, the historical exchange rate data of the first time interval can be obtained through recalculation by acquiring the pre-stored real-time exchange rate data of at least one time point in the first time interval. Therefore, the acquisition stability of the exchange rate data is improved, and the loss risk of the exchange rate data is reduced.
In summary, according to the technical scheme provided by the embodiment of the present application, the obtained exchange rate data is stored in the distributed storage system, so that the exchange rate data obtained by each service user is ensured to be the same, and thus the stability of the obtained exchange rate data is improved.
Referring to fig. 3, a flowchart of a collection method of exchange rate data according to an embodiment of the present application is shown. The method may comprise at least one of the following steps (301-308):
step 301, sending a first obtaining request to a primary provider, where the first obtaining request is used to request real-time exchange rate data of at least one time point in a first time period from the primary provider.
In some embodiments, the data providers include a primary provider and a backup provider. The method comprises the steps of firstly requesting a main provider to acquire real-time exchange rate data of at least one time point in a first time period. Optionally, the primary provider is more favorable than the backup provider for a fee, or more timely than the backup provider's exchange rate data is updated, or more accurate than the backup provider's exchange rate data, or more stable than the backup provider's exchange rate data, or more convenient than obtaining exchange rate data from the backup provider. Optionally, the first acquisition request further includes a currency corresponding to the requested acquisition rate data, such as a real-time rate ratio of $ to RMB.
In some embodiments, after step 301, the following steps are also included:
1. under the condition that the first feedback information from the main provider is not received, a second acquisition request is sent to the standby provider;
2. receiving second feedback information from the standby provider;
3. the second feedback information is stored.
In this embodiment, when the first acquisition request fails to be received for a plurality of times, or the first feedback information from the primary provider is not received, or the first acquisition request is not sent after being overtime or the first feedback information is not received after being overtime, time is not wasted to continue waiting for the first feedback information, but a second acquisition request is selected to be sent to the standby provider to acquire and store the real-time exchange rate data provided by the provider. Illustratively, the second acquisition request is for requesting acquisition of a real-time exchange rate ratio of currency 1, currency B, and the second feedback information includes the real-time exchange rate ratio of currency 1, currency C, and a corresponding time provided by the alternate provider.
Step 302, receiving first feedback information from a primary provider, wherein the first feedback information includes real-time exchange rate data of at least one time point in a first time period provided by the primary provider.
In some embodiments, first feedback information generated by the master provider according to the first acquisition request is received, and rate data requested to be acquired by the first acquisition request, that is, real-time rate data of at least one time point in the first time period, may be acquired through the first feedback information.
Step 303, sending a second obtaining request to the standby provider, where the second obtaining request is used to request real-time exchange rate data of at least one time point in the first time period from the standby provider.
In some embodiments, after the first feedback information from the primary provider is acquired, the second acquisition request is continuously sent to the standby provider to acquire the real-time exchange rate data of at least one time point in the first period provided by the standby provider.
Step 304, receiving second feedback information from the standby provider, the second feedback information including real-time exchange rate data of at least one time point in the first time period provided by the standby provider.
In the case where it is determined that the first feedback information is valid based on the second feedback information, step 305, the first feedback information is stored and the second feedback information is discarded.
In some embodiments, the real-time exchange rate data at least at one time point in the first time period provided by the primary provider is compared with the real-time exchange rate data at least at one time point in the first time period provided by the backup provider, and if the difference between the exchange rate data provided by the primary provider and the exchange rate data provided by the backup provider is small, the first feedback information (i.e., the exchange rate data provided by the primary provider) can be considered to be more reliable and the information is valid, only the first feedback information (i.e., the real-time exchange rate data at least at one time point in the first time period provided by the primary provider) is stored for the service user, and the second feedback information is discarded to save storage resources.
Alternatively, the difference between the exchange rate data provided by the primary provider and the exchange rate data provided by the backup provider is smaller, which may mean that the ratio between the difference between the exchange rate data provided by the primary provider and the exchange rate data provided by the backup provider and the exchange rate data provided by the primary provider is smaller than or equal to a threshold value. Conversely, if the ratio is greater than the threshold, it indicates that the exchange rate data provided by the primary provider is far from the exchange rate data provided by the backup provider, and the first feedback information may be considered invalid.
In some possible implementations, in a case that it is determined that the first feedback information is invalid based on the second feedback information, generating alarm information, where the alarm information is used to trigger human intervention to calibrate real-time exchange rate data of at least one time point within the first time period. And under the condition that the first feedback information is invalid, starting manual investigation and calibration, for example, determining exchange rate data with higher reliability from the real-time exchange rate data of at least one time point respectively provided by the main provider and the standby provider through experience or previously stored real-time exchange rate data of each time point, and storing the exchange rate data as the real-time exchange rate data of the corresponding time point in the distributed storage system, thereby further improving the stability and reliability of the obtained exchange rate data. Optionally, after triggering the manual intervention calibration, the real-time exchange rate data of at least one time point in the first period is obtained from other data providers except the primary provider and the standby provider, and the exchange rate data obtained from the other data providers is compared with the primary provider and the standby provider (refer to the comparison process of the exchange rate data of the primary provider and the standby provider), so as to determine whether the first feedback information of the primary provider is valid.
Step 306, determining real-time exchange rate data of at least one other currency pair for at least one time point within the first time period based on real-time exchange rate data of at least one target currency pair for at least one time point within the first time period.
In some embodiments, the real-time exchange rate data of at least one target currency pair is acquired from the data provider, and based on the acquired real-time exchange rate data of the target currency pair, the real-time exchange rate data of other currency pairs in corresponding time periods or time points can be calculated, so that the number of times of acquiring the exchange rate data from the data provider is reduced, and further the cost of acquiring the exchange rate data is saved.
In some embodiments, the currencies in the target currency pair are the currencies commonly used in global commerce (e.g., U.S. dollars, RMB, Euro, etc.), and as shown in FIG. 3, there is exchange rate data between one currency and multiple other currencies. Because the transaction amount and the transaction scale of the common currency participating in the transaction are large, the exchange rate data of the currency pair containing the common currency is stable and accurate, and the credibility is high, so that the exchange rate data of the currency pair containing the common currency can be obtained from a data provider. The exchange rate data between two uncommon currencies can be calculated by obtaining the exchange rate data between two uncommon currencies of one common currency.
Illustratively, as shown in fig. 4, given that the real-time exchange rate ratio of currency type 41 (i.e., common currency a) and currency type 42 (i.e., common currency B) in the target currency pair at a time point is 1: 6.3748, and the real-time exchange rate ratio of currency type 41 and currency type 43 (i.e., common currency C) at the time point is 1: 113.67, the real-time exchange rate ratio of currency type 42 and currency type 43 at the time point can be calculated to be 6.3748: 113.67 ≈ 1: 17.83.
Step 307, determining historical exchange rate data of the first time period according to an average value of the real-time exchange rate data of a plurality of different time points in the first time period.
In some embodiments, the average of the real-time exchange rate data of at least one time point is obtained by directly summing the real-time exchange rate data of each time point and dividing the sum by the number of at least one time point. Illustratively, if currency a and currency B correspond to real-time exchange rate ratios of 1: 113.67, 1: 113.96, and 1: 113.44 at three time points in a day, respectively, historical exchange rate data for currency a and currency B at a first time period may be calculated as follows: 1/113.67+1/113.96+1/113.44 is 1/113.6896 is 1: 113.6896, and the historical exchange rate data of currency a and currency B in the first time period is 1: 113.6896.
In some embodiments, the average of the real-time exchange rate ratios of the at least one time point is obtained by first calculating the reciprocal of the real-time exchange rate ratio of each time point, then summing the reciprocals of the real-time exchange rate ratios respectively corresponding to each time point to obtain a reciprocal sum, and then dividing the reciprocal sum by the number of the at least one time point to obtain the historical exchange rate data of the first time period. Illustratively, if currency a and currency B correspond to real-time exchange rate ratios of 1: 113.67, 1: 113.96, and 1: 113.44 at three time points in a day, respectively, historical exchange rate data for currency a and currency B at a first time period may be calculated as follows: the inverses of the real-time exchange rate ratios corresponding to the three time points are 113.67, 113.96 and 113.44 respectively; the average of the inverses of the three time points is (113.67+113.96+ 113.44)/3-113.69, and the inverse of 113.69 is 1: 113.69, then the historical exchange rate data of currency a and currency B in the first time period is 1: 113.69.
And 308, respectively storing the historical exchange rate data of the first time period into the main database and the main cache node.
In some embodiments, as shown in FIG. 5, the distributed storage system 50 includes a distributed database 51 and a distributed cache 52. As shown in fig. 6, the plurality of databases in the distributed database 51 include a master database 61 and at least one slave database 62, and the plurality of cache nodes in the distributed cache 52 include a master cache node 63 and at least one slave cache node 64. The master database is used for synchronizing the historical exchange rate data of the first time period to the slave database for storage, and the master cache node is used for synchronizing the historical exchange rate data of the first time period to the slave cache node for storage.
Illustratively, after the rate data a is acquired by the rate service system of singapore, the rate data a is stored in the distributed cache nodes of singapore and the singapore database, as shown in fig. 6, at this time, the singapore database is taken as a master database 61, the america database, the european database and the chinese database are taken as slave databases 62, and the rate data a is synchronously stored in the several slave databases 62 (i.e., the america database, the european database and the chinese database) from the master database 62 (i.e., the singapore database).
Exemplarily, after the exchange rate data a is obtained by the exchange rate service system of singapore, the exchange rate data a is stored in the singapore distributed cache nodes and the singapore database, as shown in fig. 6, at this time, the singapore distributed cache nodes are used as the main cache nodes 63, the america distributed cache nodes, the europe distributed cache nodes and the china distributed cache nodes are all used as the secondary cache nodes 64, and the exchange rate data a is synchronously cached from the main cache node 64 (i.e., the singapore distributed cache nodes) to several secondary cache nodes 64 (i.e., the america distributed cache nodes, the europe distributed cache nodes and the china distributed cache nodes).
In some embodiments, optionally, the database is mysql, and the task schedule employs XXL-JOB. When a service user needs to acquire exchange rate data from the distributed storage system, according to the principle of proximity, access delay is reduced as much as possible, and the time of data query is shortened: inquiring required exchange rate data from a local cache of an exchange rate service node nearby a service user preferentially; if the required exchange rate data cannot be inquired from the local cache of the adjacent exchange rate service node of the service user, then the required exchange rate data is inquired from the nearest distributed cache node; if the required exchange rate data cannot be inquired in the nearest distributed cache node, inquiring the required exchange rate data from the nearest database; if the required exchange rate data cannot be inquired in the nearest database, the required exchange rate data is inquired from the distributed cache nodes and the databases in other regions in sequence. That is, the query priority of the exchange rate data is: local cache > distributed cache node > database.
Illustratively, when a service user in china needs to obtain exchange rate data from the distributed storage system, the service user in china preferably queries the required exchange rate data from the local cache of the adjacent exchange rate service node; if the required exchange rate data can not be inquired from the local cache of the adjacent exchange rate service node of the service user, then inquiring the exchange rate data from the distributed cache Chinese node; if the required exchange rate data can not be inquired from the distributed cache Chinese nodes, inquiring the exchange rate data from the Chinese database; if the required exchange rate data can not be inquired from the Chinese database, inquiring the exchange rate data from the distributed cache Singapore node; if the required exchange rate data can not be inquired from the distributed cache Singapore node, the exchange rate data … … is inquired from the Singapore database
In some embodiments, the distributed storage system corresponds to a plurality of query nodes deployed in a distributed manner, each query node having a corresponding local cache, cache node, and database; the data query priority is sequentially from high to low as: local cache, cache node, database.
In summary, according to the technical scheme provided by the embodiment of the application, the exchange rate data provided by the standby provider and the exchange rate data provided by the main provider are compared and verified, so that the accuracy and reliability of the stored exchange rate data are improved.
In addition, the exchange rate Data is stored in a multi-level distributed manner through a CRDT (Convergent Replicated Data Type), and each database and each distributed cache node keep synchronization for the exchange rate Data at the same time point, so that the uniformity and consistency of the inquired exchange rate Data in different areas are ensured, the stability of the exchange rate Data is improved, and the influence on the service due to unstable exchange rate is reduced; in addition, the exchange rate data is stored in a multi-level distributed mode, and the risk of losing the exchange rate data is reduced.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a block diagram of an apparatus for collecting exchange rate data according to an embodiment of the present application is shown. The device has the function of realizing the collection method of the exchange rate data, and the function can be realized by hardware or by hardware executing corresponding software. The device can be a computer device and can also be arranged in the computer device. The apparatus 700 may include: a data acquisition module 710, a data determination module 720, and a data storage module 730.
The data obtaining module 710 is configured to obtain real-time exchange rate data of at least one time point in a first period from a data provider.
The data determining module 720 is configured to determine historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period.
The data storage module 730 is configured to store the historical exchange rate data of the first time period in a distributed storage system, where the distributed storage system is configured to provide the exchange rate data to a plurality of different service users.
In an exemplary embodiment, the data providers include a primary provider and a backup provider; the data obtaining module 710 is configured to:
sending a first acquisition request to the main provider, wherein the first acquisition request is used for requesting real-time exchange rate data of at least one time point in the first time period from the main provider;
receiving first feedback information from the primary provider, wherein the first feedback information comprises real-time exchange rate data of at least one time point in the first time period provided by the primary provider;
sending a second acquisition request to the standby provider, wherein the second acquisition request is used for requesting real-time exchange rate data of at least one time point in the first time period from the standby provider;
receiving second feedback information from the standby provider, wherein the second feedback information comprises real-time exchange rate data of at least one time point in the first time period provided by the standby provider;
in a case where it is determined that the first feedback information is valid based on the second feedback information, the first feedback information is stored and the second feedback information is discarded.
In an exemplary embodiment, as shown in fig. 8, the apparatus 700 further comprises: an information generation module 740.
The information generating module 740 is configured to generate warning information, where the warning information is used to trigger manual intervention to calibrate real-time exchange rate data of at least one time point in the first time period, in a case that it is determined that the first feedback information is invalid based on the second feedback information.
In an exemplary embodiment, as shown in fig. 8, the apparatus 700 further comprises: a request sending module 750, an information receiving module 760 and an information storing module 770.
The request sending module 750 is configured to send the second obtaining request to the standby provider when the first feedback information from the primary provider is not received.
The information receiving module 760 is configured to receive the second feedback information from the standby provider.
The information storage module 770 is configured to store the second feedback information.
In an exemplary embodiment, real-time exchange rate data for at least one target currency pair is obtained from the data provider; the data determining module 720 is further configured to determine real-time exchange rate data of at least one other currency pair at least one time point within the first time period based on real-time exchange rate data of the at least one target currency pair at least one time point within the first time period.
In an exemplary embodiment, the data determining module 720 is configured to determine the historical exchange rate data of the first time period according to an average of the real-time exchange rate data of a plurality of different time points in the first time period.
In an exemplary embodiment, the distributed storage system comprises a distributed database and a distributed cache, wherein a plurality of databases in the distributed database comprise a master database and at least one slave database, and a plurality of cache nodes in the distributed cache comprise a master cache node and at least one slave cache node; the data storage module 730 is configured to store the historical exchange rate data of the first time period into the master database and the master cache node respectively; the master database is used for synchronizing the historical exchange rate data of the first time period to the slave database for storage, and the master cache node is used for synchronizing the historical exchange rate data of the first time period to the slave cache node for storage.
In an exemplary embodiment, the distributed storage system corresponds to a plurality of query nodes deployed in a distributed manner, each query node having a corresponding local cache, cache node, and database; the data query priority is sequentially from high to low as: the local cache, the cache node, and the database.
In summary, according to the technical scheme provided by the embodiment of the present application, the obtained exchange rate data is stored in the distributed storage system, so that the exchange rate data obtained by each service user is ensured to be the same, and thus the stability of the obtained exchange rate data is improved.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the content structure of the device may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
In an exemplary embodiment, a computer device is also provided. The computer device comprises a processor and a memory, in which a computer program is stored, which computer program is loaded and executed by the processor to implement the above-mentioned collection method of exchange rate data.
In an exemplary embodiment, a computer-readable storage medium is also provided, in which a computer program is stored, the computer program being loaded and executed by a processor to implement the above-mentioned collection method of exchange rate data.
In an exemplary embodiment, a computer program product is also provided, which includes computer instructions stored in a computer-readable storage medium, from which a processor reads and executes the computer instructions to implement the above-mentioned collection method of exchange rate data.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, the step numbers described herein only exemplarily show one possible execution sequence among the steps, and in some other embodiments, the steps may also be executed out of the numbering sequence, for example, two steps with different numbers are executed simultaneously, or two steps with different numbers are executed in a reverse order to the order shown in the figure, which is not limited by the embodiment of the present application.
The above description is only exemplary of the present application and is not intended to limit the present application, and any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method of collecting exchange rate data, the method comprising:
acquiring real-time exchange rate data of at least one time point in a first period from a data provider;
determining historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period;
storing the historical exchange rate data for the first time period in a distributed storage system, the distributed system being configured to provide exchange rate data to a plurality of different service consumers.
2. The method of claim 1, wherein the data providers comprise a primary provider and a backup provider;
the acquiring real-time exchange rate data of at least one time point in a first period from a data provider comprises:
sending a first acquisition request to the main provider, wherein the first acquisition request is used for requesting real-time exchange rate data of at least one time point in the first time period from the main provider;
receiving first feedback information from the primary provider, wherein the first feedback information comprises real-time exchange rate data of at least one time point in the first time period provided by the primary provider;
sending a second acquisition request to the standby provider, wherein the second acquisition request is used for requesting real-time exchange rate data of at least one time point in the first time period from the standby provider;
receiving second feedback information from the standby provider, wherein the second feedback information comprises real-time exchange rate data of at least one time point in the first time period provided by the standby provider;
in a case where it is determined that the first feedback information is valid based on the second feedback information, the first feedback information is stored and the second feedback information is discarded.
3. The method of claim 2, further comprising:
and generating alarm information under the condition that the first feedback information is determined to be invalid based on the second feedback information, wherein the alarm information is used for triggering manual intervention to calibrate the real-time exchange rate data of at least one time point in the first time period.
4. The method of claim 2, wherein after sending the first acquisition request to the primary provider, further comprising:
sending the second acquisition request to the standby provider under the condition that the first feedback information from the primary provider is not received;
receiving the second feedback information from the standby provider;
and storing the second feedback information.
5. The method of claim 1, wherein real-time exchange rate data for at least one target currency pair is obtained from the data provider;
after the obtaining of the real-time exchange rate data of at least one time point in the first period from the data provider, the method further includes:
determining real-time exchange rate data for at least one other currency pair at least one point in time within the first time period based on real-time exchange rate data for the at least one target currency pair at the at least one point in time within the first time period.
6. The method of claim 1, wherein determining historical exchange rate data for the first time period based on real-time exchange rate data for a plurality of different time points within the first time period comprises:
and determining historical exchange rate data of the first time period according to the average value of the real-time exchange rate data of a plurality of different time points in the first time period.
7. The method of claim 1, wherein the distributed storage system comprises a distributed database and a distributed cache, wherein a plurality of databases in the distributed database comprise a master database and at least one slave database, and wherein a plurality of cache nodes in the distributed cache comprise a master cache node and at least one slave cache node;
the storing the historical exchange rate data of the first period of time into a distributed storage system comprises:
storing the historical exchange rate data of the first time period into the main database and the main cache node respectively;
the master database is used for synchronizing the historical exchange rate data of the first time period to the slave database for storage, and the master cache node is used for synchronizing the historical exchange rate data of the first time period to the slave cache node for storage.
8. The method of claim 7, wherein the distributed storage system corresponds to a plurality of query nodes deployed in a distributed manner, each query node having a corresponding local cache, cache node, and database; the data query priority is sequentially from high to low as: the local cache, the cache node, and the database.
9. An apparatus for collecting exchange rate data, the apparatus comprising:
the data acquisition module is used for acquiring real-time exchange rate data of at least one time point in a first period from a data provider;
the data determining module is used for determining historical exchange rate data of the first time period according to the real-time exchange rate data of a plurality of different time points in the first time period;
and the data storage module is used for storing the historical exchange rate data of the first period into a distributed storage system, and the distributed system is used for providing the exchange rate data to a plurality of different service users.
10. A computer device, characterized in that the computer device comprises a processor and a memory, in which a computer program is stored, which computer program is loaded and executed by the processor to implement the method according to any of claims 1 to 8.
11. A computer-readable storage medium, in which a computer program is stored which is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.
12. A computer program product comprising computer instructions stored in a computer readable storage medium, from which a processor reads and executes the computer instructions to implement the method of any one of claims 1 to 8.
CN202111592451.5A 2021-12-23 2021-12-23 Collection method, collection device, collection equipment and collection equipment of exchange rate data Pending CN114266572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111592451.5A CN114266572A (en) 2021-12-23 2021-12-23 Collection method, collection device, collection equipment and collection equipment of exchange rate data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111592451.5A CN114266572A (en) 2021-12-23 2021-12-23 Collection method, collection device, collection equipment and collection equipment of exchange rate data

Publications (1)

Publication Number Publication Date
CN114266572A true CN114266572A (en) 2022-04-01

Family

ID=80829310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111592451.5A Pending CN114266572A (en) 2021-12-23 2021-12-23 Collection method, collection device, collection equipment and collection equipment of exchange rate data

Country Status (1)

Country Link
CN (1) CN114266572A (en)

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655947A (en) * 2008-08-21 2010-02-24 阿里巴巴集团控股有限公司 Online transaction method and online transaction system for realizing off-shore transaction
CN106855869A (en) * 2015-12-09 2017-06-16 中国移动通信集团公司 A kind of methods, devices and systems for realizing database High Availabitity
US20170236119A1 (en) * 2016-01-25 2017-08-17 NetSuite Inc. System and method for implementing multi-rate currency aspects of multi-book accounting
CN107231395A (en) * 2016-03-25 2017-10-03 阿里巴巴集团控股有限公司 Date storage method, device and system
US9880933B1 (en) * 2013-11-20 2018-01-30 Amazon Technologies, Inc. Distributed in-memory buffer cache system using buffer cache nodes
CN107851276A (en) * 2015-06-12 2018-03-27 比尔交易私人有限公司 The computer implemented more collection of currency invoice, transaction, access and payment systems
KR20180100101A (en) * 2018-08-30 2018-09-07 소다크루 주식회사 System for providing global money transferring service
CN108898486A (en) * 2018-06-08 2018-11-27 麒麟合盛网络技术股份有限公司 A kind of method and apparatus of currency exchange
US20190095992A1 (en) * 2017-09-24 2019-03-28 Annie Mafotsing Soh Method and system to facilitate decentralized money services software as a service
US20190272535A1 (en) * 2016-11-22 2019-09-05 Sodacrew Inc. System for providing overseas remittance service
CN111008826A (en) * 2019-12-06 2020-04-14 深圳前海微众银行股份有限公司 Multi-currency transaction method, device, equipment and computer readable storage medium
CN111445327A (en) * 2020-03-16 2020-07-24 腾讯科技(深圳)有限公司 Data resource processing method and device, computer storage medium and electronic equipment
CN111553796A (en) * 2020-04-28 2020-08-18 腾讯科技(深圳)有限公司 Exchange rate management method and device and computer readable storage medium
CN111801702A (en) * 2019-08-01 2020-10-20 深圳海付移通科技有限公司 Cross-border tax refund method, server and computer storage medium
CN113052600A (en) * 2021-04-30 2021-06-29 中国银行股份有限公司 Bank note collection and mutual conversion system and method based on block chain and bank note collection and mutual conversion node
CN113159954A (en) * 2021-05-10 2021-07-23 中付(深圳)技术服务有限公司 International currency exchange rate risk management method based on time series
WO2021176375A1 (en) * 2020-03-04 2021-09-10 株式会社寺岡精工 Sales system
CN113448997A (en) * 2021-06-22 2021-09-28 深信服科技股份有限公司 Cache processing method and device, electronic equipment and storage medium
CN113537989A (en) * 2021-08-04 2021-10-22 刘天琼 Intelligent digital cross-border payment AI distributed engine platform
CN113641720A (en) * 2021-08-17 2021-11-12 连连宝(杭州)信息技术有限公司 Data processing method and device, computer equipment and readable storage medium

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655947A (en) * 2008-08-21 2010-02-24 阿里巴巴集团控股有限公司 Online transaction method and online transaction system for realizing off-shore transaction
US9880933B1 (en) * 2013-11-20 2018-01-30 Amazon Technologies, Inc. Distributed in-memory buffer cache system using buffer cache nodes
CN107851276A (en) * 2015-06-12 2018-03-27 比尔交易私人有限公司 The computer implemented more collection of currency invoice, transaction, access and payment systems
CN106855869A (en) * 2015-12-09 2017-06-16 中国移动通信集团公司 A kind of methods, devices and systems for realizing database High Availabitity
US20170236119A1 (en) * 2016-01-25 2017-08-17 NetSuite Inc. System and method for implementing multi-rate currency aspects of multi-book accounting
CN107231395A (en) * 2016-03-25 2017-10-03 阿里巴巴集团控股有限公司 Date storage method, device and system
US20190272535A1 (en) * 2016-11-22 2019-09-05 Sodacrew Inc. System for providing overseas remittance service
US20190095992A1 (en) * 2017-09-24 2019-03-28 Annie Mafotsing Soh Method and system to facilitate decentralized money services software as a service
CN108898486A (en) * 2018-06-08 2018-11-27 麒麟合盛网络技术股份有限公司 A kind of method and apparatus of currency exchange
KR20180100101A (en) * 2018-08-30 2018-09-07 소다크루 주식회사 System for providing global money transferring service
CN111801702A (en) * 2019-08-01 2020-10-20 深圳海付移通科技有限公司 Cross-border tax refund method, server and computer storage medium
CN111008826A (en) * 2019-12-06 2020-04-14 深圳前海微众银行股份有限公司 Multi-currency transaction method, device, equipment and computer readable storage medium
WO2021176375A1 (en) * 2020-03-04 2021-09-10 株式会社寺岡精工 Sales system
CN111445327A (en) * 2020-03-16 2020-07-24 腾讯科技(深圳)有限公司 Data resource processing method and device, computer storage medium and electronic equipment
CN111553796A (en) * 2020-04-28 2020-08-18 腾讯科技(深圳)有限公司 Exchange rate management method and device and computer readable storage medium
CN113052600A (en) * 2021-04-30 2021-06-29 中国银行股份有限公司 Bank note collection and mutual conversion system and method based on block chain and bank note collection and mutual conversion node
CN113159954A (en) * 2021-05-10 2021-07-23 中付(深圳)技术服务有限公司 International currency exchange rate risk management method based on time series
CN113448997A (en) * 2021-06-22 2021-09-28 深信服科技股份有限公司 Cache processing method and device, electronic equipment and storage medium
CN113537989A (en) * 2021-08-04 2021-10-22 刘天琼 Intelligent digital cross-border payment AI distributed engine platform
CN113641720A (en) * 2021-08-17 2021-11-12 连连宝(杭州)信息技术有限公司 Data processing method and device, computer equipment and readable storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李兆延 等: "云计算导论", vol. 1, 31 August 2020, 航空工业出版社, pages: 43 - 44 *
鲍居武 等: "计算机网络基础及典型案例", vol. 1, 30 June 2000, 北京理工大学出版社, pages: 50 - 51 *
黄巧玲;谢维波;: "基于.NET的汇率信息服务系统的设计与实现", 计算机工程与设计, vol. 28, no. 15, 8 August 2007 (2007-08-08), pages 3705 - 3708 *

Similar Documents

Publication Publication Date Title
CN111522641B (en) Task scheduling method, device, computer equipment and storage medium
RU2612583C2 (en) Marketplace for timely event data distribution
US7428522B1 (en) Real-time search term popularity determination, by search origin geographic location
CN109117275B (en) Account checking method and device based on data slicing, computer equipment and storage medium
CN103607424B (en) Server connection method and server system
US20050033809A1 (en) Communications system providing server load balancing based upon weighted health metrics and related methods
CN113127564B (en) Parameter synchronization method and device
CN106952085B (en) Method and device for data storage and service processing
CN112799839A (en) Request processing method and device, computer readable storage medium and electronic equipment
CN106161519A (en) A kind of information getting method and device
CN108900314A (en) A kind of the number of request charging method and device of network acceleration service
CN103209102A (en) Web quality of service distributed measurement system and method
CN106789147B (en) Flow analysis method and device
CN108629050B (en) Service data adjustment method, device, computer equipment and storage medium
CN109560940A (en) A kind of charging method and device of content distribution network CDN service
CN113194339A (en) Live list generation method and device, electronic equipment and readable storage medium
EP3407568A1 (en) Service processing method and device
US11522995B2 (en) Number management system, number management method, and number management device
CN114266572A (en) Collection method, collection device, collection equipment and collection equipment of exchange rate data
CN111488344A (en) User operation data uplink method and system based on service data block chain
CN112035760B (en) Task allocation method and computer equipment
CN111309673B (en) Snapshot data generation method and device for incremental data
CN110995890B (en) Domain name request scheduling method and device
CN113037420A (en) Reading time stamp obtaining method and device, electronic equipment and storage medium
CN112669160A (en) Data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination