Transaction service processing method and apparatus, electronic device, storage medium, and computer program product
Patent Information
- Application Number
- CN202510339232.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2026-09-22
AI Technical Summary
[0003]但是,相关技术中的方案,由于目标交易币种对之间的资源转换率会在24小时内随着市场成本信息不断高频更新,因此,在闭市时段内统计打包用户的累积交易业务量,在资源交易平台开市时统一发往资源交易平台进行换汇的方案,会存在交易成本较高的问题
[0025] During transaction processing, the electronic device first acquires the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at a first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment. Then, based on the first and second resource conversion rate difference values, it determines the trend of the resource conversion rate of the target trading currency pair from the current moment to the second moment. Based on this trend and the first and second resource conversion rates of different platforms at the current moment, it determines the optimal time to send a transaction request for the first cumulative transaction volume. The transaction request for the first cumulative transaction volume is then sent to the resource trading platform at this optimal time, ensuring the lowest transaction cost. This significantly reduces transaction costs by enabling the transaction request for the first cumulative transaction volume to be sent to the resource trading platform at the lowest possible time.
Smart Images

Figure CN122798531A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and includes, but is not limited to, a transaction processing method, apparatus, electronic device, storage medium, and computer program product. Background Technology
[0002] Third-party payment institutions typically offer 24-hour currency exchange services to their clients, while the foreign exchange market for target trading currencies between resource trading platforms (such as banks) has clearly defined opening and closing times, allowing trading only during tradable hours. In related technical solutions, during the opening hours, after receiving a user's transaction order, the third-party payment institution directly sends it to the resource trading platform for currency exchange. During the closing hours, after receiving user transaction orders, the third-party payment institution compiles and packages them, sending them all to the resource trading platform for currency exchange when the platform opens.
[0003] However, the solutions in the relevant technologies have a high transaction cost problem because the resource conversion rate between the target trading currency pairs is constantly updated with market cost information within 24 hours. Therefore, the solution of collecting the cumulative transaction volume of users during the closed period and sending it to the resource trading platform for currency exchange when the platform opens will have a high transaction cost. Summary of the Invention
[0004] This application provides a transaction processing method, apparatus, electronic device, storage medium, and computer program product, which can be applied to at least the cloud technology field and the financial business field. By determining the sending time of the transaction request for the first cumulative transaction volume and sending the transaction request for the first cumulative transaction volume at the sending time, the transaction cost can be greatly reduced.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a transaction processing method, the method comprising: acquiring a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value of a target trading currency pair at a first moment, and a second resource conversion rate difference value of the target trading currency pair at the current moment; the first moment being within the preset time period; determining a trend of resource conversion rate change of the target trading currency pair from the current moment to a second moment based on the first resource conversion rate difference value and the second resource conversion rate difference value; the second moment being later than the current moment; in response to the trend being a target trend, acquiring the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment; determining a sending time for a transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate; and sending a transaction request for the first cumulative transaction volume to the resource trading platform at the sending time.
[0007] This application provides a transaction processing apparatus, comprising: a first acquisition module, configured to acquire a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value of a target trading currency pair at a first moment, and a second resource conversion rate difference value of the target trading currency pair at the current moment; the first moment being within the preset time period; a first determination module, configured to determine, based on the first resource conversion rate difference value and the second resource conversion rate difference value, a trend of change in the resource conversion rate of the target trading currency pair from the current moment to a second moment; the second moment being later than the current moment; a second acquisition module, configured to, in response to the trend being a target trend, acquire, at the current moment, the first resource conversion rate between the target trading currency pairs published by a target resource trading platform, and the second resource conversion rate between the target trading currency pairs published by a trading control platform; a second determination module, configured to, based on the first resource conversion rate and the second resource conversion rate, determine a sending time for a transaction request for the first cumulative transaction volume; and a sending module, configured to, at the sending time, send a transaction request for the first cumulative transaction volume to the resource trading platform.
[0008] In the above scheme, the second determining module is further configured to: in response to the first resource conversion rate being less than the second resource conversion rate, determine the sending time of the transaction request for the first cumulative transaction volume as the current time; or, in response to the first resource conversion rate being less than the second resource conversion rate, determine the sending time of the transaction request for the first cumulative transaction volume as any time between the current time and the second time.
[0009] In the above scheme, the second determining module is further configured to: in response to the first resource conversion rate being greater than or equal to the second resource conversion rate, obtain the first resource conversion rate and the second resource conversion rate at the third time; the third time is later than the current time; in response to the third time being equal to the second time, determine the second time as the sending time of the transaction request for the first cumulative transaction volume; in response to the third time being earlier than the second time, determine the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate at the third time.
[0010] In the above scheme, when the transaction is to purchase the target currency, the target trend is downward; when the transaction is to sell the target currency, the target trend is upward.
[0011] In the above scheme, the second determining module is further configured to: when the transaction business is to purchase the target transaction currency, in response to the upward trend of the change, determine the sending time of the transaction request for the first cumulative transaction volume as the current time; the sending module is further configured to: at the current time, send the transaction request for the first cumulative transaction volume to the resource trading platform.
[0012] In the above scheme, the second determining module is further configured to: when the transaction business is to purchase the target transaction currency, in response to the upward trend of the change, determine the sending time of the transaction request for the first cumulative transaction volume as any time between the current time and the second time; the sending module is further configured to: at the sending time, send the transaction request for the first cumulative transaction volume to the resource trading platform.
[0013] In the above scheme, the sending module is further configured to: in response to the arrival of the sending time, obtain the second cumulative transaction volume between the current time and the sending time; determine the total cumulative transaction volume of the first cumulative transaction volume and the second cumulative transaction volume; generate a transaction request for the total cumulative transaction volume; the transaction request includes the cumulative transaction resource quantity of the total cumulative transaction volume; and send the transaction request for the total cumulative transaction volume to the resource trading platform.
[0014] In the above scheme, the second acquisition module is further configured to: acquire from the first database the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current time; and acquire from the second database the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current time.
[0015] In the above scheme, the device further includes: a first database processing module, used to call a periodic scheduled task to obtain a first resource conversion rate between the target trading currency pairs published by the resource trading platform; the periodic scheduled task carries a first timestamp; and the obtained first resource conversion rate is mapped with the first timestamp and stored in the first database.
[0016] In the above scheme, the device further includes: a second database processing module, used to call a periodic subscription task to obtain a second resource conversion rate between the target trading currency pairs published by the trading control platform; the periodic subscription task carries a second timestamp; and the obtained second resource conversion rate is mapped with the second timestamp and stored in the second database.
[0017] In the above scheme, the device further includes: a transaction volume accumulation module, used to, in response to the current time being within the preset time period, obtain the transaction volume at the current time before obtaining the first accumulated transaction volume within the preset time period; and to summarize the transaction volume at the current time into the first accumulated transaction volume.
[0018] In the above scheme, the device further includes: a transaction module, used to, in response to the current time being later than the second time and the current time not being within the preset time period, obtain the transaction business at the current time before obtaining the first cumulative transaction business volume within the preset time period; and send a transaction request for the transaction business at the current time to the resource trading platform.
[0019] In the above scheme, the first acquisition module is further configured to: acquire the first onshore resource conversion rate and the first offshore resource conversion rate of the target trading currency pair at the first time point, and acquire the second onshore resource conversion rate and the second offshore resource conversion rate of the target trading currency pair at the current time point; determine the first resource conversion rate difference value based on the first onshore resource conversion rate and the first offshore resource conversion rate; and determine the second resource conversion rate difference value based on the second onshore resource conversion rate and the second offshore resource conversion rate.
[0020] In the above scheme, the device further includes: a transaction processing module, configured to, after sending a transaction request for the first cumulative transaction volume to the resource trading platform, determine a predicted cumulative transaction volume for a target time period based on the cumulative transaction volume within a specific historical time period; the target time period is later than the second time period; send a transaction request for the predicted cumulative transaction volume to the resource trading platform at the target time period, and receive a transaction result returned by the resource trading platform in response to the transaction request; and, based on the transaction result, perform a business response to the real-time received transaction business within the target time period.
[0021] This application provides an electronic device, including: a memory for storing computer-executable instructions or computer programs; and a processor for executing the computer-executable instructions or computer programs stored in the memory to implement the above-described transaction processing method.
[0022] This application provides a computer program product, which includes computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, they implement the above-described transaction processing method.
[0023] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the aforementioned transaction processing method.
[0024] The embodiments of this application have the following beneficial effects:
[0025] During transaction processing, the electronic device first acquires the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at a first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment. Then, based on the first and second resource conversion rate difference values, it determines the trend of the resource conversion rate of the target trading currency pair from the current moment to the second moment. Based on this trend and the first and second resource conversion rates of different platforms at the current moment, it determines the optimal time to send a transaction request for the first cumulative transaction volume. The transaction request for the first cumulative transaction volume is then sent to the resource trading platform at this optimal time, ensuring the lowest transaction cost. This significantly reduces transaction costs by enabling the transaction request for the first cumulative transaction volume to be sent to the resource trading platform at the lowest possible time. Attached Figure Description
[0026] Figure 1This is an optional architecture diagram of the transaction processing system provided in the embodiments of this application;
[0027] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0028] Figure 3 This is an optional flowchart illustrating the transaction processing method provided in the embodiments of this application;
[0029] Figure 4 This is another optional flowchart illustrating the transaction processing method provided in the embodiments of this application;
[0030] Figure 5 This is a schematic diagram illustrating the implementation flow of the method for constructing the first database provided in this application embodiment;
[0031] Figure 6 This is a schematic diagram illustrating the implementation flow of the method for constructing the second database provided in this application embodiment;
[0032] Figure 7 This is a schematic diagram illustrating the implementation process of sending a transaction request to a resource trading platform, as provided in an embodiment of this application.
[0033] Figure 8 This is another optional flowchart illustrating the transaction processing method provided in the embodiments of this application;
[0034] Figure 9 This is a schematic diagram illustrating the implementation process of responding to transaction services based on the target transaction currency purchased in advance, as provided in an embodiment of this application.
[0035] Figure 10 This is a time period distribution diagram of the transaction processing method provided in the embodiments of this application;
[0036] Figure 11 This is a system architecture diagram of the transaction processing method provided in the embodiments of this application;
[0037] Figure 12 This is a timing diagram of the transaction processing method provided in the embodiments of this application;
[0038] Figure 13 This is a schematic diagram illustrating the implementation process of judging price trends provided in an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit the application.
[0041] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0042] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0043] (1) Responding to: used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0044] (2) Third-party payment: Third-party payment refers to a network payment model where an independent institution with certain strength and credit guarantees provides an interface to the payment and settlement system of a resource trading platform by signing an agreement with the platform. Under the third-party payment model, after the buyer selects goods, they use the account provided by the third-party payment platform to make payment (pay to the third-party payment platform), and the third-party payment platform notifies the seller that the payment has been received and requests delivery; after the buyer receives the goods, inspects them, and confirms their receipt, they notify the third-party payment platform to make payment; the third-party payment platform then transfers the payment to the seller's account.
[0045] (3) Foreign exchange purchase: This refers to the act of an individual or enterprise purchasing foreign exchange through a resource trading platform or other platforms. The exchange rate for foreign exchange purchase will vary depending on market supply and demand and the quotes from the resource trading platform.
[0046] (4) Foreign exchange settlement: This refers to the act of an individual or enterprise exchanging their holdings of other regional currencies for the currency of their current location. The exchange rate for foreign exchange settlement is also affected by market supply and demand and the quotations of resource trading platforms.
[0047] (5) Onshore rate: refers to the exchange rate between the currency traded in the current location and the currency traded in other regions in the current market. The onshore rate is usually determined by the local institution based on market supply and demand.
[0048] (6) Offshore rate: refers to the exchange rate between the currency traded in the current location and the currency traded in other regions outside the current location. The offshore rate is usually greatly affected by market supply and demand and may differ from the onshore rate.
[0049] (7) Fair exchange rate: refers to the exchange rate agreed upon by buyers and sellers on a voluntary basis in a free and open market. The fair exchange rate reflects the true supply and demand relationship in the market and is generally considered to be the exchange rate that best represents the market equilibrium state.
[0050] (8) Historical exchange rate: refers to the exchange rate between the currency traded in the current location and the currency traded in other regions at a specific point in the past.
[0051] Before explaining the transaction processing method provided in the embodiments of this application, the methods in related technologies will be described first.
[0052] In the relevant technology, during the market opening hours, after receiving a user's transaction order, the third-party payment institution will directly send it to the resource trading platform for currency exchange. During the market closing hours, after receiving a user's transaction order, the third-party payment institution will compile and package it, and then send it to the resource trading platform for currency exchange when the platform opens.
[0053] However, when the trading session begins at 7:00 AM, the local resource trading platform accepts foreign exchange transactions for the currency (e.g., CNY), but price updates are slow or non-existent (based on yesterday's closing price). The CNY exchange rate only aligns with market changes when the local platform starts updating prices for other regional currency trading centers at 9:15 AM. For example, a third-party payment institution receives user orders during the closing period and packages 10,000 units of other regional currency payment orders. The original plan would have executed the transaction with the resource trading platform at 7:00 AM using yesterday's closing price (assuming 7.0), resulting in a cost of 70,000 units of the local currency payment order. If the local currency exchange rate falls overnight due to market influences, reaching 6.9 after the 9:15 AM price update, then if the overnight order could be traded at 9:15 AM, a transaction cost of 1,000 units of the local currency payment order could be saved.
[0054] Therefore, the solution in the relevant technology has the problem of high transaction costs because the resource conversion rate between the target trading currency pairs is constantly updated with market cost information within 24 hours. The solution is to count the cumulative transaction volume of users during the market closure period and send it to the resource trading platform for currency exchange when the platform opens.
[0055] Based on at least one of the aforementioned problems with the methods in related technologies, this application provides a transaction processing method. By introducing the resource conversion rate data, which is updated frequently within 24 hours along with market cost information, the method uses the resource conversion rate difference value to predict the opening price trend of the currency traded at the current onshore location. This helps third-party payment institutions decide when to send transaction requests to the resource trading platform, i.e., to purchase foreign exchange in advance when the exchange rate trend is upward and to appropriately delay purchasing foreign exchange when the exchange rate trend is downward, thereby reducing the foreign exchange purchase transaction costs for third-party payment institutions. Specifically, the transaction processing method provided in this application embodiment firstly involves an electronic device acquiring a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value for a target trading currency pair at a first moment, and a second resource conversion rate difference value for the target trading currency pair at the current moment; the first moment is within the preset time period. Then, based on the first and second resource conversion rate difference values, the changing trend of the resource conversion rate of the target trading currency pair from the current moment to the second moment is determined; the second moment is later than the current moment. Next, in response to the changing trend being the target changing trend, the first resource conversion rate between target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between target trading currency pairs published by the trading control platform at the current moment are acquired. Then, based on the first and second resource conversion rates, the sending time of the transaction request for the first cumulative transaction volume is determined. Finally, the transaction request for the first cumulative transaction volume is sent to the resource trading platform at the sending time. In this way, the transaction request for the first cumulative transaction volume can be sent to the resource trading platform at the sending time with the lowest transaction cost, thereby greatly reducing transaction costs.
[0056] Here, we first describe an exemplary application of the transaction processing device in this application embodiment. This transaction processing device is an electronic device used to implement a transaction processing method. In one implementation, the anomaly detection device (i.e., electronic device) provided in this application embodiment can be implemented as a terminal or as a server. In one implementation, the transaction processing device provided in this application embodiment can be implemented as any terminal capable of transaction processing, such as a laptop, tablet, desktop computer, mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device, intelligent robot, smart home appliance, and smart vehicle device. In another implementation, the transaction processing device provided in this application embodiment can also be implemented as a server, wherein the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in this application embodiment. The following describes an exemplary application when the transaction processing equipment is implemented as a server.
[0057] See Figure 1 , Figure 1 This is an optional architecture diagram of the transaction processing system provided in this application embodiment. The transaction processing system 10 in this application embodiment includes at least a terminal 100, a network 200, a server 300, and a resource trading platform 400. The terminal 100 is equipped with a payment platform of a third-party payment institution, which can provide a product purchase function. Users can purchase products through the payment platform on the terminal 100. The server 300 can be the backend server of the third-party payment institution. The server 300 can constitute the transaction processing device of this application embodiment, that is, the transaction processing method of this application embodiment is implemented through the server 300. The terminal 100 is connected to the server 300 through the network 200, which can be a wide area network or a local area network, or a combination of both. The resource trading platform 400 can be a financial trading platform. The third-party payment institution can send a foreign exchange purchase request or a foreign exchange settlement request to the resource trading platform 400. This foreign exchange purchase request or foreign exchange settlement request is used to request a business response to the user's purchase of goods transaction, thereby realizing the conversion of the user's current location transaction currency into a transaction currency of another region.
[0058] See Figure 1When a user wants to purchase product A on a third-party payment platform, product A is provided by a supplier in another region. The user can send a transaction request to server 300 through terminal 100, and server 300 sends a response to terminal 100. At the same time, server 300 accumulates the transaction requests within a preset time period to obtain a first accumulated transaction volume. It can also obtain the first resource conversion rate difference value of the target transaction currency pair (i.e., the transaction currency pair composed of the current location's transaction currency and the transaction currency of other regions) and the second resource conversion rate difference value of the target transaction currency pair at the current moment, where the first moment is within the preset time period. Subsequently, server 300 can determine the trend of resource conversion rate changes for the target trading currency pair from the current time to a second time, based on the first resource conversion rate difference value and the second resource conversion rate difference value, where the second time is later than the current time. Then, in response to the trend change being the target trend change, server 300 obtains the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current time, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current time. Next, server 300 determines the sending time of the transaction request for the first cumulative trading volume based on the first and second resource conversion rates; and at the sending time, sends the transaction request for the first cumulative trading volume to resource trading platform 400. Resource trading platform 400 can respond to the received transaction request for the first cumulative trading volume, thereby completing the business response for the first cumulative trading volume within a preset time period and obtaining the business response result for each transaction corresponding to the first cumulative trading volume.
[0059] The transaction processing method provided in this application embodiment can also be implemented based on a cloud platform and through cloud technology. For example, the server 300 mentioned above can be a cloud server. The cloud server determines the trend of the resource conversion rate of the target trading currency pair from the current time to the second time based on the first resource conversion rate difference value and the second resource conversion rate difference value. Alternatively, the cloud server can determine the sending time of the transaction request for the first cumulative transaction volume based on the first and second resource conversion rates. Or, the cloud server can send the transaction request for the first cumulative transaction volume to the resource trading platform at the sending time.
[0060] In some embodiments, a cloud storage device may also be included, which can store the first cumulative transaction volume within a preset time period, or the first resource conversion rate difference value of the target trading currency pair at a first moment and the second resource conversion rate difference value of the target trading currency pair at the current moment. In this way, when processing transaction transactions, the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at a first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment can be obtained from the cloud storage device.
[0061] It's important to clarify that cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied in the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can be achieved through cloud computing.
[0062] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Figure 2 The illustrated electronic device may be a transaction processing device, which includes at least one processor 310, a memory 350, at least one network interface 320, and a user interface 330. The various components of the transaction processing device are coupled together via a bus system 340. It is understood that the bus system 340 is used to implement communication between these components. In addition to a data bus, the bus system 340 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 340.
[0063] The processor 310 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0064] User interface 330 includes one or more output devices 331 that enable the presentation of media content, and one or more input devices 332.
[0065] Memory 350 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. Memory 350 may optionally include one or more storage devices physically located remote from processor 310. Memory 350 may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), and volatile memory may be random access memory (RAM). The memory 350 described in this application embodiment is intended to include any suitable type of memory. In some embodiments, memory 350 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as illustrated below.
[0066] Operating system 351 includes system programs for handling various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; network communication module 352 is used to reach other computing devices via one or more (wired or wireless) network interfaces 320, exemplary network interfaces 320 include: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.; input processing module 353 is used to detect and translate one or more user inputs or interactions from one or more input devices 332.
[0067] In some embodiments, the apparatus provided in this application may be implemented in software. Figure 2 A transaction processing device 354 stored in memory 350 is shown. This device 354 can be a transaction processing device in an electronic device, and can be software in the form of programs and plug-ins. It includes the following software modules: a first acquisition module 3541, a first determination module 3542, a second acquisition module 3543, a second determination module 3544, and a sending module 3545. These modules are logically connected and can therefore be arbitrarily combined or further divided according to their implemented functions. The functions of each module will be described below.
[0068] In some embodiments, the apparatus provided in this application can be implemented in hardware. For example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the transaction processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0069] The transaction processing methods provided in the embodiments of this application can be executed by an electronic device, which can be a server or a terminal. That is, the transaction processing methods in the embodiments of this application can be executed by a server, by a terminal, or by interaction between a server and a terminal.
[0070] Figure 3 This is an optional flowchart illustrating the transaction processing method provided in the embodiments of this application. The following will be combined with... Figure 3 The steps shown are explained as follows: Figure 3 As shown, taking the server as the execution subject of the transaction processing method as an example, the method includes the following steps S101 to S105:
[0071] Step S101: Obtain the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at the first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment.
[0072] Here, the server obtains the first cumulative transaction volume within a preset time period. The preset time period can be a historical period prior to the current moment, or it can be a period including the current moment. The preset time period can be determined based on information such as the type and location of the target currency in the target trading currency pair. For example, the real-time update period for the resource conversion rate (e.g., exchange rate) of a foreign exchange trading center is from 9:15 AM to 4:30 PM. For region A corresponding to a certain target trading currency, the tradable period for the foreign exchange market between resource trading platforms in region A is from 7:00 AM to 3:00 AM the next day. From 7:00 AM to 9:15 AM, trading is conducted using the closing price of the previous day. After the market opens at 9:15 AM, trading is conducted using the real-time updated price of the foreign exchange trading center. Therefore, the period from 4:30 PM the previous day to 7:00 AM the current day can be the preset time period in this embodiment. Within this preset time period, the received user transaction transactions are not directly sent to the resource trading platform for transaction processing, but are accumulated to obtain the first cumulative transaction volume. The first cumulative transaction volume is used to represent the number of transactions within a preset time period and the cumulative transaction resources corresponding to that number of transactions. For example, the cumulative transaction resources may be the total transaction amount within the preset time period.
[0073] The server also obtains the first resource conversion rate difference value of the target trading currency pair at the first moment. This first moment is within a preset time period, and it is the trading deadline of the previous day. For example, the preset time period is from 16:30 on the previous day to 7:00 on the current day, and the first moment could be 3:00 on the current day.
[0074] In different types of transaction services, if the transaction service only supports a specific currency as the transaction currency, and the transaction currency is inconsistent with the user's held currency, currency conversion is involved, requiring the held currency to be converted into the transaction currency for the transaction. Therefore, it is necessary to combine information such as the difference in the first resource conversion rate between the user's held currency and the target transaction currency pair to complete the transaction processing. Here, the target transaction currency pair can include (held currency: transaction currency). For example, if the transaction currency is US dollars and the user's held currency is Hong Kong dollars, the specified transaction currency pair can be (US dollars: Hong Kong dollars). It is understandable that when the user's held currency and the transaction currency are consistent, since no currency conversion is involved, the transaction can be processed directly. However, when the user's held currency and the transaction currency are inconsistent, the transaction processing method of this application is used for processing.
[0075] The transaction service can be configured to support only one transaction currency or multiple transaction currencies. In this embodiment, the transaction service is configured to support multiple transaction currencies. When configured to support multiple transaction currencies, the transaction processing interface displays the default transaction currency pair's price data after currency conversion. Users can also reselect one of the supported transaction currency pairs on the processing interface. When conducting a transaction, users pay according to the price data after currency conversion displayed on the processing interface. For third-party payment institutions' servers, if they can convert users' transactions and transaction currencies at a lower exchange rate, their transaction costs can be significantly reduced.
[0076] In this embodiment, the methods for obtaining the held currencies in the target trading currency pair can include the following scenarios: First, if the user's personal information lists the held currencies, the currencies are obtained from the user's personal information. Second, if the user has historical transaction records, the currencies held are obtained from those records. Third, if the user's personal information does not list the held currencies and there are no historical transaction records, the currencies held are estimated based on the user's IP address and the language displayed on the webpage. The trading currencies in the target trading currency pair can be determined based on the business information of the transaction, which may include the region where the sales organization is located and the trading currencies registered by the sales organization.
[0077] The first resource conversion rate difference value refers to the offshore price difference of the target trading currency pair at the first moment, which can be calculated by calling the preset resource conversion rate difference value calculation formula. The second resource conversion rate difference value refers to the offshore price difference of the target trading currency pair at the current moment, which can also be calculated by calling the preset resource conversion rate difference value calculation formula.
[0078] Step S102: Based on the first resource conversion rate difference value and the second resource conversion rate difference value, determine the trend of the resource conversion rate of the target trading currency pair from the current time to the second time.
[0079] In this embodiment, the second time point is later than the current time point. For example, the second time point could be the opening time of a foreign exchange trading center, such as 9:15. The trend of the resource conversion rate of the target trading currency pair from the current time point to the second time point can be determined based on the relationship between the first resource conversion rate difference value and the second resource conversion rate difference value.
[0080] If the first resource conversion rate difference is greater than the second resource conversion rate difference, the trend of the resource conversion rate of the target trading currency pair from the current time to the second time is an upward trend; if the first resource conversion rate difference is less than or equal to the second resource conversion rate difference, the trend of the resource conversion rate of the target trading currency pair from the current time to the second time is a downward trend.
[0081] Step S103: In response to the changing trend as the target changing trend, obtain the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment.
[0082] In this embodiment of the application, when the transaction business is to purchase the target trading currency (i.e., foreign exchange purchase), the target change trend is a downward trend. That is, when the difference value of the first resource conversion rate is less than or equal to the difference value of the second resource conversion rate, the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current time, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current time are obtained.
[0083] When the transaction involves selling the target currency pair (i.e., foreign exchange settlement), the target currency pair shows an upward trend. In other words, when the difference in the first resource conversion rate is greater than the difference in the second resource conversion rate, the first resource conversion rate between the target currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target currency pairs published by the trading control platform at the current moment are obtained.
[0084] The target resource trading platform can be an authoritative resource trading platform in the current location; for example, it could be a central bank. The first resource conversion rate between the target trading currency pairs published by the target resource trading platform can be the exchange rate published by the target resource trading platform.
[0085] A trading control platform is a platform set up by institutions or individuals in the financial market that provides two-way quotes and accepts trading requests. The primary responsibility of a trading control platform is to provide liquidity to the market, ensuring that users can buy or sell related products at any time, and profit from the bid-ask spread. For example, a trading control platform can be a market maker. The secondary resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment can be the fair exchange rate.
[0086] Step S104: Based on the first resource conversion rate and the second resource conversion rate, determine the sending time of the transaction request for the first cumulative transaction volume.
[0087] Here, the timing of sending a transaction request for the first cumulative transaction volume can be determined based on the relationship between the first resource conversion rate and the second resource conversion rate.
[0088] If the first resource conversion rate is less than the second resource conversion rate, the sending time of the transaction request for the first cumulative transaction volume is determined to be the current time, or the sending time of the transaction request for the first cumulative transaction volume is determined to be any time between the current time and the second time. If the first resource conversion rate is greater than or equal to the second resource conversion rate, further analysis and determination are required, which will be explained in detail below.
[0089] In this embodiment of the application, the time at which the transaction request for the first cumulative transaction volume is sent, determined based on the first resource conversion rate and the second resource conversion rate, is the time at which the third-party payment institution has the lowest transaction cost.
[0090] Step S105: At the sending time, send a transaction request for the first cumulative transaction volume to the resource trading platform.
[0091] Upon reaching the sending time, the third-party payment institution's server sends a transaction request for the first accumulated transaction volume to the resource trading platform. This transaction request is used to request the purchase of a transaction currency from the resource trading platform. The amount of this transaction currency is the amount obtained by converting the accumulated transaction resources corresponding to the first accumulated transaction volume according to the resource conversion rate at that sending time. In the case of purchasing goods, purchasing the transaction currency from the resource trading platform means paying the value of the purchased goods in that transaction currency to the resource trading platform.
[0092] The transaction processing method provided in this application involves the server first acquiring a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value for the target currency pair at a first moment, and a second resource conversion rate difference value for the target currency pair at the current moment. Then, based on the first and second resource conversion rate difference values, the server determines the trend of the resource conversion rate of the target currency pair from the current moment to the second moment. Based on this trend and the first and second resource conversion rates on different platforms at the current moment, the server determines the optimal time to send a transaction request for the first cumulative transaction volume. The server then sends the transaction request for the first cumulative transaction volume to the resource trading platform at this optimal time, thus minimizing transaction costs.
[0093] The transaction processing method provided in this application can be applied to various business scenarios, such as foreign exchange purchase and settlement scenarios in the cross-border e-commerce field, as illustrated below.
[0094] In the cross-border e-commerce sector, after a user purchases goods on a cross-border e-commerce platform through a third-party payment institution, the payment is completed using the user's current local currency. Upon receiving the virtual resources in the user's current local currency, the third-party payment institution deposits these virtual resources into a reserve account in that currency. Then, based on the transaction information, the third-party payment institution initiates a foreign exchange purchase request (i.e., a transaction request) with a partner resource trading platform. The resource trading platform then converts the user's current local currency into another region's currency using the real-time exchange rate and deposits the other region's currency into the third-party payment institution's reserve account for that region's currency. Finally, during the fund settlement and remittance stage, the third-party payment institution remits the virtual resources in that region's currency from the reserve account to the overseas merchant's designated receiving account. The real-time exchange rate for the foreign exchange purchase is provided by the partner resource trading platform. Third-party payment institutions can cooperate with multiple resource trading platforms to choose the optimal exchange rate to reduce costs. Third-party payment institutions must obtain a payment business license for other regions' currencies and strictly comply with the relevant regulations of the relevant region's currency management authority. Third-party payment institutions must ensure the authenticity of transaction information, including order, payment slip, and logistics slip information, in order to meet the regulatory requirements for transaction currencies in other regions.
[0095] For foreign exchange settlement scenarios, businesses or sellers need to clearly define their settlement amount, timing, and other requirements, understand the current exchange rate, and choose an appropriate time to settle to minimize losses from exchange rate fluctuations. They can submit a foreign exchange settlement application (i.e., the aforementioned transaction) to a third-party payment institution, filling in the settlement amount and selecting the settlement currency (i.e., the aforementioned other region transaction currencies). Third-party payment institutions can provide the following settlement methods: automatic settlement (when the merchant submits an application, the platform automatically converts the other region transaction currencies to the current location transaction currency according to the prevailing market exchange rate, suitable for merchants with high liquidity needs), manual settlement (merchants can manually perform settlement operations when the exchange rate is favorable; third-party payment institutions also provide an exchange rate locking function to help merchants lock in the exchange rate in advance), and offshore account settlement (for sellers with a certain business scale, offshore accounts can be used to receive multi-currency payments and settle them at appropriate times). After the settlement application is approved, the third-party payment institution converts the virtual resources in other region transaction currencies to the virtual resources in the current location transaction currency and deducts a handling fee. After the fund conversion is completed, the virtual resources in the current location transaction currency will be transferred to the seller's designated resource trading platform account.
[0096] The following will use the above-mentioned foreign exchange purchase scenario as an example, that is, the case where the transaction business is to purchase the target currency, to illustrate the transaction business processing method provided in the embodiments of this application. Figure 4 This is another optional flowchart illustrating the transaction processing method provided in the embodiments of this application, such as... Figure 4 As shown, the method includes the following steps S201 to S210:
[0097] In step S201, the terminal responds to the user's purchase operation and generates a transaction.
[0098] Here, the purchase of goods can be performed on a payment platform provided by a third-party payment institution, or on any shopping platform that partners with a third-party payment institution. After a user performs a purchase operation for a certain product and makes payment on the shopping platform, the shopping platform's server sends the transaction information to the third-party payment institution's server, thereby causing the third-party payment institution's server to generate the transaction.
[0099] In step S202, the terminal sends the transaction information to the server.
[0100] Here, transaction details can be encapsulated within a business request, which is then sent to the server by the terminal. In some embodiments, the terminal may use protocols such as HTTP or WebSocket to send the business request.
[0101] Step S203: The server obtains the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at the first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment.
[0102] Here, the first moment is within the preset time period.
[0103] It should be noted that, in some embodiments, before obtaining the first cumulative transaction volume within a preset time period, the transaction volume at the current moment can be obtained in response to the current moment being within the preset time period; then, the transaction volume at the current moment is aggregated into the first cumulative transaction volume. In other words, when the current moment is within the preset time period, the transaction volume at the current moment can be accumulated, that is, all transaction volumes within the preset time period can be accumulated to obtain the first cumulative transaction volume.
[0104] For example, the preset time period could be from 16:30 of the previous day to 7:00 of the current day. If the current time falls within this period, such as 6:00 AM of the current day, then at that current time, no business request for the first accumulated transaction volume will be sent to the resource trading platform. In other words, the sending time will not be determined yet. At this point, the platform is still in the accumulation phase of the first accumulated transaction volume. Therefore, the transaction volume at the current time can be obtained and aggregated into the first accumulated transaction volume.
[0105] In this embodiment of the application, by determining the relationship between the current time and the preset time period, the transaction volume within the preset time period can be continuously accumulated, thereby ensuring the accurate accumulation of the first accumulated transaction volume. This ensures that after determining the sending time, the accurate first accumulated transaction volume can be sent to the resource trading platform at the sending time, thereby providing an accurate business response to the user's transaction business.
[0106] In some embodiments, before acquiring the first accumulated transaction volume within a preset time period, in response to situations where the current time is later than the second time period and is not within the preset time period, the transaction volume at the current time can be acquired; then, transaction requests for the transaction volume at the current time can be sent to the resource trading platform. That is, when the current time is later than the second time period and is not within the preset time period, the transaction volume at the current time is not accumulated, but rather sent in real-time; that is, the transaction requests received at the current time are sent to the resource trading platform in real-time.
[0107] For example, the second time could be the opening time of the foreign exchange trading center, such as 9:15. Then the current time could be any time within the period from 9:15 to 16:30. If the current time is any time within the period from 9:15 to 16:30, then the user's trading business will be responded to in real time, that is, the user's trading request will be sent to the resource trading platform for processing in real time.
[0108] In this embodiment, at the current time that is later than the second time and not within the preset time period, the user's transaction business is not accumulated. Instead, the user's transaction business request is sent to the resource trading platform for transaction processing in real time. In this way, it can be ensured that the user's transaction is processed in a timely manner during the opening hours of the foreign exchange trading center, avoiding the accumulation of a large number of transaction orders, which could cause transaction losses to the third-party payment institution when exchange rate fluctuations occur. In other words, it can be ensured that the third-party payment institution will not incur high transaction costs.
[0109] In this embodiment of the application, obtaining the first resource conversion rate difference value of the target trading currency pair at the first moment and the second resource conversion rate difference value of the target trading currency pair at the current moment can be achieved in the following way: First, obtain the first onshore resource conversion rate and the first offshore resource conversion rate of the target trading currency pair at the first moment, and obtain the second onshore resource conversion rate and the second offshore resource conversion rate of the target trading currency pair at the current moment; then, call the preset resource conversion rate difference value calculation formula, and determine the first resource conversion rate difference value based on the first onshore resource conversion rate and the first offshore resource conversion rate; and determine the second resource conversion rate difference value based on the second onshore resource conversion rate and the second offshore resource conversion rate.
[0110] The onshore exchange rate, also known as the onshore rate, refers to the exchange rate between the domestic currency and a foreign currency in the foreign exchange market within a country. The onshore rate is typically determined by the country's financial institutions and regulatory bodies based on market supply and demand and policy adjustments. In other words, the onshore exchange rate refers to the exchange rate between the currency traded in the current location and the currencies traded in other regions. The onshore rate is usually determined by institutions in the current location based on market supply and demand.
[0111] The offshore exchange rate, also known as the offshore rate, refers to the exchange rate between a domestic currency and a foreign currency in a foreign exchange market outside the country. The offshore rate is typically formed in regional financial centers and is significantly influenced by regional market supply and demand, and may differ from the onshore rate. In other words, the offshore exchange rate refers to the exchange rate between a currency traded in the current location and a currency traded in other regions, in markets outside the current location.
[0112] The first resource conversion rate difference value refers to the offshore price difference of the target trading currency pair at the first moment. When calculating the offshore price difference of the target trading currency pair at the first moment, it can be based on the first onshore resource conversion rate, the first offshore resource conversion rate, and the target coefficient. Specifically, the difference between the first onshore resource conversion rate and the first offshore resource conversion rate, and the sum of the first onshore resource conversion rate and the first offshore resource conversion rate, can be calculated. Then, the difference is divided by the product of the sum and the target coefficient to obtain the offshore price difference of the target trading currency pair at the first moment. This offshore price difference of the target trading currency pair at the first moment is the first resource conversion rate difference value. In this embodiment, the target coefficient can take any value between 0 and 1. The target coefficient can be set according to specific circumstances; for example, the target coefficient can be set to 0.5.
[0113] The second resource conversion rate difference value refers to the offshore price difference of the target trading currency pair at the current moment. When calculating the offshore price difference of the target trading currency pair at the current moment, it can be based on the second onshore resource conversion rate, the second offshore resource conversion rate, and the target coefficient. Specifically, the difference between the second onshore resource conversion rate and the second offshore resource conversion rate, as well as the sum of the second onshore and second offshore resource conversion rates, can be calculated. Then, the difference is divided by the product of the sum and the target coefficient to obtain the offshore price difference of the target trading currency pair at the current moment. This offshore price difference of the target trading currency pair at the current moment is the second resource conversion rate difference value.
[0114] In this embodiment of the application, by calling a preset resource conversion rate difference calculation formula, a first resource conversion rate difference value is determined based on a first onshore resource conversion rate and a first offshore resource conversion rate; and by calling a preset resource conversion rate difference calculation formula, a second resource conversion rate difference value is determined based on a second onshore resource conversion rate and a second offshore resource conversion rate. This allows for the calculation of accurate first and second resource conversion rate difference values, thereby enabling accurate judgment of the changing trend of resource conversion rates.
[0115] Step S204: The server determines the trend of the resource conversion rate of the target trading currency pair from the current time to the second time based on the first resource conversion rate difference value and the second resource conversion rate difference value.
[0116] The second time point is later than the current time point. For example, the second time point could be the opening time of a foreign exchange trading center, such as 9:15.
[0117] In the implementation process, the trend of the resource conversion rate of the target trading currency pair from the current time to the second time can be determined based on the relationship between the first resource conversion rate difference and the second resource conversion rate difference. If the first resource conversion rate difference is greater than the second resource conversion rate difference, the trend of the resource conversion rate of the target trading currency pair from the current time to the second time can be determined to be an upward trend; if the first resource conversion rate difference is less than or equal to the second resource conversion rate difference, the trend of the resource conversion rate of the target trading currency pair from the current time to the second time can be determined to be a downward trend.
[0118] In step S205, the server responds to the downward trend by obtaining the first resource conversion rate between the target currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target currency pairs published by the trading control platform at the current moment.
[0119] In some embodiments, obtaining the first resource conversion rate between target trading currency pairs published by the target resource trading platform at the current time and the second resource conversion rate between target trading currency pairs published by the trading control platform at the current time in step S205 may be obtained from the first database and the second resource conversion rate between target trading currency pairs published by the trading control platform at the current time.
[0120] Here, the first database can be a relational database, for example, a MySQL database. The first database stores the first resource conversion rate between target currency pairs, which is published in real-time by the target resource trading platform. Therefore, the real-time first resource conversion rate between target currency pairs can be obtained from the first database. This first resource conversion rate between target currency pairs can be the real-time exchange rate published by the target resource trading platform.
[0121] The second database can be a non-relational database, such as Redis. Using a non-relational database ensures concurrent writing and reading of individual data entries. The second database stores the secondary resource conversion rate between target currency pairs published by the trading control platform. Therefore, the real-time secondary resource conversion rate between target currency pairs can be obtained from the second database. This secondary resource conversion rate between target currency pairs can be the fair exchange rate published in real-time by the trading control platform.
[0122] In this embodiment, since the first resource conversion rate between target trading currency pairs published in real time by the target resource trading platform is usually updated every minute, the update frequency is slow and the number is small. Therefore, a relational database can be used to effectively store the first resource conversion rate. However, the second resource conversion rate between target trading currency pairs published by the trading control platform is usually updated several times per second, the update frequency is fast and the number is large. Therefore, a message queue is used to handle this traffic, that is, the data is stored in a non-relational database, which can ensure the effective storage of the second resource conversion rate.
[0123] This application embodiment further provides a method for constructing a first database, such as... Figure 5 As shown, the process includes the following steps S301 to S302:
[0124] Step S301: Invoke a periodic scheduled task to obtain the first resource conversion rate between the target trading currency pairs published on the resource trading platform; the periodic scheduled task carries the first timestamp.
[0125] Step S302: The obtained first resource conversion rate is mapped with the first timestamp and stored in the first database.
[0126] Here, the first database can be a relational database, for example, the first database can be a MySQL database.
[0127] The first database stores the first resource conversion rate between target trading currency pairs published in real time by the target resource trading platform. It can call a periodic scheduled task to obtain the first resource conversion rate between target trading currency pairs published in real time from the resource trading platform, and then map and store the real-time obtained first resource conversion rate with the first timestamp when the first resource conversion rate was obtained into the first database.
[0128] The mapping here refers to associating the acquired first resource conversion rate with the first timestamp to form a complete data record. After obtaining the data record corresponding to each first resource conversion rate, the data record corresponding to each first resource conversion rate is stored in the first database.
[0129] This application provides a method for constructing a second database, such as... Figure 6 As shown, the process includes the following steps S401 to S402:
[0130] Step S401: Invoke the periodic subscription task to obtain the second resource conversion rate between the target trading currency pairs published by the trading control platform; the periodic subscription task carries a second timestamp.
[0131] Step S402: The obtained second resource conversion rate is mapped with the second timestamp and stored in the second database.
[0132] Here, the second database can be a non-relational database, for example, the second database can be a Redis database.
[0133] The second database stores the second resource conversion rate between target trading currency pairs published in real time by the trading control platform. It can call periodic subscription tasks to obtain the second resource conversion rate between target trading currency pairs published in real time from the trading control platform, and then map and store the real-time obtained second resource conversion rate with the second timestamp when the second resource conversion rate was obtained into the second database.
[0134] The mapping here refers to associating the acquired second resource conversion rate with the second timestamp to form a complete data record. After obtaining the data record corresponding to each second resource conversion rate, the data record corresponding to each second resource conversion rate is stored in the second database.
[0135] Step S206: The server determines the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate.
[0136] In this embodiment of the application, the sending time of the transaction request for the first cumulative transaction volume is determined based on the first resource conversion rate and the second resource conversion rate. This can be achieved by first determining the magnitude relationship between the first resource conversion rate and the second resource conversion rate, and then determining the sending time of the transaction request for the first cumulative transaction volume based on the different magnitude relationships between the first resource conversion rate and the second resource conversion rate.
[0137] In one implementation, to address the situation where the first resource conversion rate is less than the second resource conversion rate, determining the sending time of the transaction request for the first cumulative transaction volume can be achieved by setting the current time as the sending time of the transaction request for the first cumulative transaction volume in response to the first resource conversion rate being less than the second resource conversion rate. In other words, when it is determined that the first resource conversion rate is less than the second resource conversion rate, the current time is determined as the sending time of the transaction request for the first cumulative transaction volume.
[0138] In another implementation where the first resource conversion rate is less than the second resource conversion rate, the sending time of the transaction request for the first cumulative transaction volume can be determined as any time between the current time and the second time, in response to the first resource conversion rate being less than the second resource conversion rate. In other words, when it is determined that the first resource conversion rate is less than the second resource conversion rate, any time between the current time and the second time is determined as the sending time of the transaction request for the first cumulative transaction volume.
[0139] In this embodiment, when the first resource conversion rate is less than the second resource conversion rate, it indicates that the transaction cost at the current moment is lower than the market price level. Therefore, choosing to send the transaction request immediately can greatly reduce transaction costs. Furthermore, employing different methods to determine the sending time of transaction requests for the first cumulative transaction volume can adapt to different business processing needs, thereby providing third-party payment institutions with multiple sending time options and ensuring increased diversity in transaction request sending times while reducing transaction costs.
[0140] When the first resource conversion rate is greater than or equal to the second resource conversion rate, determining the sending time of the transaction request for the first cumulative transaction volume can be achieved by first obtaining the first resource conversion rate and the second resource conversion rate at a third time point, which is later than the current time point, in response to the first resource conversion rate being greater than or equal to the second resource conversion rate. Then, in response to the third time point being equal to the second time point, the second time point is determined as the sending time of the transaction request for the first cumulative transaction volume. Alternatively, in response to the third time point being earlier than the second time point, the sending time of the transaction request for the first cumulative transaction volume is determined based on the first resource conversion rate and the second resource conversion rate at the third time point.
[0141] In other words, if the first resource conversion rate is greater than or equal to the second resource conversion rate, for the third time after the current time (i.e., the next time after the current time), if the next time is equal to the second time, then the transaction request for the first accumulated transaction volume is sent at the next time. If the first time is earlier than the second time (i.e., the next time has not yet reached the second time), then the first resource conversion rate and the second resource conversion rate of the next time are used again to determine the sending time of the transaction request for the first accumulated transaction volume. The process of determining the sending time of the transaction request for the first accumulated transaction volume at the next time is the same as the process of determining the sending time of the transaction request for the first accumulated transaction volume at the current time.
[0142] In this embodiment of the application, if the first resource conversion rate is greater than or equal to the second resource conversion rate, it means that the transaction cost at the current moment is higher than the market price level. Since the trend is determined to be downward in step S205, it is chosen to continue accumulating order delays and wait for the judgment at the next moment, thereby ensuring the minimization of transaction costs.
[0143] In step S207, in response to the upward trend, the server determines the sending time of the transaction request for the first cumulative transaction volume as the current time; or, determines the sending time of the transaction request for the first cumulative transaction volume as any time between the current time and the second time.
[0144] Here, if the trend is upward, it indicates that sending a transaction request at the current moment will have the lowest transaction cost; therefore, the sending time for the transaction request targeting the first cumulative transaction volume is determined to be the current moment. Alternatively, if the trend is upward, it indicates that sending a transaction request at any moment between the current moment and the second moment will have the lowest transaction cost; therefore, the sending time for the transaction request targeting the first cumulative transaction volume is determined to be any moment between the current moment and the second moment. This also ensures the minimization of transaction costs.
[0145] In step S208, at the sending time, the server sends a transaction request for the first cumulative transaction volume to the resource trading platform.
[0146] In some embodiments, see Figure 7 , Figure 7 The step S208, which involves sending a transaction request for the first cumulative transaction volume to the resource trading platform at the sending time, can be achieved through the following steps S2081 to S2084:
[0147] Step S2081: In response to the arrival of the sending time, obtain the second cumulative transaction volume between the current time and the sending time.
[0148] In this embodiment of the application, since transaction services can be generated and received, transaction services can also be received between the current time and the sending time. Therefore, it is also necessary to send the transaction services between the current time and the sending time to the resource trading platform.
[0149] Step S2082: Determine the total cumulative transaction volume of the first cumulative transaction volume and the second cumulative transaction volume.
[0150] Here, the sum of the first and second cumulative transaction volumes can be calculated to obtain the total cumulative transaction volume.
[0151] Step S2083: Generate a business request for the total cumulative transaction volume; the transaction request includes the cumulative transaction resource quantity for the total cumulative transaction volume.
[0152] A business request is used to request the resource trading platform to process transactions based on the total cumulative transaction volume. The cumulative transaction resource quantity refers to the total number of resources that need to be traded within the total cumulative transaction volume. The cumulative transaction resource quantity can also be the cumulative transaction amount. For example, the total cumulative transaction volume could be 10,000. The transaction amount for each of the 10,000 transactions can be the same or different. Summing the transaction amounts of these 10,000 transactions yields the cumulative transaction resource quantity.
[0153] Step S2084: Send a transaction request for the total cumulative transaction volume to the resource trading platform.
[0154] In this embodiment of the application, at the sending time, a transaction request for the first cumulative transaction volume is sent to the resource trading platform. This sending time is a determined time that has the lowest transaction cost. Therefore, sending the transaction request for the first cumulative transaction volume to the resource trading platform at the sending time can send the transaction request to the resource trading platform at the sending time with the lowest transaction cost, thereby greatly reducing the transaction cost.
[0155] In step S209, the resource trading platform responds to the transaction request by responding to the transaction business of the first cumulative transaction volume and obtaining the business response result of each transaction business.
[0156] In step S210, the resource trading platform sends the business response result to the server.
[0157] The transaction processing method provided in this application, when processing transactions in a foreign exchange purchase scenario, involves the server first acquiring a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value for the target currency pair at a first moment, and a second resource conversion rate difference value for the target currency pair at the current moment. Then, based on the first and second resource conversion rate difference values, the server determines the trend of the resource conversion rate of the target currency pair from the current moment to the second moment. Based on this trend and the first and second resource conversion rates of different platforms at the current moment, the server determines the optimal time to send a transaction request for the first cumulative transaction volume. The server then sends the transaction request for the first cumulative transaction volume to the resource trading platform at this optimal time, ensuring the lowest transaction cost. This significantly reduces transaction costs in foreign exchange purchase scenarios.
[0158] The following will use the above-mentioned foreign exchange settlement scenario as an example, that is, the case where the transaction business is the sale of the target transaction currency, to illustrate the transaction business processing method provided in the embodiments of this application. Figure 8 This is another optional flowchart illustrating the transaction processing method provided in the embodiments of this application, such as... Figure 8 As shown, the method includes the following steps S501 to S510:
[0159] In step S501, the terminal responds to the user's target currency sale operation and generates a transaction.
[0160] In step S502, the terminal sends the transaction information to the server.
[0161] Step S503: The server obtains the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at the first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment.
[0162] Step S504: Based on the first resource conversion rate difference value and the second resource conversion rate difference value, the server determines the trend of the resource conversion rate of the target trading currency pair from the current time to the second time.
[0163] In step S505, the server responds to the upward trend by obtaining the first resource conversion rate between the target currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target currency pairs published by the trading control platform at the current moment.
[0164] In some embodiments, obtaining the first resource conversion rate between target trading currency pairs published by the target resource trading platform at the current time and the second resource conversion rate between target trading currency pairs published by the trading control platform at the current time in step S505 may be obtained from the first database and the second resource conversion rate between target trading currency pairs published by the trading control platform at the current time.
[0165] Step S506: The server determines the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate.
[0166] In this embodiment of the application, the sending time of the transaction request for the first cumulative transaction volume is determined based on the first resource conversion rate and the second resource conversion rate. This can be achieved by first determining the magnitude relationship between the first resource conversion rate and the second resource conversion rate, and then determining the sending time of the transaction request for the first cumulative transaction volume based on the different magnitude relationships between the first resource conversion rate and the second resource conversion rate.
[0167] In one implementation where the first resource conversion rate is greater than or equal to the second resource conversion rate, determining the sending time of the transaction request for the first cumulative transaction volume can be done in response to the first resource conversion rate being greater than or equal to the second resource conversion rate, by setting the sending time of the transaction request for the first cumulative transaction volume to the current time. In other words, if it is determined that the first resource conversion rate is greater than or equal to the second resource conversion rate, the current time is determined as the sending time of the transaction request for the first cumulative transaction volume.
[0168] In another implementation where the first resource conversion rate is greater than or equal to the second resource conversion rate, determining the sending time of the transaction request for the first cumulative transaction volume can be done in response to the first resource conversion rate being greater than or equal to the second resource conversion rate. In other words, when it is determined that the first resource conversion rate is greater than or equal to the second resource conversion rate, any time between the current time and the second time is determined as the sending time of the transaction request for the first cumulative transaction volume.
[0169] In the case where the first resource conversion rate is less than the second resource conversion rate, determining the sending time of the transaction request for the first cumulative transaction volume can be achieved by first obtaining the first resource conversion rate and the second resource conversion rate at a third time point, where the third time point is later than the current time point; then, in response to the third time point being equal to the second time point, determining the second time point as the sending time of the transaction request for the first cumulative transaction volume; or, in response to the third time point being earlier than the second time point, determining the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate at the third time point.
[0170] In other words, if the first resource conversion rate is less than the second resource conversion rate, for the third time after the current time (i.e., the next time after the current time), if the next time is equal to the second time, then the transaction request for the first accumulated transaction volume is sent at the next time. If the first time is earlier than the second time (i.e., the next time has not yet reached the second time), then the first resource conversion rate and the second resource conversion rate of the next time are used again to determine the sending time of the transaction request for the first accumulated transaction volume. The process of determining the sending time of the transaction request for the first accumulated transaction volume at the next time is the same as the process of determining the sending time of the transaction request for the first accumulated transaction volume at the current time.
[0171] In step S507, in response to the decreasing trend, the server determines the sending time of the transaction request for the first cumulative transaction volume as the current time; or, determines the sending time of the transaction request for the first cumulative transaction volume as any time between the current time and the second time.
[0172] In step S508, at the sending time, the server sends a transaction request for the first cumulative transaction volume to the resource trading platform.
[0173] In step S509, the resource trading platform responds to the transaction request by responding to the transaction business of the first cumulative transaction volume and obtaining the business response result of each transaction business.
[0174] In step S510, the resource trading platform sends the business response result to the server.
[0175] The transaction processing method provided in this application, when processing transactions in a foreign exchange settlement scenario, involves the server first acquiring a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value for the target currency pair at a first moment, and a second resource conversion rate difference value for the target currency pair at the current moment. Then, based on the first and second resource conversion rate difference values, the server determines the trend of the resource conversion rate of the target currency pair from the current moment to the second moment. Based on this trend and the first and second resource conversion rates of different platforms at the current moment, the server determines the optimal time to send a transaction request for the first cumulative transaction volume. The server then sends the transaction request for the first cumulative transaction volume to the resource trading platform at this optimal time, ensuring the lowest transaction cost. This significantly reduces transaction costs in foreign exchange settlement scenarios.
[0176] In some embodiments, after sending a transaction request for the first cumulative transaction volume to the resource trading platform, the predicted cumulative transaction volume for a target time period can be predicted, thereby purchasing the target trading currency corresponding to the predicted cumulative transaction volume in advance. That is, the transaction processing method provided in this application embodiment can also predict the transaction volume for a future time period, thereby responding to the user's transaction requests based on the pre-purchased target trading currency. Figure 9 As shown, the process includes the following steps S601 to S604:
[0177] Step S601: Based on the cumulative transaction volume within a specific historical time period, the server determines the predicted cumulative transaction volume for the target time period at the target time.
[0178] Here, the target time period is later than the second time period. The cumulative transaction volume within a specific historical time period can be collected, and then, based on that cumulative transaction volume, the predicted cumulative transaction volume for the target time period can be predicted. Embodiments of this application can select different models to determine this predicted cumulative transaction volume. For example, a time series model, a regression analysis model, or a machine learning model can be selected.
[0179] If the cumulative transaction volume within a specific historical period exhibits a clear time trend and periodicity, time series analysis methods can be used to predict the cumulative transaction volume for the target period using time series models, such as the ARIMA model. The ARIMA model analyzes the patterns of change in cumulative transaction volume over a specific historical period to identify data variation models (such as moving averages or periodic components), thereby enabling the prediction of the cumulative transaction volume.
[0180] If the combined effects of multiple influencing factors on transaction volume need to be considered, regression analysis can be used to predict the cumulative transaction volume for a target time period through a regression analysis model, such as using multiple linear regression. By establishing a mathematical model between independent variables (such as advertising investment, promotional activities, price changes, etc.) and transaction volume, the cumulative transaction volume for the target time period can be predicted.
[0181] For more complex data relationships, machine learning models such as support vector machines (SVM) or artificial neural networks can be used. These models are capable of handling large amounts of data and automatically identifying complex relationships between variables, thereby building more accurate predictive models.
[0182] In step S602, the server sends a transaction request to the resource trading platform at the target time, predicting the cumulative transaction volume.
[0183] This transaction request is used to request that the transaction business with the predicted cumulative transaction volume be processed in advance.
[0184] Step S603: The server receives the transaction result returned by the resource trading platform in response to the transaction request.
[0185] Step S604: Based on the transaction results, the server responds to the real-time received transaction requests within the target time period.
[0186] In this embodiment of the application, after sending a transaction request for the first cumulative transaction volume to the resource trading platform, the target transaction currency corresponding to the predicted cumulative transaction volume for the target time period is purchased in advance by predicting the predicted cumulative transaction volume for the target time period. In this way, costs can be locked in in advance, avoiding high transaction costs from transactions received in real time within the target time period, thereby enabling the third-party payment institution to obtain greater resource returns.
[0187] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0188] This application proposes a cost optimization system that generates exchange rate trend trading signals based on offshore price differences, thereby enabling timed transaction sending. Specifically, this application introduces different data components to process market information with corresponding characteristics, performs data statistics and analysis on the offshore price difference at specific opening and closing times, generates and publishes trading strategy signals, and guides the order trading system to send the customer's cumulative transaction orders (i.e., the first cumulative transaction volume) at the closing time when the price is more favorable, thereby achieving the goal of reducing transaction costs for third-party payment institutions. It should be noted that this application is a back-end service and can be applied at least to back-end systems for trading currencies in other regions, or to various scenarios where trading systems guide transaction timing to optimize costs.
[0189] This explanation uses the back-end system of a currency trading platform in another region as an example. For instance... Figure 10 The diagram shown illustrates the time-slot distribution of the transaction processing method provided in this application embodiment. Third-party payment institutions support accepting transaction orders (i.e., transaction services) from customers in other regional currencies 24 hours a day. Upon receiving a transaction order, the transaction batch processing performs the following different processing steps based on the current time:
[0190] Between 9:15 and 16:30, after receiving a transaction order, the third-party payment institution will immediately send it to the resource trading platform for execution at the market price. Between 16:30 and 7:00 the next day, after receiving a transaction order, the third-party payment institution will wait for the market to open the next day because the market exchange rate has not been updated and the price liquidity is poor. Between 7:00 and 9:15 the next day, the third-party payment institution will predict the price trend of the currency being traded at the current location on the onshore market based on changes in the offshore price difference to decide whether to send the overnight accumulated transaction orders immediately or delay their sending.
[0191] The main feature of this application's embodiment is the timing of sending transactions during the specified time period (i.e., Figure 10 The time period from 7:00 AM to 9:15 AM the following day is described here, focusing primarily on the details of the timing of the transaction. The real-time sending and accumulated transaction order periods are fixed behaviors and are omitted from the description. Therefore, the solution of this application embodiment lies in making trend judgments based on market information and generating trading signals to guide the timing of transaction sending.
[0192] Figure 11 This is a system architecture diagram of the transaction processing method provided in the embodiments of this application, such as... Figure 11 As shown in the diagram, there are two core modules: the transaction sending batch processing module 1101 and the transaction signal module 1102. The division of responsibilities between the two modules is described below.
[0193] The core processes related to the transaction sending batch processing module 1101 are twofold: reading signals and sending transactions. The transaction sending batch processing module 1101 determines whether to send transactions immediately or with a delay based on the signals obtained from the transaction signal module 1102.
[0194] The specific implementation of the trading timing signal strategy in this embodiment is accomplished by the trading signal module 1102. The responsibility of the trading signal module 1102 is to sense market information and generate corresponding signals for the caller based on the specific strategy. The market information involved in this embodiment falls into two main categories: domestic exchange rates and fair exchange rates (real-time / historical). It is worth noting that the system design requires selecting appropriate components to complete the integration based on the characteristics of different market data.
[0195] For domestic real-time exchange rates: The domestic exchange rate module 1103 updates every minute, which is relatively slow and has a small number of data points. It can be stored directly using a relational database such as MySQL (i.e., the first database mentioned above).
[0196] For fair exchange rates: The fair exchange rate module 1104 updates several times per second, with a high frequency and large volume, so a message queue can be used to handle this traffic. Real-time exchange rates are written to a non-relational database such as Redis (i.e., the second database mentioned above) through overlay operations, ensuring concurrent writing and reading of individual data entries. The historical exchange rate module 1105 writes historical exchange rates to a big data warehouse such as ClickHouse through message queue subscriptions, facilitating the storage and analysis of massive amounts of data.
[0197] Figure 12 This is a timing diagram of the transaction processing method provided in the embodiments of this application, such as... Figure 12 As shown, the timing diagram is mainly divided into three parts:
[0198] Part 1, Exchange Rate Storage 1201: The front-end machine of the target resource trading platform at the current location retrieves the exchange rate (i.e., the first resource conversion rate between the target trading currency pairs) from the target resource trading platform through a minute-level scheduled task (i.e., the aforementioned periodic scheduled task), and writes the retrieved exchange rate into the MySQL database.
[0199] The second part, Fair Exchange Rate Storage 1202: The fair exchange rate front-end subscribes to the market's second-level exchange rate from the market maker (i.e., the aforementioned trading control platform) and receives second-level pushes to Kafka; upon receiving the fair exchange rate, it updates the latest snapshot to Redis in real time to facilitate obtaining the latest market fair exchange rate. The asynchronous link subscribes to Kafka topics (i.e., calls periodic subscription tasks) and uses Flink tasks to persist data to ClickHouse, completing the collection of historical data.
[0200] Part Three, Trading Timing 1203: The trading batch sending module 1101 can perform batch sending of trading requests between 7:00-9:15 every day, and requests the trading signal module 1102 to read signals. The trading signal module 1102 obtains market information, obtains the latest quoted price through the onshore quoted price module 1103, obtains the latest fair exchange rate through the fair exchange rate module 1104, and obtains the fair exchange rate at a historically specified time through the historical exchange rate module 1105. Then, strategy analysis is performed according to the source data, and offshore data is output to judge price trends and generate trading signals. The specific process is as follows:
[0201] First, the onshore-offshore spread calculation formula is given as the following formula (1):
[0202]
[0203] Within the time period for timing sending of trades, according to the Figure 13 logic shown to judge the price trend:
[0204] Step S1301: Obtain the onshore-offshore spread a at 3 o'clock (that is, the closing time of the previous trading day) and the onshore-offshore spread b at the real-time moment.
[0205] Step S1302: Determine the magnitude relationship between a and b.
[0206] If b<a, it can be known from reference to formula (1) that since the overnight USDCNY price remains unchanged, the overnight USDCNH rises. If USDCNY returns to the market price after the market opens, the resource conversion rate shows an upward trend. Therefore, it is selected to send the trade immediately, and the trading cost is lower than that after the market opens.
[0207] If b≥a, it can be known from reference to formula (1) that since the overnight USDCNY price remains unchanged, the overnight USDCNH falls. If USDCNY returns to the market price after the market opens, the resource conversion rate shows a downward trend, and step S1303 is performed at this time for new analysis.
[0208] Step S1303: Obtain the onshore quoted price x and the fair exchange rate y at the real-time moment.
[0209] Here, x is the trading cost at this moment, and y is the market exchange rate level at this moment.
[0210] Step S1304: Determine the magnitude relationship between x and y.
[0211] If x<y, it indicates that the current trading cost is lower than the market price level, so it is selected to send the trade immediately.
[0212] If x >= y, it means that the transaction cost is higher than the market price level. Due to the downward trend in step S1302, it is chosen to continue accumulating transaction orders and delay sending them, waiting for the judgment at the next moment (i.e., the third moment).
[0213] In some embodiments, the resource trading platform is closed during weekends or holidays (i.e., the target time period mentioned above). However, users can still use third-party payment institutions to purchase goods from other regions during the target time period, meaning they can still place orders. Regarding these orders, the third-party payment institution can predict the transaction volume in advance for the target time period. When making predictions, the cumulative transaction volume for the target time period can be predicted based on the cumulative transaction volume over a specific historical period. For example, if the predicted weekend transaction volume is 100 million, then 100 million units of other region trading currencies can be purchased in advance. In this case, there is no need to pay attention to the trend on Monday, the current cost price is locked in, and the purchase of other region trading currencies is directly based on the resource conversion rate between the target trading currency pairs at the current moment.
[0214] The transaction processing method provided in this application introduces market information data for quantitative analysis. By using the signal of changes in the price difference between offshore target trading currencies, the opening price trend of the onshore trading currency at the current location is predicted to help third-party payment institutions decide when to purchase foreign exchange. Specifically, foreign exchange is purchased in advance when the exchange rate trend is rising and appropriately delayed when the exchange rate trend is falling, so as to reduce the foreign exchange transaction costs of third-party payment institutions.
[0215] It should be noted that the solution provided in this application embodiment can not only be applied to the direction of foreign exchange purchase, but also to the direction of foreign exchange settlement. By reversing the judgment of the direction of foreign exchange purchase, the same trend judgment solution can be improved.
[0216] It is understood that in the embodiments of this application, if the content involves user information, such as transaction volume data, and if it involves data related to user information or enterprise information, when the embodiments of this application are applied to specific products or technologies, it is necessary to obtain user permission or consent, or to obfuscate this information to eliminate the correspondence between this information and the user; and the collection and processing of related data should strictly comply with the requirements of relevant national laws and regulations when applied in practice, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0217] The following continues to describe the exemplary structure of the transaction processing device 354 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2As shown, the transaction processing device 354 includes: a first acquisition module 3541, used to acquire a first cumulative transaction volume within a preset time period, a first resource conversion rate difference value of a target trading currency pair at a first moment, and a second resource conversion rate difference value of the target trading currency pair at the current moment; the first moment is within the preset time period; a first determination module 3542, used to determine the trend of resource conversion rate change of the target trading currency pair from the current moment to a second moment based on the first resource conversion rate difference value and the second resource conversion rate difference value; the second moment is later than the current moment; a second acquisition module 3543, used to acquire, in response to the trend being a target trend, the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the transaction control platform at the current moment; a second determination module 3544, used to determine the sending time of a transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate; and a sending module 3545, used to send the transaction request for the first cumulative transaction volume to the resource trading platform at the sending time.
[0218] In some embodiments, the second determining module 3544 is further configured to: determine the sending time of the transaction request for the first cumulative transaction volume as the current time in response to the first resource conversion rate being less than the second resource conversion rate; or, determine the sending time of the transaction request for the first cumulative transaction volume as any time between the current time and the second time in response to the first resource conversion rate being less than the second resource conversion rate.
[0219] In some embodiments, the second determining module 3544 is further configured to: in response to the first resource conversion rate being greater than or equal to the second resource conversion rate, obtain the first resource conversion rate and the second resource conversion rate at a third time point; the third time point being later than the current time point; in response to the third time point being equal to the second time point, determine the second time point as the time for sending a transaction request for the first cumulative transaction volume; in response to the third time point being earlier than the second time point, determine the time for sending a transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate at the third time point.
[0220] In some embodiments, when the transaction involves purchasing the target currency, the target trend is a downward trend; when the transaction involves selling the target currency, the target trend is an upward trend.
[0221] In some embodiments, the second determining module 3544 is further configured to: when the transaction business is to purchase the target transaction currency, in response to the upward trend of the change, determine the sending time of the transaction request for the first cumulative transaction volume as the current time; the sending module is further configured to: at the current time, send the transaction request for the first cumulative transaction volume to the resource trading platform.
[0222] In some embodiments, the second determining module 3544 is further configured to: when the transaction business is to purchase the target transaction currency, in response to the upward trend of the change, determine that the time for sending the transaction request for the first cumulative transaction volume is any time between the current time and the second time; the sending module is further configured to: at the sending time, send the transaction request for the first cumulative transaction volume to the resource trading platform.
[0223] In some embodiments, the sending module 3545 is further configured to: in response to the arrival of the sending time, obtain a second cumulative transaction volume between the current time and the sending time; determine the total cumulative transaction volume of the first cumulative transaction volume and the second cumulative transaction volume; generate a service request for the total cumulative transaction volume; the service request includes the cumulative number of transaction resources of the total cumulative transaction volume; and send the service request for the total cumulative transaction volume to the resource trading platform.
[0224] In some embodiments, the second acquisition module 3544 is further configured to: acquire from the first database the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current time; and acquire from the second database the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current time.
[0225] In some embodiments, the apparatus further includes: a first database processing module, configured to invoke a periodic scheduled task to obtain a first resource conversion rate between the target trading currency pairs published by the resource trading platform; the periodic scheduled task carries a first timestamp; and the obtained first resource conversion rate is mapped to the first timestamp and stored in the first database.
[0226] In some embodiments, the apparatus further includes: a second database processing module, configured to invoke a periodic subscription task to obtain a second resource conversion rate between the target trading currency pairs published by the trading control platform; the periodic subscription task carries a second timestamp; and the obtained second resource conversion rate is mapped to the second timestamp and stored in the second database.
[0227] In some embodiments, the apparatus further includes: a transaction volume accumulation module, configured to, in response to the current time being within the preset time period, acquire the transaction volume at the current time before acquiring the first accumulated transaction volume within the preset time period; and aggregate the transaction volume at the current time into the first accumulated transaction volume.
[0228] In some embodiments, the apparatus further includes: a transaction module, configured to, in response to the current time being later than the second time and the current time not being within the preset time period, acquire the transaction business at the current time before acquiring the first cumulative transaction business volume within a preset time period; and send a transaction request for the transaction business at the current time to the resource trading platform.
[0229] In some embodiments, the first acquisition module 3541 is further configured to: acquire a first onshore resource conversion rate and a first offshore resource conversion rate of the target trading currency pair at the first time point, and acquire a second onshore resource conversion rate and a second offshore resource conversion rate of the target trading currency pair at the current time point; determine a first resource conversion rate difference value based on the first onshore resource conversion rate and the first offshore resource conversion rate; and determine a second resource conversion rate difference value based on the second onshore resource conversion rate and the second offshore resource conversion rate.
[0230] In some embodiments, the apparatus further includes: a transaction processing module, configured to, after sending a transaction request for the first cumulative transaction volume to the resource trading platform, determine a predicted cumulative transaction volume for a target time period based on the cumulative transaction volume within a specific historical time period; the target time period is later than the second time period; send a transaction request for the predicted cumulative transaction volume to the resource trading platform at the target time period, and receive a transaction result returned by the resource trading platform in response to the transaction request; and, based on the transaction result, perform a business response to the real-time received transaction business within the target time period.
[0231] It should be noted that the description of the apparatus in this application embodiment is similar to the description of the method embodiment described above, and has similar beneficial effects as the method embodiment; therefore, it will not be repeated. For technical details not disclosed in this apparatus embodiment, please refer to the description of the method embodiment of this application for understanding.
[0232] This application provides a computer program product including executable instructions, which are computer instructions stored in a computer-readable storage medium. When the processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the electronic device performs the method described in this application.
[0233] This application provides a storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the method provided in this application, for example... Figure 3 The method is illustrated. In some embodiments, the storage medium may be a computer-readable storage medium, such as a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or a compact disk-read-only memory (CD-ROM); or it may be a device that includes one or any combination of the above-mentioned memories.
[0234] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0235] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file containing other programs or data, for example, in one or more scripts within a Hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., files storing one or more modules, subroutines, or code sections). As an example, executable instructions may be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0236] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A transaction processing method, characterized in that, The method includes: Obtain the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at the first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment; the first moment is within the preset time period; Based on the first resource conversion rate difference value and the second resource conversion rate difference value, determine the trend of the resource conversion rate of the target trading currency pair from the current time to the second time; the second time is later than the current time. In response to the changing trend being the target changing trend, the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment are obtained. Based on the first resource conversion rate and the second resource conversion rate, determine the sending time of the transaction request for the first cumulative transaction volume; At the specified sending time, a transaction request for the first accumulated transaction volume is sent to the resource trading platform.
2. The method according to claim 1, characterized in that, Determining the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate includes: In response to the first resource conversion rate being less than the second resource conversion rate, the sending time of the transaction request for the first cumulative transaction volume is determined as the current time; or, In response to the first resource conversion rate being less than the second resource conversion rate, the sending time of the transaction request for the first cumulative transaction volume is determined to be any time between the current time and the second time.
3. The method according to claim 1, characterized in that, Determining the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate includes: In response to the first resource conversion rate being greater than or equal to the second resource conversion rate, the first resource conversion rate and the second resource conversion rate at the third time point are obtained; the third time point is later than the current time point. In response to the third time being equal to the second time, the second time is determined as the time when the transaction request for the first accumulated transaction volume is sent; In response to the fact that the third time point is earlier than the second time point, the sending time of the transaction request for the first cumulative transaction volume is determined based on the first resource conversion rate and the second resource conversion rate at the third time point.
4. The method according to claim 1, characterized in that, When the transaction involves purchasing the target currency, the target trend is downward. When the transaction involves selling the target currency, the target trend is an upward trend.
5. The method according to claim 4, characterized in that, When the transaction involves purchasing the target cryptocurrency, the method further includes: In response to the upward trend of the change, the sending time of the transaction request for the first cumulative transaction volume is determined as the current time; At the current moment, a transaction request for the first accumulated transaction volume is sent to the resource trading platform.
6. The method according to claim 4, characterized in that, When the transaction involves purchasing the target cryptocurrency, the method further includes: In response to the upward trend of the change, the time of sending the transaction request for the first cumulative transaction volume is determined to be any time between the current time and the second time. At the specified sending time, a transaction request for the first accumulated transaction volume is sent to the resource trading platform.
7. The method according to claim 1, characterized in that, Sending a transaction request for the first accumulated transaction volume to the resource trading platform at the sending time includes: In response to the arrival of the sending time, the second cumulative transaction volume between the current time and the sending time is obtained; Determine the total cumulative transaction volume of the first cumulative transaction volume and the second cumulative transaction volume; A business request is generated to generate the total cumulative transaction volume; the transaction request includes the cumulative transaction resource quantity of the total cumulative transaction volume; Send a transaction request for the total cumulative transaction volume to the resource trading platform.
8. The method according to claim 1, characterized in that, The acquisition of the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment, includes: Obtain the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment from the first database; Obtain the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment from the second database.
9. The method according to claim 8, characterized in that, The method further includes: A periodic scheduled task is invoked to obtain the first resource conversion rate between the target trading currency pairs published by the resource trading platform; the periodic scheduled task carries a first timestamp. The obtained first resource conversion rate is mapped to the first timestamp and then stored in the first database.
10. The method according to claim 8, characterized in that, The method further includes: A periodic subscription task is invoked to obtain the second resource conversion rate between the target trading currency pairs published by the trading control platform; the periodic subscription task carries a second timestamp; The obtained second resource conversion rate is mapped to the second timestamp and then stored in the second database.
11. The method according to any one of claims 1 to 10, characterized in that, Before obtaining the first cumulative transaction volume within a preset time period, the method further includes: In response to the fact that the current time is within the preset time period, the transaction volume at the current time is obtained; The transaction volume at the current moment is aggregated into the first cumulative transaction volume.
12. The method according to any one of claims 1 to 10, characterized in that, Before obtaining the first cumulative transaction volume within a preset time period, the method further includes: In response to the current time being later than the second time and the current time not being within the preset time period, the transaction business at the current time is obtained; Send a transaction request for the current transaction to the resource trading platform.
13. The method according to any one of claims 1 to 10, characterized in that, Obtaining the first resource conversion rate difference value of the target trading currency pair at the first moment and the second resource conversion rate difference value of the target trading currency pair at the current moment includes: Obtain the first onshore resource conversion rate and the first offshore resource conversion rate of the target transaction currency pair at the first time point, and obtain the second onshore resource conversion rate and the second offshore resource conversion rate of the target transaction currency pair at the current time point; Based on the first onshore resource conversion rate and the first offshore resource conversion rate, determine the difference value of the first resource conversion rate; The difference value of the second resource conversion rate is determined based on the second onshore resource conversion rate and the second offshore resource conversion rate.
14. The method according to any one of claims 1 to 10, characterized in that, After sending a transaction request for the first accumulated transaction volume to the resource trading platform, the method further includes: Based on the cumulative transaction volume within a specific historical period, the predicted cumulative transaction volume for the target period is determined at the target time; the target period is later than the second time. At the target time, a transaction request for the predicted cumulative transaction volume is sent to the resource trading platform, and the transaction result returned by the resource trading platform in response to the transaction request is received. Based on the transaction results, a business response is provided to the real-time received transaction services within the target time period.
15. A transaction processing device, characterized in that, The device includes: The first acquisition module is used to acquire the first cumulative transaction volume within a preset time period, the first resource conversion rate difference value of the target trading currency pair at a first moment, and the second resource conversion rate difference value of the target trading currency pair at the current moment; the first moment is within the preset time period; The first determining module is used to determine the trend of the resource conversion rate of the target trading currency pair from the current time to the second time based on the first resource conversion rate difference value and the second resource conversion rate difference value; the second time is later than the current time. The second acquisition module is used to, in response to the change trend being the target change trend, acquire the first resource conversion rate between the target trading currency pairs published by the target resource trading platform at the current moment, and the second resource conversion rate between the target trading currency pairs published by the trading control platform at the current moment; The second determining module is used to determine the sending time of the transaction request for the first cumulative transaction volume based on the first resource conversion rate and the second resource conversion rate. The sending module is used to send a transaction request for the first accumulated transaction volume to the resource trading platform at the sending time.
16. An electronic device, characterized in that, include: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the transaction processing method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions or computer programs, which, when executed by a processor, implement the transaction processing method according to any one of claims 1 to 14.
18. A computer program product, characterized in that, It includes computer-executable instructions or computer programs, which, when executed by a processor, implement the transaction processing method according to any one of claims 1 to 14.