An efficient foreign exchange order matching method and system

By using two price queues to alternately receive and process real-time exchange rates in the foreign exchange order system, the problems of bank losses caused by queue congestion and price deviations are solved, achieving efficient order matching and bank profit protection.

CN115730940BActive Publication Date: 2025-11-18CHINA CITIC BANK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211548386.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-05
Publication Date
2025-11-18
Estimated Expiration
2042-12-05

AI Technical Summary

Technical Problem

Existing foreign exchange order systems are prone to congestion during exchange rate queue processing, leading to memory overflows and potential bank losses during market price fluctuations.

Method used

Two price queues are used to alternately receive real-time exchange rates and alternately perform order matching. The system quickly matches orders by calculating the relationship between the customer's preset price and the exchange rate range, thus avoiding queue congestion.

Benefits of technology

It realizes the exchange rate in the fast-moving consumer price queue, avoids the link congestion problem, and reduces bank losses caused by insufficient price timeliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730940B_ABST
    Figure CN115730940B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of efficient foreign exchange order transaction matching method and system, comprising: setting two price queues, including first price queue and second price queue, real-time exchange rate issued by alternate receiving offer engine;Based on the price queue of current receiving offer engine, order matching transaction is executed.Two price receiving queues, one receives price, and one participates in matching.Real-time exchange rate is received and consumed in asynchronous mode, while ensuring that price issued by offer engine is not missed, the problem of price queue accumulation caused by not timely consumption is avoided.The present application can quickly consume the exchange rate in price queue, complete order to price matching action, avoid the link jam problem caused by queue accumulation.And reduce the bank loss caused by the lack of price timeliness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, and in particular to an efficient method and system for matching foreign exchange pending orders. Background Technology

[0002] Banks offer foreign exchange pending order trading services to retail customers. Customers can preset their target price, order deadline, and transaction amount. If the real-time exchange rate meets the customer's preset price within the order deadline, the transaction will be automatically executed, reducing the customer's time spent monitoring the market.

[0003] However, in the existing system, the exchange rate issued by the pricing engine is first stored in a price queue. Then, it is retrieved sequentially from the queue and compared with the customer's preset exchange rate for each pending order. If the rate matches or is better than the customer's preset price, the order is executed, and a credit operation in one currency and a credit operation in the other currency are performed to the customer's account. When the production in the price queue far exceeds consumption, it can cause congestion in the supply chain, potentially leading to memory overflow. Furthermore, using only one exchange rate from the price queue to match each pending order can lead to problems when market prices fluctuate rapidly. The exchange rate retrieved from the price queue for matching may have deviated from the latest market price. Executing the pending order at this point could result in losses for the bank. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention proposes an efficient foreign exchange order matching method and system that can quickly consume exchange rates in the price queue and complete the order matching process, thus avoiding the link congestion problem caused by queue accumulation.

[0005] To achieve the above objectives, the technical solution adopted by the present invention includes:

[0006] An efficient method for matching pending foreign exchange orders includes:

[0007] S1. Set up two price queues, including a first price queue and a second price queue, to alternately receive real-time exchange rates issued by the pricing engine;

[0008] S2. Execute pending order matching transactions based on the price queue of the current receiving quote engine.

[0009] Furthermore, step S1 includes repeatedly executing sub-steps S11-S15;

[0010] S11. The first price queue receives the real-time exchange rate issued by the quotation engine, while the second price queue is in a sleep state.

[0011] S12, the matching thread consumes the prices in the first price queue, and the first price queue no longer receives the real-time exchange rate issued by the quotation engine; the second price queue receives the real-time exchange rate issued by the quotation engine.

[0012] S13. After the matching thread consumes all the prices in the first price queue, it clears the first price queue and puts the first price queue into a sleep state.

[0013] S14. The matching thread consumes the prices in the second price queue, and the second price queue no longer receives the real-time exchange rate issued by the quotation engine; the first price queue receives the real-time exchange rate issued by the quotation engine.

[0014] S15. After the matching thread has consumed all the prices in the second price queue, it clears the second price queue.

[0015] Further, step S2 includes the following sub-steps:

[0016] S21. Obtain the customer's preset target price;

[0017] S22. Calculate the lowest and highest real-time exchange rates in the price queue of the current receiving quote engine, which are the exchange rate ranges;

[0018] S23. Determine the relationship between the customer's preset target price and the exchange rate range;

[0019] S24. If the customer's preset target price is within the exchange rate range, then set the order corresponding to the customer's preset target price as the arrival price.

