Resource exchange rate processing method based on time window and related equipment
By simulating online resource exchange rates using offline rates and their differences, the method addresses low response success rates during non-open windows, improving service performance through accurate and authentic rate simulations.
Patent Information
- Application Number
- CN202411192666.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-17
AI Technical Summary
Existing resource exchange rate inquiry services face low response success rates during the non-open time period of the online resource exchange time window, leading to poor service performance due to the inability to provide online resource exchange rates.
A method and device that sample and calculate differences between real online and offline resource exchange rates during the open window, allowing simulation of online rates based on offline rates when online rates are unavailable, thereby enhancing response success rates.
Improves the response success rate of online resource exchange rate inquiries by anchoring simulated rates to real-time offline rates, ensuring accuracy and authenticity, thus enhancing service performance.
Smart Images

Figure CN119151601A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, specifically to the field of computer technology, and in particular to a time window-based resource exchange rate processing and related equipment. Background Art
[0002] With the development of computer technology, more and more third-party organizations can provide resource exchange services and resource exchange rate inquiry services for objects (such as users). The so-called resource exchange refers to: using one resource in a resource pair to exchange for another resource in the resource pair; the time window for resource exchange can be divided into: online resource exchange time window and offline resource exchange time window. Among them, the online resource exchange time window refers to the time window for resource exchange at the online resource exchange rate, and the online resource exchange rate refers to: the resource exchange rate used when exchanging resources through a designated resource exchange agency (such as a resource exchange office set up in the issuing area of one of the resources in the resource pair); the offline resource exchange time window refers to the time window for resource exchange at the offline resource exchange rate, and the offline resource exchange rate refers to: the resource exchange rate used when the resource exchange is not carried out through the designated resource exchange agency.
[0003] It can be seen that the online resource exchange rate exists in the opening process of the online resource exchange time window, and the offline resource exchange rate exists in the opening process of the offline resource exchange window. Since the existing offline resource exchange time window can usually cover the online resource exchange time window, for example, the online resource exchange time window can be 9:30-16:30 on weekdays, and the offline resource exchange time window can be 00:00-24:00 on weekdays (i.e., all day); therefore, when in the open time period of the online resource exchange time window, the resource exchange rate inquiry service provided by the third-party agency can support the object to inquire about the online resource exchange rate and offline resource exchange rate of the resource pair, but when in the non-open time period of the online resource exchange time window, the resource exchange rate inquiry service provided by the third-party agency can only support the object to inquire about the offline resource exchange rate of the resource pair, and cannot provide the object with the online resource exchange rate to respond to the inquiry request when receiving the inquiry request for the online resource exchange rate, which easily leads to a low response success rate of the inquiry request, thereby resulting in poor service performance of the third-party agency. Summary of the invention
[0004] The embodiment of the present application provides a resource exchange rate processing method based on a time window and related equipment, which can improve the response success rate of inquiry requests about online resource exchange rates, thereby improving the service performance of a third-party organization.
[0005] In one aspect, an embodiment of the present application provides a method for processing resource exchange rates based on a time window, the method comprising:
[0006] In the process of opening the online resource exchange time window, N groups of resource exchange rates of the target resource pairs are sampled, where N is a positive integer; any group of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time;
[0007] Calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each set of resource exchange rates to obtain N rate differences;
[0008] When receiving a query request for the online resource exchange rate of the target resource pair, if it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, obtaining the real offline resource exchange rate of the target resource pair at the current moment, where the current moment refers to the moment when the query request is received;
[0009] Based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, the real online resource exchange rate of the target resource pair at the current moment is simulated and calculated to obtain a simulated online resource exchange rate, and the simulated online resource exchange rate is output.
[0010] On the other hand, an embodiment of the present application provides a resource exchange rate processing device based on a time window, the device comprising:
[0011] The sampling unit is used to sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange time window, where N is a positive integer; any group of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time;
[0012] A processing unit, used to respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates, and obtain N rate differences;
[0013] The processing unit is further configured to, when receiving a query request for the online resource exchange rate of the target resource pair, obtain the real offline resource exchange rate of the target resource pair at the current moment if it is determined that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, wherein the current moment refers to the moment when the query request is received;
[0014] The processing unit is further used to simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, obtain a simulated online resource exchange rate, and output the simulated online resource exchange rate.
[0015] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising an input interface and an output interface, the computer device further comprising:
[0016] processor and computer storage media;
[0017] The processor is suitable for implementing one or more instructions, the computer storage medium stores one or more instructions, and the one or more instructions are suitable for the processor to load and execute the above-mentioned time window-based resource exchange rate processing method.
[0018] On the other hand, an embodiment of the present application provides a computer storage medium, which stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the above-mentioned time window-based resource exchange rate processing method.
[0019] On the other hand, an embodiment of the present application provides a computer program product, which includes one or more instructions; when one or more instructions in the computer program product are executed by a processor, the above-mentioned time window-based resource exchange rate processing method is implemented.
[0020] The embodiment of the present application can sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange window, and respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences, so that when the third-party agency receives a query request for the online resource exchange rate of the target resource pair and determines that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, the third-party agency can simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain a simulated online resource exchange rate, thereby outputting the simulated online resource exchange rate to achieve a response to the query request, thereby improving the response success rate of the query request, and thus improving the service performance of the third-party agency. Furthermore, by simulating and calculating based on the real offline resource exchange rate at the current moment and N rate differences of the target resource, not only can the simulated online resource exchange rate calculated by simulation be anchored to the real offline resource exchange rate at the current moment, thereby making the simulated online resource exchange rate reflect the real exchange rate fluctuation and improving the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party agency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 It is a schematic diagram of the principle of a resource exchange rate processing method based on a time window provided in an embodiment of the present application;
[0023] Figure 2 It is a flowchart of a method for processing resource exchange rates based on a time window provided in an embodiment of the present application;
[0024] Figure 3 is a flow chart of a method for processing resource exchange rates based on a time window provided by another embodiment of the present application;
[0025] Figure 4a It is a framework diagram of a resource exchange processing framework provided in an embodiment of the present application;
[0026] Figure 4b It is a schematic diagram of a flow chart of calculating a storage rate difference by a simulated exchange rate calculation service provided in an embodiment of the present application;
[0027] Figure 4c It is a schematic diagram of interaction between an original exchange rate query service and a simulated exchange rate calculation service provided in an embodiment of the present application;
[0028] Figure 4d This is a schematic diagram of a workflow of a simulated exchange rate calculation service provided in an embodiment of the present application;
[0029] Figure 4e It is a schematic diagram of a simulated exchange rate calculation service for inquiring a simulated online resource exchange rate provided by an embodiment of the present application;
[0030] Figure 4f This is a schematic diagram of the workflow of an original exchange rate query service provided by an embodiment of the present application;
[0031] Figure 5 It is a structural diagram of a resource exchange rate processing device based on a time window provided in an embodiment of the present application;
[0032] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0034] The present application embodiment proposes a resource exchange rate processing method based on a time window. The general principle of this method can be found in Figure 1 As shown: the third-party institution can access two types of exchange rate publishing sources (i.e., the publishing sources of online resource exchange rates and offline resource exchange rates), and in the process of opening the online resource exchange time window, obtain the real online resource exchange rate and the real offline resource exchange rate of the target resource pair published by the two types of exchange rate publishing sources at the same time N times, and calculate the difference between the real online resource exchange rate and the real offline resource exchange rate obtained each time, and obtain N rate differences, where N is a positive integer. After the object initiates an inquiry request for inquiring about the online resource exchange rate of the target resource pair to the third-party institution, the third-party institution can receive the inquiry request. If the real online resource exchange rate of the target resource pair cannot be obtained at present, the N rate differences and the current real discrete resource exchange rate of the target resource pair can be used to simulate and calculate the current real online resource exchange rate of the target resource pair, so as to output the online resource exchange rate obtained by the simulated calculation to the object in response to the inquiry request initiated by the object.
[0035] It can be seen that the resource exchange rate processing method based on the time window proposed in the embodiment of the present application can support the third-party agency to provide the object with the online resource exchange rate in response to the object's inquiry request for the online resource exchange rate during the non-open time period of the online resource exchange time window, thereby improving the response success rate of the inquiry request and improving the service performance of the third-party agency. It is worth emphasizing that: in the embodiment of the present application, when the object is a user, it involves user information and other related data (such as the inquiry request initiated by the object, etc.). When any method embodiment proposed in the embodiment of the present application is applied to a specific product or technology, these related data are collected with the user's permission or consent, and the collection, use and processing of the related data comply with the relevant laws, regulations and standards of the relevant region.
[0036] It is understandable that: in actual application, the third-party organization mentioned above may be configured with a computer device, so that each operation performed by the third-party organization mentioned in the above description can be specifically performed by the computer device, and the computer device mentioned here may be a terminal or a server. Alternatively, the third-party organization mentioned above may be configured with a terminal and a server, so that each operation performed by the third-party organization mentioned in the above description can be performed jointly by the terminal and the server. Among them, the terminal mentioned here may be a smart phone, a computer (such as a tablet computer, a laptop computer, a desktop computer, etc.), a smart wearable device (such as a smart watch, smart glasses), an intelligent voice interaction device, a smart home appliance (such as a smart TV), a vehicle terminal or an aircraft, etc.; the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides 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 basic cloud computing services such as big data and artificial intelligence platforms, etc.
[0037] Based on the above description, the following takes the computer equipment configured by the third-party organization as the execution subject, and combines Figure 2 The method flow chart shown in the figure describes the specific implementation process of the resource exchange rate processing method based on the time window proposed in the embodiment of the present application. Figure 2 As shown, the method may generally include the following steps S201-S205:
[0038] S201, in the process of opening an online resource exchange time window, sampling N groups of resource exchange rates of target resource pairs.
[0039] Wherein, N is a positive integer; any set of resource exchange rates may include: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time. The so-called real online resource exchange rate refers to: the resource exchange rate published by the source that publishes the online resource exchange rate; the so-called real offline resource exchange rate refers to: the resource exchange rate published by the source that publishes the offline resource exchange rate. Further, the resource exchange rate can be understood as the ratio of one resource in a resource pair to another resource; for example, a resource pair includes resource a and resource b, and one resource a can be exchanged for 3 resources b, then it can be determined that the ratio of resource a to resource b in the resource pair is 1:3, and thus the resource exchange rate of the resource pair can be determined to be 1:3.
[0040] In the embodiment of the present application, the target resource pair can be any resource pair, which can include a first resource and a second resource. In a specific implementation, the first resource and the second resource can be two different electronic resources, such as the first resource can be an electronic resource issued in a first geographical area, and the second resource can be an electronic resource issued in a second geographical area. In this case, the application scenario of the embodiment of the present application can be, for example, an electronic resource exchange scenario, or a cross-border purchase of goods scenario, etc.; and in the cross-border purchase of goods scenario, the third-party institution can be, for example, a third-party payment institution. The so-called third-party payment institution refers to an independent institution with certain strength and credibility guarantee, which adopts a contract with major banks to provide a network payment mode of a transaction payment platform interfaced with a bank payment and settlement system. In another specific implementation, the first resource and the second resource can be two different virtual resources, such as the first resource and the second resource can be two different game resources issued on the same game platform, or two game resources issued on different game platforms; in this case, the application scenario of the embodiment of the present application can be, for example, a game resource exchange scenario on the same game platform, or a game resource exchange scenario across game platforms, etc. In another specific implementation, the first resource may be an electronic resource, and the second resource may be a virtual resource (such as a game resource); in this case, the application scenario of the embodiment of the present application may be, for example, a virtual resource purchase scenario, or a virtual resource sales scenario, and so on.
[0041] In a specific implementation, the specific implementation of step S201 may include the following steps s11-s14:
[0042] s11, determining the open time period of the online resource exchange time window, and selecting a time period from the open time period of the online resource exchange time window as the exchange rate sampling time period.
[0043] The open time period of the online resource exchange time window refers to the time period of the online resource exchange rate time window. The start time of the open time period is the opening time of the online resource exchange time window (i.e., the opening time), and the end time of the open time period is the closing time of the online resource exchange time window (i.e., the closing time). For example, if the online resource exchange time window is 9:30-16:30 on weekdays, it means that the online resource exchange time window is open during the time period of 9:30-16:30 on weekdays, and the open time period is 9:30-16:30 on the current weekday.
[0044] Specifically, when the computer device selects a time period from the open time period of the online resource exchange time window as the exchange rate sampling time period, the open time period of the online resource exchange time window can be directly selected as the exchange rate sampling time period; in this way, when the online resource exchange time window is opened, an exchange rate sampling operation is performed on the target resource pair, and the exchange rate sampling process covers the entire open time period of the online resource exchange time window, so that more and more comprehensive resource exchange rates can be sampled, thereby improving the accuracy of the sampling results.
[0045] Alternatively, considering that the opening and closing of the online resource exchange time window may cause large fluctuations in the resource exchange rate, based on this, when the computer device selects a time period from the open time period of the online resource exchange time window as the exchange rate sampling time period, the start time and end time of the open time period of the online resource exchange time window can be determined, and the first time offset and the second time offset can be obtained. The first time offset and the second time offset can be set based on experience or business needs, and the first time offset and the second time offset can be the same or different, and there is no limitation on this. Further, the computer device can control the start time of the open time period based on the first time offset, and offset it in the direction close to the end time to obtain the offset start time; specifically, the first time offset can be superimposed on the start time of the open time period to obtain the offset start time, such as the first time offset is 30 minutes, the start time of the open time period is 9:30, and the offset start time is 10:00. Similarly, the computer device can control the end time of the open time period based on the second time offset, and offset it in the direction close to the start time to obtain the offset end time; specifically, the second time offset can be subtracted from the end time of the open time period to obtain the offset end time, such as the second time offset is 30 minutes, the end time of the open time period is 16:30, and the end time of the offset is 16:00. Further, the computer device can select a time period between the offset start time and the offset end time (e.g., 10:00-16:00) from the open time period of the online resource exchange time window as the exchange rate sampling time period.
[0046] It can be seen that in this way, the sampling process of the resource exchange rate can skip the opening and ending time of the online resource exchange time window, thereby avoiding the fluctuation of the resource exchange rate caused by the opening and closing of the window, thereby improving the accuracy of resource exchange rate collection. It should be noted that in an optional implementation, the computer device can also only offset the starting time of the open time period, so as to select the time period between the offset starting time and the end time (for example, 10:00-16:30) as the exchange rate sampling time period, so that the sampling process of the resource exchange rate skips the opening time of the online resource exchange time window; or, the computer device can also only offset the end time of the open time period, so as to select the time period between the starting time and the offset end time (for example, 9:30-16:00) as the exchange rate sampling time period, so that the sampling process of the resource exchange rate skips the end time of the online resource exchange time window.
[0047] Alternatively, considering that the online resource exchange rate is usually calculated after the online resource exchange time window is closed, in order to make the online resource exchange rate calculated by subsequent simulation more consistent with the online resource exchange rate when the online resource exchange time window is about to close, when the computer device selects a time period from the open time period of the online resource exchange time window as the exchange rate sampling time period, the open time period of the online resource exchange time window can be divided into a first time period and a second time period, and the end time point of the first time period is the same as the start time point of the second time period, that is, the first time period is continuous with the second time period and the first time period is before the second time period, and the second time period is closer to the end time of the online resource exchange time window; thus, the second time period is used as the exchange rate sampling time period. In this way, the sampling process of the resource exchange rate can be carried out near the end time of the online resource exchange time window, so that the sampling result can better reflect the change trend of the resource exchange rate when the online resource exchange rate time window is about to end, and then the online resource exchange rate calculated by subsequent simulation based on the sampling result is more consistent with the real change trend, thereby improving the accuracy of the simulation calculation.
[0048] s12, in the process of opening the online resource exchange window, during the exchange rate sampling time period, the exchange rate sampling operation is performed on the target resource pair according to the preset sampling frequency.
[0049] Among them, the preset sampling frequency can be set based on experience or business needs, for example, the preset sampling frequency can be sampled once every hour, or once every 2 hours, and so on. Optionally, after obtaining the preset sampling frequency, if it is found that the preset sampling frequency is less than the frequency threshold, it can be said that the preset sampling frequency is small (that is, the preset sampling frequency is slow). In this case, the preset sampling frequency can be increased (that is, the preset sampling frequency is accelerated), and then step s12 is executed. In this way, it is possible to sample more groups of resource exchange rates based on the increased preset sampling frequency, thereby calculating more rate differences, thereby reducing the impact of the average rate difference obtained by performing the mean operation on each rate difference on the abnormal resource sampling rate at some time points, and improving the stability and reliability of the average rate difference.
[0050] The exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair. Specifically, the real online resource exchange rate of the target resource pair can be sampled from the publishing source of the online resource exchange rate, and the real online resource exchange rate of the target resource pair can be sampled from the publishing source of the offline resource exchange rate.
[0051] s13, each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation may be combined to obtain a set of resource exchange rates.
[0052] s14, after the exchange rate sampling period ends, obtain N groups of resource exchange rates of the target resource pairs.
[0053] It can be understood that in the specific implementation shown in steps s11-s14, the value of N can be equal to the number of exchange rate sampling operations performed within the exchange rate sampling time period; for example, if 4 exchange rate sampling operations are performed within the exchange rate sampling time period, the value of N is 4, and 4 sets of resource exchange rates can be sampled.
[0054] In another specific implementation, the specific implementation of step S201 may include the following steps s21-s26:
[0055] s21, in the process of opening the online resource exchange time window, sampling the real online resource exchange rate of the target resource pair in real time, and obtaining the volatility of the currently sampled real online resource exchange rate as the first volatility.
[0056] The volatility of the real online resource exchange rate currently sampled refers to: the rate of change between the real online resource exchange rate currently sampled and the real online resource exchange rate sampled last time; it can be equal to: the difference between the real online resource exchange rate currently sampled and the real online resource exchange rate sampled last time, and the ratio of the real online resource exchange rate sampled last time. For example, the real online resource exchange rate sampled last time is 1:5 (i.e. 0.2), and the real online resource exchange rate sampled currently is 1:4 (i.e. 0.25), then the volatility of the real online resource exchange rate currently sampled can be equal to (0.25-0.2) / 0.2×100%=25%.
[0057] s22: If the first volatility is less than the first threshold, the sampling time corresponding to the currently sampled real online resource exchange rate is used as the starting sampling point.
[0058] Specifically, if the first volatility is less than the first threshold, it indicates that the real online resource exchange rate at this time has a small fluctuation, and it is highly likely that it has not been fluctuated by the opening of the online resource exchange time window, so the sampling time corresponding to the currently sampled real online resource exchange rate can be used as the starting sampling point. If the first volatility is greater than or equal to the first threshold, it indicates that the real online resource exchange rate at this time has a large fluctuation, and it is highly likely that it has been fluctuated by the opening of the online resource exchange time window, so it can jump to step s21 at this time to continue to sample the real online resource exchange rate of the target resource pair in real time.
[0059] s23, starting from the starting sampling point, performing an exchange rate sampling operation on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair.
[0060] s24, each time the exchange rate sampling operation is executed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates.
[0061] s25, obtaining the volatility of the real online resource exchange rate sampled by the currently executed exchange rate sampling operation as the second volatility.
[0062] s26, if the second volatility is greater than the second threshold, stop performing the exchange rate sampling operation on the target resource pair to obtain N groups of resource exchange rates for the target resource pair.
[0063] Specifically, if the second volatility is greater than the second threshold, it indicates that the real online resource exchange rate at this time fluctuates greatly, and it is highly likely that the fluctuation is caused by the closing of the online resource exchange time window, so the exchange rate sampling operation can be stopped for the target resource pair at this time to obtain N sets of resource exchange rates for the target resource pair. If the second volatility is less than the second threshold, it indicates that the real online resource exchange rate at this time fluctuates less, and it is highly likely that the fluctuation is not caused by the opening of the online resource exchange time window, so the exchange rate sampling operation can continue to be performed on the target resource pair at the preset sampling frequency.
[0064] It can be seen that through steps s21-s26, the sampling process of the resource exchange rate can skip the opening and ending times of the online resource exchange time window, thereby avoiding the impact of resource exchange rate fluctuations caused by the opening and closing of the window, thereby improving the accuracy of resource exchange rate collection.
[0065] In another specific implementation, the specific implementation of step S201 may include the following steps s31-s32:
[0066] s31. In the process of opening the online resource exchange window, the exchange rate sampling operation is performed on the target resource pair in real time to obtain multiple sets of resource exchange rates; the exchange rate sampling operation refers to: the operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair.
[0067] s32, select N groups of resource exchange rates from multiple groups of resource exchange rates. Specifically, N groups of resource exchange rates can be randomly selected from multiple groups of resource exchange rates to improve the randomness of the N groups of resource exchange rates. Alternatively, the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates can be determined respectively, and N groups of resource exchange rates with different differences can be selected to improve the diversity of the N groups of resource exchange rates, so that the N groups of resource exchange rates can cover most of the resource exchange rate difference situations.
[0068] S202, respectively calculating the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences.
[0069] In a specific implementation, the computer device may first execute step S201, and then execute step S202; that is, in this case, the computer device may sample and obtain N groups of resource exchange rates, and then respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences. Alternatively, the computer device may synchronously execute step S202 during the process of executing step S201; that is, in this case, the computer device may sample and obtain a group of resource exchange rates, and then calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in the current sampled group of resource exchange rates, so that after sampling and obtaining the Nth group of resource exchange rates and calculating the difference between the real online resource exchange rate and the real offline resource exchange rate in the Nth group of resource exchange rates, N rate differences are obtained.
[0070] S203, when receiving a query request for the online resource exchange rate of the target resource pair, if it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, then obtaining the real offline resource exchange rate of the target resource pair at the current moment.
[0071] In a specific implementation, when receiving an inquiry request for the online resource exchange rate of the target resource pair, the computer device can determine the current time and the open time period of the online resource exchange time window; wherein the current time refers to the time when the inquiry request is received. Further, it can be determined whether the current time is within the open time period of the online resource exchange time window; if the current time is not within the open time period of the online resource exchange time window, it can be determined that the real online resource exchange rate of the target resource pair is not obtained (i.e., cannot be obtained) at the current time. It can be seen that in this way, it is not necessary to call the exchange rate query service to query the publishing source of the online resource exchange rate, and it can be determined whether the real online resource exchange rate of the target resource pair can be obtained at the current time, which can improve the judgment efficiency and save the processing resources consumed by calling the exchange rate query.
[0072] If the current moment is within the open time period of the online resource exchange time window, it can be determined that the real online resource exchange rate of the target resource pair can be obtained at the current moment. Alternatively, if the current moment is within the open time period of the online resource exchange time window, the exchange rate query service is called to query the real online resource exchange rate of the target resource pair at the current moment; if the query fails, it is determined that the real online resource exchange rate of the target resource pair is not obtained (i.e., cannot be obtained) at the current moment. It can be seen that this method can make it possible to determine whether the real online resource exchange rate of the target resource pair can be obtained at the current moment when the current moment is within the open time period of the online resource exchange time window, thereby improving the accuracy of the judgment result.
[0073] Furthermore, if it is determined through the above method that the real online resource exchange rate of the target resource pair is not obtained at the current moment, the computer device can obtain the real offline resource exchange rate of the target resource pair at the current moment. Specifically, the computer device can call the exchange rate query service and query the real offline resource exchange rate of the target resource pair at the publishing source of the offline resource exchange rate at the current moment.
[0074] S204, based on the actual offline resource exchange rate of the target resource pair at the current moment and N rate differences, simulate and calculate the actual online resource exchange rate of the target resource pair at the current moment to obtain a simulated online resource exchange rate.
[0075] In a specific implementation, a computer device can predict the exchange rate offset between the actual offline resource exchange rate and the actual online resource exchange rate of the target resource pair at the current moment based on N rate differences, and then use the exchange rate offset to offset the actual offline resource exchange rate of the target resource pair at the current moment to obtain a simulated online resource exchange rate.
[0076] In another specific implementation, a computer device can use a resource exchange rate prediction model based on artificial intelligence technology to predict the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and N rate differences, and use the predicted online resource exchange rate as a simulated online resource exchange rate.
[0077] S205: Output the simulated online resource exchange rate.
[0078] The embodiment of the present application can sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange window, and respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences, so that when the third-party agency receives a query request for the online resource exchange rate of the target resource pair and determines that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, the third-party agency can simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain a simulated online resource exchange rate, thereby outputting the simulated online resource exchange rate to achieve a response to the query request, thereby improving the response success rate of the query request, and thus improving the service performance of the third-party agency. Furthermore, by simulating and calculating based on the real offline resource exchange rate at the current moment and N rate differences of the target resource, not only can the simulated online resource exchange rate calculated by simulation be anchored to the real offline resource exchange rate at the current moment, thereby making the simulated online resource exchange rate reflect the real exchange rate fluctuation and improving the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party agency.
[0079] Based on the above Figure 2 The related description of the method embodiment shown in the figure, the embodiment of the present application proposes a more specific resource exchange rate processing method based on the time window; in the embodiment of the present application, the computer device configured by the third-party organization is still used as the execution subject for explanation. Figure 3 As shown, the method may generally include the following steps S301-S308:
[0080] S301, in the process of opening an online resource exchange time window, sampling N groups of resource exchange rates of target resource pairs.
[0081] Wherein, N is a positive integer; any set of resource exchange rates may include: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time. The specific implementation of step S301 can refer to the relevant description of step S201 in the above embodiment, which will not be repeated here.
[0082] S302, respectively calculating the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences.
[0083] In a specific implementation, when the computer device calculates the difference between the real online resource exchange rate and the real offline resource exchange rate in any set of resource exchange rates, it can be implemented by subtracting the real offline resource exchange rate from the real online resource exchange rate in any set of resource exchange rates. In this case, the rate difference is the value obtained by subtracting the real offline resource exchange rate from the real online resource exchange rate. Alternatively, when calculating the difference between the real online resource exchange rate and the real offline resource exchange rate in any set of resource exchange rates, it can also be implemented by subtracting the real online resource exchange rate from the real offline resource exchange rate in any set of resource exchange rates. In this case, the rate difference is the value obtained by subtracting the real online resource exchange rate from the real offline resource exchange rate.
[0084] S303: When receiving a query request for an online resource exchange rate of a target resource pair, determine the current time and an open time period of the online resource exchange time window.
[0085] S304: If the current time is not within the open time period of the online resource exchange time window, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current time.
[0086] S305: If it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, the real offline resource exchange rate of the target resource pair at the current moment is obtained.
[0087] S306: predicting the exchange rate offset between the actual offline resource exchange rate and the actual online resource exchange rate of the target resource pair at the current moment based on the N rate differences.
[0088] In a specific implementation of step S306, the computer device may perform an average operation on the N rate differences to obtain an average rate difference; and use the average rate difference as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment. In this way, the exchange rate offset can more accurately reflect the distribution difference of all rate differences, thereby improving the accuracy of the exchange rate offset.
[0089] In another specific implementation of step S306, the computer device may arrange the N rate differences in ascending order to obtain a rate difference sequence; and obtain a target quantile; calculate the quantile value of the rate difference sequence based on the target quantile to obtain the target quantile value; and use the target quantile value as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment. In this way, the exchange rate offset can cover most of the rate differences and improve the accuracy of the exchange rate offset. Among them, the target quantile can be expressed as a fraction, and the target quantile value satisfies the following conditions: the ratio between the number of rate differences in the rate difference sequence that is less than or equal to the target quantile value and the sequence length of the rate difference sequence (i.e., N) is the target quantile; if the target quantile is 75%, then the target quantile value can make the value between the number of rate differences in the rate difference sequence that is less than or equal to the target quantile value and N equal to 75%
[0090] Furthermore, the method for obtaining the target percentile may be: obtaining a preset percentile as the target percentile, and the preset percentile may be set based on experience or business needs, such as the 75th percentile (i.e., 75%). Alternatively, the method for obtaining the target percentile may be: obtaining the volatility of the target resource to the actual offline resource exchange rate at the current moment as the target volatility; and determining the target percentile based on the target volatility according to the principle that the volatility is proportional to the percentile. It can be seen that this method can achieve the determination of the target percentile based on the volatility, so that the exchange rate offset calculated based on the target percentile is more in line with the actual fluctuation situation, thereby improving the accuracy of the exchange rate offset.
[0091] In addition, the target quantile value can be obtained by calculating the quantile value of the rate difference sequence based on the target quantile: multiplying the target quantile and the sequence length (i.e., N) of the rate difference sequence to obtain the value k. If the value k is an integer, the kth rate difference in the rate difference sequence can be used as the target quantile value; if the value k is not an integer, the value k can be rounded down (i.e., find the integer closest to the value k and less than the value k) to obtain the value p, and the value k can be rounded up (i.e., find the integer closest to the value k and greater than the value k) to obtain the value q, select the pth rate difference and the qth rate difference from the rate difference sequence, and determine the target quantile value based on the pth rate difference and the qth rate difference, so that the target quantile value is greater than the pth rate difference and less than the qth rate difference. For example, the average value between the pth rate difference and the qth rate difference can be calculated as the target quantile value.
[0092] For example: suppose the sequence length of the rate difference sequence is 10 (i.e., it includes 10 rate differences). If the target percentile is the 80th percentile (i.e., 0.8), the value k=0.8×10=8 can be calculated, so that the 8th rate difference in the rate difference sequence can be used as the target percentile value; if the target percentile is the 75th percentile (i.e., 0.75), the value k=0.75×10=7.5 can be calculated. In this case, the value k can be rounded down to calculate the value p=7, and the value k can be rounded up to calculate the value q=8, and then the target percentile value can be determined based on the 7th rate difference and the 8th rate difference in the rate difference sequence, such as calculating the average value between the 7th rate difference and the 8th rate difference as the target percentile value.
[0093] S307, using the exchange rate offset, offsetting the real offline resource exchange rate of the target resource pair at the current moment to obtain a simulated online resource exchange rate.
[0094] Specifically, if the rate difference is the value obtained by subtracting the real offline resource amount from the real online resource rate, the exchange rate offset can be added to the real offline resource exchange rate of the target resource pair at the current moment to achieve the offset of the corresponding real offline resource exchange rate and obtain the simulated online resource exchange rate. If the rate difference is the value obtained by subtracting the real online resource amount from the real offline resource rate, the exchange rate offset can be used to subtract the real offline resource exchange rate of the target resource pair at the current moment to achieve the offset of the corresponding real offline resource exchange rate and obtain the simulated online resource exchange rate.
[0095] S308, outputting a simulated online resource exchange rate.
[0096] The embodiment of the present application can sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange window, and respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences, so that when the third-party agency receives a query request for the online resource exchange rate of the target resource pair and determines that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, the third-party agency can simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain a simulated online resource exchange rate, thereby outputting the simulated online resource exchange rate to achieve a response to the query request, thereby improving the response success rate of the query request, and thus improving the service performance of the third-party agency. Furthermore, by simulating and calculating based on the real offline resource exchange rate at the current moment and N rate differences of the target resource, not only can the simulated online resource exchange rate calculated by simulation be anchored to the real offline resource exchange rate at the current moment, thereby making the simulated online resource exchange rate reflect the real exchange rate fluctuation and improving the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party agency.
[0097] Based on the description of the above method embodiment, the embodiment of the present application proposes a resource exchange rate processing method based on a time window. This method can obtain multiple rate differences by measuring the difference between multiple groups of real online resource exchange rates and real offline resource exchange rates of target resource pairs in the process of opening an online resource exchange time window. Therefore, in a non-online resource exchange time window (i.e., in a process in which the online resource exchange time window is not opened), multiple rate differences are used with the current real offline resource exchange rate of the target resource pair to simulate and calculate an online resource exchange rate. Therefore, for more scenarios that require online resource exchange rates, feedback on resource exchange rates is performed in the non-online resource exchange time window, helping third-party organizations to extend their business development windows.
[0098] In a specific implementation, the process of the resource exchange rate processing method based on the time window proposed in the embodiment of the present application is roughly as follows:
[0099] Step 1: When the online resource exchange time window is opened (i.e., begins to be opened), the real online resource exchange rate and the real offline resource exchange rate of the target resource pair are collected at the same time according to the preset sampling frequency to obtain multiple groups of resource exchange rates, and the rate difference corresponding to each group of resource exchange rates is calculated respectively;
[0100] Step 2: When the online resource exchange time window is closed (i.e., the opening is ended), the calculated rate differences are summarized, and the average rate difference between the rate differences is calculated;
[0101] Step 3: When an online resource exchange rate is needed within the non-online resource exchange time window, the target resource to the current real offline resource exchange rate can be obtained, and the average rate difference calculated by summarization can be subtracted from the exchange rate to simulate and calculate an online resource exchange rate (i.e., obtain a simulated online resource exchange rate).
[0102] Based on the description of steps 1 to 3 above, it can be seen that when the online resource exchange time window is 9:30-16:30 on weekdays and the preset sampling frequency is once every hour, the implementation process of the resource exchange processing method based on the time window proposed in the embodiment of the present application can be summarized as follows:
[0103] On each working day, when the online resource exchange time window is opened, the real online resource exchange rate and the real offline resource exchange rate of the target resource pair are sampled once every hour. Specifically, since the online resource exchange time window is 9:30-16:30 on working days, the resource exchange rate sampling operation can be performed at 9:30, 10:30, 11:30...16:30 (a total of 8 times), and each resource exchange rate sampling operation queries the real offline resource exchange rate (Price_off) and the real online resource exchange rate (Price_on) of the target resource pair at that time, and a total of 8 groups of resource exchange rates (Price_1_off, Price_1_on, Price_2_off, Price_2_on,..., Price_8_off, Price_8_on) are obtained.
[0104] The difference between the real offline resource exchange rate and the real online resource exchange rate in each set of resource exchange rates is calculated to obtain 8 rate differences (diff_1, diff_2, ..., diff_8); among which, diff_1 = Price_1_off - Price_1_on, diff_2 = Price_2_off - Price_2_on, and so on. Further, the 8 rate differences are summarized and the average rate difference diff_average = (diff_1 + diff_2 + ... + diff_8) / 8 is obtained.
[0105] In the non-online resource exchange time window, the third-party agency can simulate and calculate an online resource exchange rate (expressed by Price_on') at any time (expressed by time t), and specifically obtain the real offline resource exchange rate of the target resource pair at time t (expressed by Price_t_off), and use the real offline resource exchange rate to subtract the average rate difference to obtain the simulated online resource exchange rate (i.e., simulated online resource exchange rate), i.e., Price_on' = Price_t_off-diff_average. Based on this, when the object needs to use the online resource exchange rate for resource exchange in the non-online resource exchange time window, the third-party agency can report the simulated online resource exchange rate to the object, so that the online resource exchange rate can be used for resource exchange throughout the working day.
[0106] Based on the above description, it can be known that the time window-based resource exchange processing method proposed in the embodiment of the present application can help third-party institutions expand the online resource exchange time window from the original 9:30-16:30 on weekdays to 00:00-24:00 on weekdays, so that the objects can freely and conveniently use the online resource exchange rate to exchange resources throughout the day, thereby improving the convenience of the objects. Moreover, through the method of simulating and calculating the online resource exchange rate proposed in the embodiment of the present application, not only can the simulated online resource exchange rate calculated by simulation be anchored to the current real offline resource exchange rate, so that the simulated online resource exchange rate can reflect the real exchange rate fluctuations and improve the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party institution. Furthermore, in order to realize the above-mentioned time window-based resource exchange processing method, the embodiment of the present application also proposes a resource exchange processing framework. See. Figure 4a As shown, the framework may at least include: the original exchange rate query service, and the newly added simulated exchange rate calculation service.
[0107] ① The original exchange rate query service can be used to report the resource exchange rate for the object, and it can access the publishing source of the online resource exchange rate and the publishing source of the offline resource exchange rate; when the object inquires about the resource exchange rate of the target resource pair, if it is in the online resource exchange time window (such as 9:30-16:30 on weekdays), the original exchange rate query service can support the object to inquire about the real online resource exchange rate and the real offline resource exchange rate; if it is in the offline resource exchange time window (such as 00:00-24:00 on weekdays), the original exchange rate query service can support the object to inquire about the real offline resource exchange rate.
[0108] ② The simulated exchange rate calculation service can be used to obtain multiple sets of resource exchange rates for target resource pairs from the original exchange rate query service at a preset sampling frequency during the opening of the online resource exchange time window. Each set of resource exchange rates includes the real online resource exchange rate and the real offline resource exchange rate collected at the same time, and the storage rate difference is calculated based on multiple sets of resource exchange rates. For details, see Figure 4b As shown, the process of calculating the storage rate difference by the simulated exchange rate calculation service can be as follows: based on the preset sampling frequency, detect whether the sampling time has been reached; if not, end the process; if yes, inquire the current real offline resource exchange rate (Price_off) and the current real online resource exchange rate (Price_on) at the original exchange rate query service, and calculate the difference between the current offline resource exchange rate (Price_off) and the current online resource exchange rate (Price_on) as the current rate difference (diff), diff = Price_off-Price_on; store the current rate difference (diff) and the corresponding time for subsequent use. Further, the simulated exchange rate calculation service can also simulate and calculate the online resource exchange rate based on the real offline resource exchange rate at the corresponding time and the stored rate difference at any time, and return the simulated calculated online resource exchange rate to the original exchange rate query service, so that the original exchange rate query service can feed back the simulated calculated online resource exchange rate to the object.
[0109] Furthermore, the simulated exchange rate calculation service can also be used to simulate and calculate the online resource exchange rate of the target resource pair. Figure 4c As shown in the figure: When the original exchange rate query service inquires about the simulated online resource exchange rate from the simulated exchange rate calculation service, the simulated calculation of the latest online resource exchange rate can be triggered. Since the calculation of the online resource exchange rate requires the latest real offline resource exchange rate (Price_off_current), the original exchange rate query service can carry the latest real offline resource exchange rate (Price_off_current) as an input parameter in the corresponding query request when inquiring. Accordingly, when the simulated exchange rate calculation service receives the query request, it can execute Figure 4dThe process shown is as follows: all the stored rate differences for the day (such as the aforementioned diff_1, diff_2, ..., diff_8) are obtained, and the average operation is performed on each of the obtained rate differences to obtain an average rate difference (such as the aforementioned diff_average = (diff_1 + diff_2 + ... + diff_8) / 8; further, the simulation exchange rate calculation service calculates the simulated online resource exchange rate (Price_on_simulation) based on the current latest real offline resource exchange rate (Price_off_current) and the average rate difference. Specifically, the current latest real offline resource exchange rate minus the average rate difference can be used to obtain the simulated online resource exchange rate, and the simulated online resource exchange rate (Price_on_simulation) is returned to the original exchange rate query service; wherein, Price_on_simulation = Price_off_current - diff_average.
[0110] Based on the above descriptions of the original exchange rate query service and the simulated exchange rate calculation service, it can be seen that the original exchange rate query service still acts as a resource exchange rate reporting module for a third-party agency when the object inquires about the resource exchange rate. It’s just that the original working intelligence is set as follows: if it is in the online resource exchange time window (such as 9:30-16:30 on weekdays), the object can inquire about both the online resource exchange rate and the offline resource exchange rate; and in time periods other than the online resource exchange time window (such as 00:00-9:30 and 16:30-24:00 on weekdays), the object can only inquire about the offline resource exchange rate. However, by inquiring the simulated online resource exchange rate (such as Figure 4e As shown in the figure, the function of the original exchange rate query service can be expanded as follows: if it is the online resource exchange time window (such as 9:30-16:30 on weekdays), it will not change (that is, the object can inquire about both the online resource exchange rate and the offline resource exchange rate); and in the time period other than the online resource exchange time window (such as the two time periods of 00:00-9:30 and 16:30-24:00 on weekdays), it will change. Previously, the object could only inquire about the offline resource exchange rate, but now it can inquire about both the offline resource exchange rate and the online resource exchange rate, so that the object can inquire about the online resource exchange rate at any time (such as 00:00-24:00 all day on weekdays), but the online resource exchange rate inquired in some time periods is not real, but obtained by simulation calculation.
[0111] Based on the above description, the workflow of the original exchange rate query service can be found in Figure 4f As shown:
[0112] The first step is to determine whether the object inquires about the offline resource exchange rate; if so, go to the second step; if not, go to the third step;
[0113] Step 2: Report the latest real offline resource exchange rate to the target (i.e., the real offline resource exchange rate at the current time, where the current time is the time when the target inquires), and go to step 7;
[0114] The third step is to determine whether the current time is within the online resource exchange time window (essentially, to determine whether the current time is within the open time period of the online resource exchange time window), such as determining whether the current time is within 9:30-16:30 on a working day; if so, go to step 4, if not, go to step 5;
[0115] Step 4: Report the latest online resource exchange rate to the target (i.e. the real online resource exchange rate at the current time), and go to step 7;
[0116] Step 5: Inquire the simulated exchange rate calculation service about the current simulated online resource exchange rate (i.e., the online resource exchange rate calculated by the latest simulation);
[0117] Step 6: Return the simulated online resource exchange rate to the object;
[0118] Step 7. End.
[0119] It should be noted that the above is only an illustrative description of the specific implementation of the relevant methods and frameworks proposed in the embodiments of the present application, and does not limit this.
[0120] For example, for the sampling process of resource exchange rates, the preset sampling frequency can be accelerated to sample more groups of resource exchange rates, thereby calculating more rate differences. This can reduce the impact of abnormal resource sampling rates at some time points on the average rate difference obtained by averaging the rate differences, thereby improving the stability and reliability of the average rate difference; or, the sampling process can be controlled to skip the opening and ending times of the online resource exchange time window, thereby avoiding the impact of fluctuations in the resource exchange rate caused by the opening and closing of the window, thereby improving the accuracy of resource exchange rate collection.
[0121] For another example, in the process of simulating the calculation of the online resource exchange rate, the average rate difference may be used instead of the 75th percentile value of multiple rate differences to cover the fluctuation range of the rate difference on that day; or, the rate difference in the afternoon of that day may be used for statistical calculation.
[0122] For another example, for the original exchange rate query service, when inquiring about the latest simulated online resource exchange rate, in addition to passing in the latest real offline resource exchange rate, it can also pass in the volatility of the latest real offline resource exchange rate, thereby helping the simulated exchange rate calculation service to select different percentiles to simulate and calculate the online resource exchange rate; and, even during the open time period of the online resource exchange time window, if the real online resource exchange rate cannot be obtained at present, the simulated online resource exchange rate can also be used to respond to the request, so as to improve the request response success rate, thereby improving the service performance of the third-party agency.
[0123] In summary, the embodiment of the present application can support a third-party organization to collect the real online resource exchange rate and the real offline resource exchange rate at the same time during the process of opening the online resource exchange time window, and calculate the rate difference between the real online resource exchange rate and the real offline resource exchange rate at the same time for storage, so that when the real online resource exchange rate cannot be obtained in the non-online resource exchange time window, the third-party organization can simulate and calculate the online resource exchange rate based on the latest real offline resource exchange rate, and then use the mean value (i.e., the average rate difference) between the stored rate differences as an offset, and use this as a simulated online resource exchange rate to meet the objects and business scenarios that need online resource exchange rates. In this way, the third-party organization can extend the opening time period of the online resource exchange time window that can provide online resource exchange rates from the original working day 9:30-16:30 to 24 hours a day, greatly expanding the third-party organization's own online resource exchange time window, thereby meeting the demands of more objects.
[0124] Based on the description of the above method embodiment, the embodiment of the present application also discloses a resource exchange rate processing device based on a time window; the resource exchange rate processing device based on a time window can be a computer program (including one or more instructions) running in a computer device, and the resource exchange rate processing device based on a time window can execute each step in the above method flow. Figure 5 , the resource exchange rate processing device based on the time window can run the following units:
[0125] The sampling unit 501 is used to sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange time window, where N is a positive integer; any group of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time;
[0126] The processing unit 502 is used to calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates, and obtain N rate differences;
[0127] The processing unit 502 is further configured to, when receiving a query request for the online resource exchange rate of the target resource pair, obtain the real offline resource exchange rate of the target resource pair at the current moment if it is determined that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, where the current moment refers to the moment when the query request is received;
[0128] The processing unit 502 is further used to simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, obtain a simulated online resource exchange rate, and output the simulated online resource exchange rate.
[0129] In one implementation, when the processing unit 502 is used to simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain the simulated online resource exchange rate, it can be specifically used to:
[0130] Based on the N rate differences, predicting an exchange rate offset of the target resource pair between a real offline resource exchange rate and a real online resource exchange rate at the current moment;
[0131] The exchange rate offset is used to perform an offset process on the real offline resource exchange rate of the target resource at the current moment to obtain a simulated online resource exchange rate.
[0132] In another embodiment, when the processing unit 502 is used to predict the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment based on the N rate differences, it can be specifically used to:
[0133] Performing a mean operation on the N rate differences to obtain an average rate difference;
[0134] The average rate difference is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
[0135] In another embodiment, when the processing unit 502 is used to predict the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment based on the N rate differences, it can be specifically used to:
[0136] Arrange the N rate differences in ascending order to obtain a rate difference sequence; and obtain a target quantile;
[0137] Calculate the quantile value of the rate difference sequence based on the target quantile to obtain the target quantile value;
[0138] The target percentile value is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
[0139] In another implementation, when the processing unit 502 is used to obtain the target percentile, it can be specifically used to:
[0140] Obtaining a volatility of the target resource to the actual offline resource exchange rate at the current moment as a target volatility;
[0141] According to the principle that volatility is proportional to percentile, the target percentile is determined based on the target volatility.
[0142] In another implementation, when the sampling unit 501 is used to sample N groups of resource exchange rates of target resource pairs during the process of opening the online resource exchange time window, it can be specifically used to:
[0143] Determine an open time period of the online resource exchange time window, and select a time period from the open time period of the online resource exchange time window as an exchange rate sampling time period;
[0144] In the process of opening the online resource exchange window, within the exchange rate sampling time period, an exchange rate sampling operation is performed on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair;
[0145] Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates;
[0146] After the exchange rate sampling time period ends, N groups of resource exchange rates of the target resource pairs are obtained.
[0147] In another implementation manner, when the sampling unit 501 selects a time period as the exchange rate sampling time period from the open time period of the online resource exchange time window, it can be specifically used to:
[0148] An open time period of the online resource exchange time window is selected as an exchange rate sampling time period.
[0149] In another implementation manner, when the sampling unit 501 selects a time period as the exchange rate sampling time period from the open time period of the online resource exchange time window, it can be specifically used to:
[0150] Determine the start time and the end time of the open time period of the online resource exchange time window, and obtain a first time offset and a second time offset;
[0151] Based on the first time offset, controlling the start time of the open time period to shift it toward the end time, so as to obtain the shifted start time;
[0152] Based on the second time offset, controlling the end time of the open time period to shift in a direction close to the start time, so as to obtain the end time after the shift;
[0153] From the open time period of the online resource exchange time window, a time period between the start time after the shift and the end time after the shift is selected as the exchange rate sampling time period.
[0154] In another implementation manner, when the sampling unit 501 selects a time period as the exchange rate sampling time period from the open time period of the online resource exchange time window, it can be specifically used to:
[0155] Dividing the open time period of the online resource exchange time window into a first time period and a second time period, wherein the end time point of the first time period is the same as the start time point of the second time period;
[0156] The second time period is used as the exchange rate sampling time period.
[0157] In another implementation, when the sampling unit 501 is used to sample N groups of resource exchange rates of target resource pairs during the process of opening the online resource exchange time window, it can be specifically used to:
[0158] In the process of opening the online resource exchange time window, the real online resource exchange rate of the target resource pair is sampled in real time, and the volatility of the currently sampled real online resource exchange rate is obtained as the first volatility;
[0159] If the first volatility is less than a first threshold, taking the sampling time corresponding to the currently sampled real online resource exchange rate as the starting sampling point;
[0160] Starting from the starting sampling point, performing an exchange rate sampling operation on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair;
[0161] Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates;
[0162] Acquire the volatility of the real online resource exchange rate sampled by the currently executed exchange rate sampling operation as the second volatility;
[0163] If the second volatility is greater than a second threshold, the exchange rate sampling operation on the target resource pair is stopped to obtain N groups of resource exchange rates for the target resource pair.
[0164] In another implementation, when receiving a query request for the online resource exchange rate of the target resource pair, the sampling unit 501 may also be used to:
[0165] Determine the current time and the open time period of the online resource exchange time window;
[0166] If the current time is not within the open time period of the online resource exchange time window, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current time.
[0167] In another implementation, after determining the current time and the open time period of the online resource exchange time window, the sampling unit 501 may also be used to:
[0168] If the current time is within the open time period of the online resource exchange time window, calling the exchange rate query service to query the real online resource exchange rate of the target resource at the current time;
[0169] If the query fails, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment.
[0170] According to another embodiment of the present application, Figure 5 The various units in the resource exchange rate processing device based on the time window shown can be separately or all combined into one or several other units to constitute, or some of the units (some) can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the resource exchange rate processing device based on the time window can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0171] According to another embodiment of the present application, a computer program (including one or more instructions) capable of executing each step involved in the above-mentioned corresponding method can be constructed by running the computer program (including one or more instructions) on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM) and other processing elements and storage elements. Figure 5 The resource exchange rate processing device based on time window shown in the embodiment of the present application is used to implement the various methods of the embodiment of the present application. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0172] It is worth noting that in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can contain a part of the overall module or unit of the module or unit function.
[0173] The embodiment of the present application can sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange window, and respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences, so that when the third-party agency receives a query request for the online resource exchange rate of the target resource pair and determines that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, the third-party agency can simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain a simulated online resource exchange rate, thereby outputting the simulated online resource exchange rate to achieve a response to the query request, thereby improving the response success rate of the query request, and thus improving the service performance of the third-party agency. Furthermore, by simulating and calculating based on the real offline resource exchange rate at the current moment and N rate differences of the target resource, not only can the simulated online resource exchange rate calculated by simulation be anchored to the real offline resource exchange rate at the current moment, thereby making the simulated online resource exchange rate reflect the real exchange rate fluctuation and improving the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party agency.
[0174] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides a computer device. Figure 6, the computer device at least includes a processor 601, an input interface 602, an output interface 603 and a computer storage medium 604. Among them, the processor 601, the input interface 602, the output interface 603 and the computer storage medium 604 in the computer device can be connected via a bus or other means. The computer storage medium 604 can be stored in the memory of the computer device, the computer storage medium 604 is used to store a computer program, the computer program includes one or more instructions, and the processor 601 is used to execute one or more instructions in the computer program stored in the computer storage medium 604. The processor 601 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to realize the corresponding method flow or corresponding function.
[0175] In one embodiment, the processor 601 described in the embodiment of the present application can be used to perform a series of resource exchange rate processing based on a time window, specifically including: in the process of opening an online resource exchange time window, sampling N groups of resource exchange rates of the target resource pair, N is a positive integer; any group of resource exchange rates includes: a real online resource exchange rate and a real offline resource exchange rate sampled at the same time; respectively calculating the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences; when receiving an inquiry request for the online resource exchange rate of the target resource pair, if it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, then obtaining the real offline resource exchange rate of the target resource pair at the current moment, and the current moment refers to the moment when the inquiry request is received; based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, simulating and calculating the real online resource exchange rate of the target resource pair at the current moment to obtain a simulated online resource exchange rate, and outputting the simulated online resource exchange rate, and the like.
[0176] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a computer device for storing computer programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer storage medium provides a storage space, which stores the operating system of the computer device. In addition, a computer program is also stored in the storage space, which includes one or more instructions suitable for being loaded and executed by the processor 601, and these instructions can be one or more program codes. It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0177] In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by a processor to implement the corresponding steps in the above method embodiment; in a specific implementation, one or more instructions in a computer storage medium may be loaded and executed by a processor as follows:
[0178] In the process of opening the online resource exchange time window, N groups of resource exchange rates of the target resource pairs are sampled, where N is a positive integer; any group of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time;
[0179] Calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each set of resource exchange rates to obtain N rate differences;
[0180] When receiving a query request for the online resource exchange rate of the target resource pair, if it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, obtaining the real offline resource exchange rate of the target resource pair at the current moment, where the current moment refers to the moment when the query request is received;
[0181] Based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, the real online resource exchange rate of the target resource pair at the current moment is simulated and calculated to obtain a simulated online resource exchange rate, and the simulated online resource exchange rate is output.
[0182] In one implementation, when simulating and calculating the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain the simulated online resource exchange rate, the one or more instructions may be loaded and specifically executed by the processor:
[0183] Based on the N rate differences, predicting an exchange rate offset of the target resource pair between a real offline resource exchange rate and a real online resource exchange rate at the current moment;
[0184] The exchange rate offset is used to perform an offset process on the real offline resource exchange rate of the target resource at the current moment to obtain a simulated online resource exchange rate.
[0185] In another embodiment, when predicting the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment based on the N rate differences, the one or more instructions may be loaded and specifically executed by the processor:
[0186] Performing a mean operation on the N rate differences to obtain an average rate difference;
[0187] The average rate difference is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
[0188] In another embodiment, when predicting the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment based on the N rate differences, the one or more instructions may be loaded and specifically executed by the processor:
[0189] Arrange the N rate differences in ascending order to obtain a rate difference sequence; and obtain a target quantile;
[0190] Calculate the quantile value of the rate difference sequence based on the target quantile to obtain the target quantile value;
[0191] The target percentile value is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
[0192] In another implementation, when obtaining the target percentile, the one or more instructions may be loaded and specifically executed by the processor:
[0193] Obtaining a volatility of the target resource to the actual offline resource exchange rate at the current moment as a target volatility;
[0194] According to the principle that volatility is proportional to percentile, the target percentile is determined based on the target volatility.
[0195] In another implementation, during the process of opening the online resource exchange time window, when sampling N groups of resource exchange rates of the target resource pair, the one or more instructions may be loaded and specifically executed by the processor:
[0196] Determine an open time period of the online resource exchange time window, and select a time period from the open time period of the online resource exchange time window as an exchange rate sampling time period;
[0197] In the process of opening the online resource exchange window, within the exchange rate sampling time period, an exchange rate sampling operation is performed on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair;
[0198] Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates;
[0199] After the exchange rate sampling time period ends, N groups of resource exchange rates of the target resource pairs are obtained.
[0200] In another implementation, when a time period is selected from the open time period of the online resource exchange time window as the exchange rate sampling time period, the one or more instructions may be loaded and specifically executed by the processor:
[0201] An open time period of the online resource exchange time window is selected as an exchange rate sampling time period.
[0202] In another implementation, when a time period is selected from the open time period of the online resource exchange time window as the exchange rate sampling time period, the one or more instructions may be loaded and specifically executed by the processor:
[0203] Determine the start time and the end time of the open time period of the online resource exchange time window, and obtain a first time offset and a second time offset;
[0204] Based on the first time offset, controlling the start time of the open time period to shift it toward the end time, so as to obtain the shifted start time;
[0205] Based on the second time offset, controlling the end time of the open time period to shift in a direction close to the start time, so as to obtain the end time after the shift;
[0206] From the open time period of the online resource exchange time window, a time period between the start time after the shift and the end time after the shift is selected as the exchange rate sampling time period.
[0207] In another implementation, when a time period is selected from the open time period of the online resource exchange time window as the exchange rate sampling time period, the one or more instructions may be loaded and specifically executed by the processor:
[0208] Dividing the open time period of the online resource exchange time window into a first time period and a second time period, wherein the end time point of the first time period is the same as the start time point of the second time period;
[0209] The second time period is used as the exchange rate sampling time period.
[0210] In another implementation, during the process of opening the online resource exchange time window, when sampling N groups of resource exchange rates of the target resource pair, the one or more instructions may be loaded and specifically executed by the processor:
[0211] In the process of opening the online resource exchange time window, the real online resource exchange rate of the target resource pair is sampled in real time, and the volatility of the currently sampled real online resource exchange rate is obtained as the first volatility;
[0212] If the first volatility is less than a first threshold, taking the sampling time corresponding to the currently sampled real online resource exchange rate as the starting sampling point;
[0213] Starting from the starting sampling point, performing an exchange rate sampling operation on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair;
[0214] Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates;
[0215] Acquire the volatility of the real online resource exchange rate sampled by the currently executed exchange rate sampling operation as the second volatility;
[0216] If the second volatility is greater than a second threshold, the exchange rate sampling operation on the target resource pair is stopped to obtain N groups of resource exchange rates for the target resource pair.
[0217] In another embodiment, when a query request for an online resource exchange rate of the target resource pair is received, the one or more instructions may be loaded and specifically executed by the processor:
[0218] Determine the current time and the open time period of the online resource exchange time window;
[0219] If the current time is not within the open time period of the online resource exchange time window, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current time.
[0220] In another implementation, after determining the current moment and the open time period of the online resource exchange time window, the one or more instructions may be loaded and specifically executed by the processor:
[0221] If the current time is within the open time period of the online resource exchange time window, calling the exchange rate query service to query the real online resource exchange rate of the target resource at the current time;
[0222] If the query fails, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment.
[0223] The embodiment of the present application can sample N groups of resource exchange rates of the target resource pair during the process of opening the online resource exchange window, and respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates to obtain N rate differences, so that when the third-party agency receives a query request for the online resource exchange rate of the target resource pair and determines that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, the third-party agency can simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain a simulated online resource exchange rate, thereby outputting the simulated online resource exchange rate to achieve a response to the query request, thereby improving the response success rate of the query request, and thus improving the service performance of the third-party agency. Furthermore, by simulating and calculating based on the real offline resource exchange rate at the current moment and N rate differences of the target resource, not only can the simulated online resource exchange rate calculated by simulation be anchored to the real offline resource exchange rate at the current moment, thereby making the simulated online resource exchange rate reflect the real exchange rate fluctuation and improving the authenticity of the simulated online resource exchange rate, but also the simulated online resource exchange rate can cover the difference between the real online resource exchange rate and the real offline resource exchange rate, thereby improving the accuracy of the simulated online resource exchange rate, thereby further improving the service performance of the third-party agency.
[0224] It should be noted that, according to one aspect of the present application, a computer program product or computer program is also provided, and the computer program product or computer program includes one or more instructions, and the one or more instructions are stored in a computer storage medium. The processor of the computer device reads one or more instructions from the computer storage medium, and the processor executes the one or more instructions, so that the computer device executes the method provided in various optional ways in the above method embodiment. It should be understood that what is disclosed above is only a preferred embodiment of the present application, and of course it cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A resource exchange rate processing method based on time window, It is characterized in that include: In the process of opening the online resource exchange time window, N groups of resource exchange rates of target resource pairs are sampled, where N is a positive integer; Any set of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time; Calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each set of resource exchange rates to obtain N rate differences; When receiving a query request for the online resource exchange rate of the target resource pair, if it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment, obtaining the real offline resource exchange rate of the target resource pair at the current moment, where the current moment refers to the moment when the query request is received; Based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, the real online resource exchange rate of the target resource pair at the current moment is simulated and calculated to obtain a simulated online resource exchange rate, and the simulated online resource exchange rate is output.
2. The method according to claim 1, It is characterized in that The step of simulating and calculating the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences to obtain the simulated online resource exchange rate includes: Based on the N rate differences, predicting an exchange rate offset of the target resource pair between a real offline resource exchange rate and a real online resource exchange rate at the current moment; The exchange rate offset is used to perform an offset process on the real offline resource exchange rate of the target resource at the current moment to obtain a simulated online resource exchange rate.
3. The method according to claim 2, It is characterized in that The predicting, based on the N rate differences, an exchange rate offset between a real offline resource exchange rate and a real online resource exchange rate of the target resource pair at the current moment includes: Performing a mean operation on the N rate differences to obtain an average rate difference; The average rate difference is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
4. The method according to claim 2, It is characterized in that The predicting, based on the N rate differences, an exchange rate offset between a real offline resource exchange rate and a real online resource exchange rate of the target resource pair at the current moment includes: Arrange the N rate differences in ascending order to obtain a rate difference sequence; and obtain a target quantile; Calculate the quantile value of the rate difference sequence based on the target quantile to obtain the target quantile value; The target percentile value is used as the exchange rate offset between the real offline resource exchange rate and the real online resource exchange rate of the target resource pair at the current moment.
5. The method according to claim 4, It is characterized in that The obtaining of the target quantile comprises: Obtaining a volatility of the target resource to the actual offline resource exchange rate at the current moment as a target volatility; According to the principle that volatility is proportional to percentile, the target percentile is determined based on the target volatility.
6. The method according to claim 1, It is characterized in that In the process of opening the online resource exchange time window, sampling N groups of resource exchange rates of the target resource pairs includes: Determine an open time period of the online resource exchange time window, and select a time period from the open time period of the online resource exchange time window as an exchange rate sampling time period; In the process of opening the online resource exchange window, within the exchange rate sampling time period, an exchange rate sampling operation is performed on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair; Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates; After the exchange rate sampling time period ends, N groups of resource exchange rates of the target resource pairs are obtained.
7. The method according to claim 6, It is characterized in that The step of selecting a time period as a redemption rate sampling time period from the open time period of the online resource redemption time window includes: An open time period of the online resource exchange time window is selected as an exchange rate sampling time period.
8. The method according to claim 6, It is characterized in that The step of selecting a time period as a redemption rate sampling time period from the open time period of the online resource redemption time window includes: Determine the start time and the end time of the open time period of the online resource exchange time window, and obtain a first time offset and a second time offset; Based on the first time offset, controlling the start time of the open time period to shift it toward the end time, so as to obtain the shifted start time; Based on the second time offset, controlling the end time of the open time period to shift in a direction close to the start time, so as to obtain the end time after the shift; From the open time period of the online resource exchange time window, a time period between the start time after the shift and the end time after the shift is selected as the exchange rate sampling time period.
9. The method according to claim 6, It is characterized in that The step of selecting a time period as a redemption rate sampling time period from the open time period of the online resource redemption time window includes: Dividing the open time period of the online resource exchange time window into a first time period and a second time period, wherein the end time point of the first time period is the same as the start time point of the second time period; The second time period is used as the exchange rate sampling time period.
10. The method according to claim 1, It is characterized in that In the process of opening the online resource exchange time window, sampling N groups of resource exchange rates of the target resource pairs includes: In the process of opening the online resource exchange time window, the real online resource exchange rate of the target resource pair is sampled in real time, and the volatility of the currently sampled real online resource exchange rate is obtained as the first volatility; If the first volatility is less than a first threshold, taking the sampling time corresponding to the currently sampled real online resource exchange rate as the starting sampling point; Starting from the starting sampling point, performing an exchange rate sampling operation on the target resource pair according to a preset sampling frequency; the exchange rate sampling operation refers to: an operation of simultaneously sampling the real online resource exchange rate and the real offline resource exchange rate of the target resource pair; Each time the exchange rate sampling operation is performed, the real online resource exchange rate and the real offline resource exchange rate sampled by the currently executed exchange rate sampling operation are combined to obtain a set of resource exchange rates; Acquire the volatility of the real online resource exchange rate sampled by the currently executed exchange rate sampling operation as the second volatility; If the second volatility is greater than a second threshold, the exchange rate sampling operation on the target resource pair is stopped to obtain N groups of resource exchange rates for the target resource pair.
11. The method according to claim 1, It is characterized in that When receiving a query request for an online resource exchange rate of the target resource pair, the method further includes: Determine the current time and the open time period of the online resource exchange time window; If the current time is not within the open time period of the online resource exchange time window, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current time.
12. The method according to claim 11, It is characterized in that After determining the current moment and the open time period of the online resource exchange time window, the method further includes: If the current time is within the open time period of the online resource exchange time window, calling the exchange rate query service to query the real online resource exchange rate of the target resource at the current time; If the query fails, it is determined that the real online resource exchange rate of the target resource pair is not obtained at the current moment.
13. A resource exchange rate processing device based on a time window, It is characterized in that include: A sampling unit, used for sampling N groups of resource exchange rates of target resource pairs during the process of opening the online resource exchange time window, where N is a positive integer; Any set of resource exchange rates includes: the real online resource exchange rate and the real offline resource exchange rate sampled at the same time; A processing unit, used to respectively calculate the difference between the real online resource exchange rate and the real offline resource exchange rate in each group of resource exchange rates, and obtain N rate differences; The processing unit is further configured to, when receiving a query request for the online resource exchange rate of the target resource pair, obtain the real offline resource exchange rate of the target resource pair at the current moment if it is determined that the real online resource exchange rate of the target resource pair has not been obtained at the current moment, wherein the current moment refers to the moment when the query request is received; The processing unit is further used to simulate and calculate the real online resource exchange rate of the target resource pair at the current moment based on the real offline resource exchange rate of the target resource pair at the current moment and the N rate differences, obtain a simulated online resource exchange rate, and output the simulated online resource exchange rate.
14. A computer device comprising an input interface and an output interface, It is characterized in that Also includes: processor and computer storage media; Wherein, the processor is suitable for implementing one or more instructions, the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by the processor and executed by the time window-based resource exchange rate processing method as described in any one of claims 1-12.
15. A computer storage medium, It is characterized in that The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executed by the time window-based resource exchange rate processing method as described in any one of claims 1-12.
16. A computer program product, It is characterized in that The computer program product includes one or more instructions; when one or more instructions in the computer program are executed by a processor, the time window-based resource exchange rate processing method as described in any one of claims 1-12 is implemented.
