Detailed Description
For further explanation of the present application, the following examples are provided:
fig. 1 shows a flowchart of a data interaction method according to an exemplary embodiment of the present application, as shown in fig. 1, the method may include the steps of:
step 102, receiving each data interaction request initiated by an internal data interaction object, wherein interaction data corresponding to each data interaction request adopts a first numerical unit.
In this embodiment, the internal data interaction object may be understood as being within the same data interaction system as the embodiment of the data interaction method, and the external data interaction object may be understood as being within a different data interaction system than the embodiment described above. For example, if the internal data interaction object is the payment system of the "payment treasured" platform, the implementation party may be another functional system in the "payment treasured" platform, and the external data interaction object does not belong to the "payment treasured" platform.
Step 104, respectively converting the interactive data corresponding to each data interaction request from the first numerical unit to a second numerical unit according to the optimized numerical conversion rate, and completing the data interaction operation with the internal data interaction object to obtain the interactive data adopting the second numerical unit; the optimized numerical conversion rate is calculated by a preconfigured data distribution ratio among all external data interaction objects and an independent numerical conversion rate corresponding to each external data interaction object.
In this embodiment, because the independent numerical conversion rates corresponding to different external data interaction objects are different, by generating the optimized numerical conversion rate, each data interaction request can obtain the same optimized numerical conversion rate, so that when different data interaction requests adopt different independent numerical conversion rates, the requesters corresponding to the data interaction requests are prevented from being treated differently; meanwhile, the optimized numerical conversion rate is obtained based on data distribution proportion calculation and is associated with the selection of the subsequent external data interaction objects, so that the smooth execution of the whole flow is facilitated.
In this embodiment, the optimized numerical conversion rate may be obtained by taking the data distribution ratio as a weight and performing a weighted calculation on an independent numerical conversion rate corresponding to each external data interaction object.
Step 106, selecting among the all external data interaction objects for each data interaction request, and giving the interaction data adopting the second numerical units as request data to the selected external data interaction objects, so that the proportional relation among the numerical values of the request data respectively accumulated by all the external data interaction objects tends to the data distribution proportion; and obtaining feedback data which is from the selected external data interaction object and adopts a first numerical unit, wherein the request data is equal to the numerical value of the feedback data when being converted into the first numerical unit according to the independent numerical conversion rate corresponding to the selected external data interaction object.
In this embodiment, when selecting all external data interaction objects, the difference between the corresponding proportional relationship and the data allocation proportion may be estimated when the interaction data using the second numerical unit is given as the request data to each external data interaction object; and then, selecting an external data interaction object corresponding to the minimum difference.
By respectively estimating and comparing different selection modes, it can be ensured that the final selection result makes all external data interaction objects respectively accumulate the proportion relation between the received values of the request data to trend the data distribution proportion, namely the total value of the data interaction with the internal data interaction object and the total value of the data interaction with the external data interaction object, and the two total values tend to be equal (numerical value differences may exist due to the numerical conversion based on different numerical conversion rates).
Specifically, when the difference is estimated, the corresponding proportional relation can be estimated when the interactive data adopting the second numerical unit is used as the request data to be endowed to each external data interactive object; respectively converting each proportional relation and each data distribution proportion into a space vector; calculating the included angle value between the space vector corresponding to each proportion relation and the space vector corresponding to the data distribution proportion; and selecting an external data interaction object corresponding to the minimum difference, wherein the external data interaction object comprises: and selecting an external data interaction object corresponding to the minimum included angle value.
The technical scheme of the application is described in detail below with specific application in the payment process; of course, those skilled in the art will appreciate that the technical solution of the present application may obviously be applied to any scenario involving multiparty data interaction, and the present application is not limited thereto. Fig. 2 is a schematic diagram of an application scenario according to an exemplary embodiment of the present application, as shown in fig. 2, and it is assumed that an embodiment of the above-mentioned data interaction method is a data interaction device, an internal data interaction object is a payment system, and an external data interaction object is a foreign exchange provider, so as to solve a foreign exchange problem involved in a payment process. Specifically, fig. 3 shows a flowchart of another data interaction method according to an exemplary embodiment of the present application, which is applied to the data interaction device shown in fig. 2, and may include the following steps:
step 302, a payment request initiated by a payment system is received.
In this embodiment, if the shopping order of the user relates to a foreign exchange transaction, the payment system initiates a payment request to the data interaction device according to the transaction requirement of the user.
For example, in a purchase, the user initiates a $ 100 order, but the user can only settle with russian lub, then a transaction is made between the payment system and the user through russian lub, and the payment system exchanges the resulting russian lub with the foreign exchange provider, thereby eventually obtaining $ 100 from the payment system (there may be a numerical difference due to exchange rate changes).
At step 304, available foreign exchange providers are determined.
Step 306, calculating an optimized exchange rate according to the independent exchange rate of each available foreign exchange provider and the preconfigured data distribution ratio.
In this embodiment, when only one foreign exchange provider exists, exchange rate conversion and transaction of transaction amount can be directly completed among the user, the payment system and the foreign exchange provider according to the exchange rate provided by the foreign exchange provider; however, when there are multiple foreign exchange providers, the optimal exchange rate needs to be calculated because the exchange rates provided by the individual foreign exchange providers are not uniform, but the same exchange rate must be provided to all users.
The calculation process of optimizing exchange rate involves pre-negotiated data distribution ratio among multiple foreign exchange providers, i.e. transaction amount distribution ratio. Taking the example of the foreign exchange provider a, the foreign exchange provider B, and the foreign exchange provider C shown in fig. 2, it is assumed that the distribution ratio of the corresponding transaction amounts is a: b: c, namely the proportion of the payment system to the accumulated transaction amounts respectively completed by the foreign exchange provider A, the foreign exchange provider B and the foreign exchange provider C is a: b: c, and a+b+c=1. Then, if the exchange rates provided by foreign exchange provider A, foreign exchange provider B, and foreign exchange provider C are FXa, FXb, and FXc, respectively, then the optimal exchange rate FXr may be calculated according to the following formula: FXr =fxa×a+ FXb ×b+fxc×c.
Similarly, when there are n foreign exchange providers, the optimal exchange rate FXr can be calculated according to the following formula: FXr = fx1×w1+fx2×w2+fx3×w3+ … … + FXn ×wn, where Wn is the exchange rate provided by the nth foreign exchange provider.
Step 308, the payment operation is completed with the payment system.
In this embodiment, for example, assume that foreign exchange provider a, foreign exchange provider B, and foreign exchange provider C provide exchange rates of fxa=48, FXb =50, fxc=52, respectively, and a: b: c=20%: 50%:30 percent, the resulting optimized exchange rate is FXr =48 x 20% +50 x 50% +52 x 30% = 50.2. Then, all users can use the optimized exchange rate FXr =50.2 to complete the trade with the trade system, so that the trade uniformity is ensured.
For example, for a transaction order with a dollar amount of $100 in the above embodiment, the final transaction amount is 100×50.2=5020 russian.
In step 310, the accumulated transaction amount corresponding to each foreign exchange provider is estimated when the current payment amount is allocated to each foreign exchange provider.
In this embodiment, after the transaction is completed based on the optimized exchange rate and the user, the payment system needs to shunt the obtained transaction amount to a certain foreign exchange provider to obtain the foreign exchange of the required unit; such as the 5020 russian rufiu described above, is re-converted to dollars. However, since the optimal exchange rate is not the same as that provided by each foreign exchange provider, if exchanged with foreign exchange provider A or foreign exchange provider B, this will result in a loss of the payment system due to FXa < FXR, FXb < FXr, and if exchanged with foreign exchange provider C, this will result in a profit of the payment system due to FXc > FXr.
However, based on the pre-negotiated data allocation proportion, the payment system may not always exchange with the foreign exchange provider C, so that each time the payment system shunts the transaction amount to a certain foreign exchange provider, there may be a loss, there may be a profit, and the allocation result of the transaction amount must be made to conform to the data allocation proportion. Therefore, for each transaction amount, reasonable selection of foreign exchange providers is needed to ensure that the payment system finally tends to be balanced in terms of profit and loss, and the split amount received by each foreign exchange provider accords with the data distribution proportion.
As an exemplary embodiment, the present application provides a foreign exchange provider (i.e., external data interaction object) selection approach as shown in fig. 4. Specifically, assuming that n foreign exchange providers exist, establishing a corresponding n-dimensional space coordinate system, and then the data distribution proportion exists in the n-dimensional space coordinate system with corresponding vectors f= [ a, b, c, … … ], wherein a is a data distribution proportion value corresponding to the foreign exchange provider a; meanwhile, the data interaction system can accumulate transaction amounts distributed to all the foreign exchange providers and obtain a vector T= [ Ta, tb, tc, … … ] formed by corresponding accumulated amounts, wherein Ta is the accumulated amount corresponding to the foreign exchange provider A, and other parameters have similar meanings.
Then, assuming that the transaction amount currently formed is Ti, it can be assumed that the vector T described above changes when it is assigned to each foreign exchange provider. Wherein, if Ti is assigned to the foreign exchange provider A, the vector T is changed to [ Ta+Ti, tb, tc, … … ]; if Ti is assigned to the foreign exchange provider B, the vector T is changed to [ Ta, tb+Ti, tc, … … ], and so on.
Then, the angle α between each estimated post-change vector T (e.g., [ ta+ti, tb, tc, … … ], [ Ta, tb+ti, tc, … … ] etc.) and vector F is calculated, respectively, and when the angle α is larger, the larger the deviation from the data distribution ratio is indicated, and conversely, the smaller the deviation is.
Therefore, through selecting the estimated condition that the included angle alpha is minimum every time and selecting the corresponding foreign exchange provider positively to distribute the transaction amount formed currently, the final transaction amount distribution result is ensured to trend to the data distribution proportion more and more times through more and more transaction amount distribution, and the ideal distribution condition is achieved.
Step 312, a foreign exchange provider is selected that applies to the current payment request.
And step 314, distributing the transaction amount corresponding to the current payment request to the selected foreign exchange provider.
Step 316, exchange of the split amount with the selected foreign exchange provider is completed.
Fig. 5 shows a schematic block diagram of an electronic device according to an exemplary embodiment of the present application. Referring to fig. 5, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a nonvolatile memory, and may include hardware required by other services. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs, and forms a data interaction device on a logic level. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present application, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Referring to fig. 6, in a software embodiment, the data interaction device may include a request receiving unit, an internal interaction unit, and an external interaction unit. Wherein:
the request receiving unit receives each data interaction request initiated by the internal data interaction object, and interaction data corresponding to each data interaction request adopts a first numerical unit;
the internal interaction unit is used for respectively converting interaction data corresponding to each data interaction request from the first numerical unit to the second numerical unit according to the optimized numerical conversion rate, and completing data interaction operation with the internal data interaction object so as to obtain interaction data adopting the second numerical unit; the optimized numerical conversion rate is calculated by a pre-configured data distribution proportion among all external data interaction objects and independent numerical conversion rates corresponding to all external data interaction objects respectively;
the external interaction unit is used for selecting all the external data interaction objects according to each data interaction request, and giving the interaction data adopting the second numerical unit as request data to the selected external data interaction objects; and obtaining feedback data which is from the selected external data interaction object and adopts a first numerical unit, wherein the request data is equal to the numerical value of the feedback data when being converted into the first numerical unit according to the independent numerical conversion rate corresponding to the selected external data interaction object.
Optionally, the optimized numerical conversion rate is obtained by taking the data distribution proportion as a weight and performing weighted calculation on the independent numerical conversion rate corresponding to each external data interaction object.
Optionally, the external interaction unit is specifically configured to:
respectively estimating the difference between the corresponding proportional relation and the data distribution proportion when the interactive data adopting the second numerical unit is used as request data to be endowed to each external data interactive object;
and selecting an external data interaction object corresponding to the minimum difference.
Optionally, the external interaction unit is specifically configured to:
respectively estimating the corresponding proportional relation when the interactive data adopting the second numerical unit is used as request data to be endowed to each external data interactive object;
respectively converting each proportional relation and each data distribution proportion into a space vector;
calculating the included angle value between the space vector corresponding to each proportion relation and the space vector corresponding to the data distribution proportion; and
the selecting the external data interaction object corresponding to the minimum difference comprises the following steps: and selecting an external data interaction object corresponding to the minimum included angle value.
Alternatively, the proportional relationship between the values of the request data respectively accumulated and assigned to the all external data interaction objects tends to the data distribution proportion.
Optionally, the internal data interaction object is a payment system, and the data interaction request is a payment request; and the external data interaction object is a foreign exchange provider, and the independent numerical conversion rate is an exchange rate.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.