[0020] S25. If the customer's preset target price is greater than the highest price in the current price queue of the receiving quote engine, then the order corresponding to the customer's preset target price will be set to the target price.

[0021] S26. If the customer's preset target price is less than the lowest price in the current price queue of the receiving quote engine, then the order corresponding to the customer's preset target price will be set as an undelivered price.

[0022] This invention also relates to a highly efficient foreign exchange order matching system, comprising:

[0023] The real-time exchange rate receiving module is used to set up two price queues, including a first price queue and a second price queue, to alternately receive the real-time exchange rate issued by the quotation engine;

[0024] The order matching module is used to execute order matching transactions based on the price queue of the currently receiving quote engine.

[0025] Furthermore, it also includes:

[0026] The price comparison module is used to determine the relationship between the customer's preset target price and the exchange rate range.

[0027] The present invention also relates to a computer-readable storage medium, characterized in that the storage medium stores a computer program, which, when executed by a processor, implements the above-described efficient foreign exchange order matching method.

[0028] The present invention also relates to an electronic device, characterized in that it includes a processor and a memory;

[0029] The memory is used to store the price queue and the customer's preset target price;

[0030] The processor is used to execute the aforementioned efficient foreign exchange order matching method by calling the stored price queue and the customer's preset target price.

[0031] The present invention also relates to a computer program product, including a computer program and / or instructions, characterized in that, when the computer program and / or instructions are executed by a processor, they implement the steps of the above-described efficient foreign exchange order matching method.

[0032] The beneficial effects of this invention are as follows:

[0033] This invention employs a highly efficient foreign exchange order matching method and system. By setting up two price queues—a first price queue and a second price queue—they alternately receive real-time exchange rates from a quoting engine. Order matching is then executed based on the currently receiving price queue. For customers with non-urgent foreign exchange needs, banks offer foreign exchange order matching services. Customers pre-set an exchange rate better than the current price, and the bank system handles the matching process. Within a specified matching period, if the exchange rate fluctuation reaches the customer's preset price, the bank system automatically completes the foreign exchange transaction. This efficient foreign exchange order matching method and system can quickly consume exchange rates in the price queue, completing the order matching action and avoiding congestion caused by queue accumulation. Furthermore, it reduces bank losses due to insufficient price timeliness. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of a highly efficient foreign exchange order matching method according to the present invention.

[0035] Figure 2 This is a schematic diagram illustrating an embodiment of an efficient foreign exchange order matching method according to the present invention.

[0036] Figure 3 This is a schematic diagram illustrating the working state transition relationship between the first price queue and the second price queue of the present invention.

[0037] Figure 4This is a schematic diagram of an embodiment of the matching transaction of the present invention.

[0038] Figure 5 This is a schematic diagram of the structure of a high-efficiency foreign exchange order matching system according to the present invention. Detailed Implementation

[0039] To better understand the content of this invention, a detailed description will be provided in conjunction with the accompanying drawings and embodiments.

[0040] Retail customers who need to exchange foreign currency through banks for purposes such as studying abroad, private travel, visiting relatives, seeking medical treatment abroad, business trips abroad, overseas shopping, purchasing domestic and foreign wealth management products, or other purposes include: foreign exchange settlement and sales, and foreign exchange trading. Ordinary foreign exchange services are all real-time, meaning that customers enter transaction instructions through mobile banking, online banking, or at a branch, and the exchange of two currencies is completed based on the real-time exchange rate; currency A is debited, and currency B is credited.

[0041] For customers whose foreign currency exchange needs are not urgent, banks offer a foreign exchange pending order service. Customers pre-set an exchange rate that is better than the current rate, and the bank's system matches the order with the customer's currency. Within the specified matching period, if the exchange rate fluctuates to the customer's preset price, the bank's system automatically completes the foreign currency exchange operation, which is called a pending order execution. The corresponding transaction is currency A debited and currency B credited to the customer's account. Compared to regular foreign currency exchange services, the pending order service allows customers to exchange more currency B with less currency A.

[0042] In order to quickly consume the exchange rate in the price queue and complete the order matching process, avoiding the link congestion caused by queue accumulation, this invention provides an efficient foreign exchange order matching method and system.

[0043] The first aspect of this invention relates to an efficient foreign exchange order matching method. A schematic diagram of an embodiment is shown below. Figure 2 The method embodiment shown includes:

[0044] (1) Set up two price queues, including a first price queue and a second price queue, to alternately receive real-time exchange rates issued by the quotation engine;

[0045] Real-time exchange rate reception: This function receives real-time exchange rates for various currency pairs from the upstream quoting engine. To avoid congestion caused by the production rate of the price receiving queue exceeding the consumption rate, two price queues, Q1 and Q2, are set up, and these two queues alternately receive real-time exchange rates from the quoting engine. For example... Figure 3 This diagram illustrates the state transition between the first and second price queues of the present invention. In the diagram, State 1: Steps S3-S5. Q1 receives real-time prices, Q2 participates in matching; State 2: Steps S6-S8. Q1 participates in matching, Q2 receives real-time prices.

[0046] The specific steps are as follows:

[0047] S1: After the system starts up, Q1 begins to receive real-time exchange rates from the quoting engine, while Q2 is in sleep mode.

[0048] S2: The matching thread selects queue Q1, which is currently receiving real-time exchange rates, as the price source for the matching operation, and the matching thread begins to consume the prices in Q1.

[0049] S3: At the same time, the price queue Q1 no longer receives real-time exchange rates from the quoting engine;

[0050] S4: Price queue Q2 is awakened and begins to receive real-time prices from the pricing engine;

[0051] S5: After the matching thread finishes consuming the real-time exchange rate in queue Q1, it clears Q1 and Q1 enters a sleep state.

[0052] S6: At the same time, the price queue Q2 no longer receives real-time exchange rates from the quoting engine;

[0053] S7: Price queue Q1 is awakened and begins to receive real-time prices from the pricing engine;

[0054] S8: After the matching thread finishes consuming the real-time exchange rate in queue Q2, it clears Q2 and Q2 enters a sleep state.

[0055] ...

[0056] S9: Price queues Q1 and Q2 receive the real-time exchange rate issued by the quotation engine, i.e., they execute steps S3 to S8 in a loop.

[0057] (2) Execute pending order matching transactions based on the price queue of the current receiving quote engine.

[0058] The order matching process involves taking the real-time exchange rate from the price queue and comparing it sequentially with the customer's preset target price for each transaction in the order queue. When the real-time exchange rate meets the customer's requirements, the order is executed at the set price and removed from the order queue. If the order has not been executed by the deadline, the order expires and is removed from the order queue. For orders still being matched, the customer can initiate a cancellation operation, meaning the order becomes invalid, no longer participates in the price matching process, and is removed from the order queue.

[0059] S10: Following step S3, after calculating the lowest and highest prices of each currency pair in price queue Q1, it indicates that consumption of Q1 has been completed, and Q1 enters a sleep state.

[0060] S11: Poll the orders in the pending order queue and determine whether the price range between the lowest and highest prices calculated in S10 is better than the customer's preset target price;

[0061] S12: If the price range is better than the customer's preset target price, the order is successfully matched. Remove the order from the pending order queue and process the matching.

[0062] S13: Following step S6, after calculating the lowest and highest prices of each currency pair in price queue Q2, it indicates that consumption of Q2 has been completed, and Q2 enters a sleep state.

[0063] S14: Complete the matching action according to steps S11 and S12;

[0064] ...

[0065] S15: The matching thread consumes the real-time exchange rates in queues Q1 and Q2, and can then repeat steps S10 to S14.

[0066] Figure 4 This is a schematic diagram illustrating an embodiment of the matching transaction of the present invention, using a profitable order as an example:

[0067] Rules: Purchase of foreign exchange is completed when the real-time purchase price is less than or equal to the order price; settlement of foreign exchange is completed when the real-time settlement price is greater than or equal to the order price.

[0068] (1) The minimum and maximum values ​​of the USD to RMB exchange rate in Q1 are calculated by step S10 as MIN and MAX, respectively.

[0069] (2) There are three USD to RMB orders in the pending order queue, with the customer's preset target prices being R1, R2 and R3 respectively.

[0070] (3) If the order is for profit from foreign exchange purchase, then orders R2 and R3 will be executed at the agreed price. The reasons are as follows:

[0071] ① Because the minimum value MIN of the price range is less than R2, it means that during the time period when Q1 receives the price in step S1, the real-time exchange rate has already fallen below the customer's preset target R2, so the order R2 has been paid.

[0072] ②Because the entire price range [MIN, MAX] is less than R3, it means that during the time period when Q1 receives the price in step S1, the real-time exchange rate has already fallen below the customer's preset target R3, so the order R3 has been paid.

[0073] (4) If the order is for profit settlement, then the order R1 and R2 will be executed at the agreed price. The reasoning is similar to that above.

[0074] Another aspect of this invention relates to a highly efficient foreign exchange order matching system, the structure of which is as follows: Figure 5 As shown, it includes:

[0075] The real-time exchange rate receiving module is used to set up two price queues, including a first price queue and a second price queue, to alternately receive the real-time exchange rate issued by the quotation engine;

[0076] The order matching module is used to execute order matching transactions based on the price queue of the currently receiving quote engine.

[0077] Furthermore, it also includes:

[0078] The price comparison module is used to determine the relationship between the customer's preset target price and the exchange rate range.

[0079] By using this system, the aforementioned computational processing methods can be executed and the corresponding technical effects can be achieved.

[0080] Embodiments of the present invention also provide a computer-readable storage medium capable of implementing all the steps of the methods in the above embodiments, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements all the steps of the methods in the above embodiments.

[0081] Embodiments of the present invention also provide an electronic device for performing the above-described method. As an implementation device for the method, the electronic device has at least a processor and a memory. In particular, the memory stores data and related computer programs required for performing the method, such as price queues and customer-preset target prices. The processor calls the data and programs in the memory to execute all steps of the method and obtain the corresponding technical effect.

[0082] Preferably, the electronic device may include a bus architecture, which may include any number of interconnected buses and bridges. The bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same element, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor during operation.

[0083] Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operating control) used may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a buffer, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices, which can store the aforementioned data information, and may also store programs for executing the information, and the processor can execute the program stored in the memory to achieve information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it can be a button or touch input device; the power supply is used to provide power to the electronic device; the display is used to display images and text, for example, it can be an LCD display. The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which can be the same as in conventional mobile communication terminals. Based on different communication technologies, multiple communication modules can be incorporated into the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor can include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor is coupled to a central processing unit, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.

[0084] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0085] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0086] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0087] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0088] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A highly efficient method for matching pending foreign exchange orders, characterized in that, include: S1. Set up two price queues, including a first price queue and a second price queue, to alternately receive real-time exchange rates issued by the pricing engine; Step S1 includes repeatedly executing sub-steps S11-S15. S11. The first price queue receives the real-time exchange rate issued by the quotation engine, while the second price queue is in a sleep state. S12, the matching thread consumes the prices in the first price queue, and the first price queue no longer receives the real-time exchange rate issued by the quotation engine; the second price queue receives the real-time exchange rate issued by the quotation engine. S13. After the matching thread consumes all the prices in the first price queue, it clears the first price queue and puts the first price queue into a sleep state. S14. The matching thread consumes the prices in the second price queue, and the second price queue no longer receives the real-time exchange rate issued by the quotation engine; the first price queue receives the real-time exchange rate issued by the quotation engine. S15. After the matching thread has consumed all the prices in the second price queue, it clears the second price queue. S2. Execute pending order matching transactions based on the price queue of the current receiving quote engine; Step S2 includes the following sub-steps: S21. Obtain the customer's preset target price; S22. Calculate the lowest and highest real-time exchange rates in the price queue of the current receiving quote engine, which are the exchange rate ranges; S23. Determine the relationship between the customer's preset target price and the exchange rate range; S24. If the customer's preset target price is within the exchange rate range, then set the order corresponding to the customer's preset target price as the arrival price. S25. If the customer's preset target price is greater than the highest price in the current price queue of the receiving quote engine, then the order corresponding to the customer's preset target price will be set to the target price. S26. If the customer's preset target price is less than the lowest price in the current price queue of the receiving quote engine, then the order corresponding to the customer's preset target price will be set as an undelivered price.

2. The efficient foreign exchange order matching system as described in claim 1, characterized in that, include: The real-time exchange rate receiving module is used to set up two price queues, including a first price queue and a second price queue, to alternately receive the real-time exchange rate issued by the quotation engine; The order matching module is used to execute order matching transactions based on the price queue of the currently receiving quote engine.

3. The efficient foreign exchange order matching system as described in claim 2, characterized in that, Also includes: The price comparison module is used to determine the relationship between the customer's preset target price and the exchange rate range.

4. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the efficient foreign exchange order matching method of claim 1.

5. An electronic device, characterized in that, Including processor and memory; The memory is used to store the price queue and the customer's preset target price; The processor is used to execute the efficient foreign exchange order matching method of claim 1 by calling the stored price queue and the target price preset by the customer.

6. A computer program product, comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the steps of the efficient foreign exchange order matching method of claim 1.

Citation Information

Patent Citations

  • Foreign exchange quotation processing system and method

    CN104915886A