A data processing method and related apparatus
By obtaining and verifying the signature of transaction orders in cross-border matching transactions, storing them on the blockchain and generating transaction records, the problems of lengthy transaction processes and data tampering risks are solved, enabling efficient and secure cross-border transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ABC FINANCIAL TECH CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-02
AI Technical Summary
Cross-border matchmaking transactions rely on multiple intermediaries such as banks and payment institutions, resulting in lengthy transaction processes and risks of settlement errors and data tampering caused by manual operations.
By obtaining and verifying the signature of the transaction order, storing it on the blockchain, generating and verifying the transaction record, and using the blockchain balance to update and generate a clearing transaction receipt, human intervention is reduced and transaction efficiency and security are improved.
It achieves decentralization of cross-border matchmaking transactions, reduces the risk of human intervention, improves transaction efficiency and security, and ensures the integrity and immutability of transactions.
Smart Images

Figure CN122134352A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method and related apparatus. Background Technology
[0002] Current cross-border transaction matching typically relies on multiple intermediaries such as banks and payment institutions, resulting in lengthy transaction processes and susceptibility to settlement errors caused by manual operations, as well as the risk of data tampering. Therefore, reducing the risk of human intervention and improving the efficiency and security of cross-border transaction matching are urgent issues that need to be addressed. Summary of the Invention
[0003] In view of the above problems, this application provides a data processing method and related apparatus to improve the efficiency and security of cross-border matchmaking transactions. The specific solution is as follows:
[0004] The first aspect of this application provides a data processing method, including:
[0005] Obtain the transaction order, verify the signature of the transaction order, and obtain the first verification result;
[0006] After the first verification result indicates successful verification, the transaction order is stored on the blockchain to obtain the stored transaction order;
[0007] Obtain the transaction records generated after matching transactions based on the stored transaction orders, verify the transaction records, and obtain a second verification result;
[0008] After the second verification result indicates successful verification, the blockchain balance is updated based on the transaction record, and a settlement transaction receipt is generated.
[0009] The clearing transaction receipt is sent to the client so that the client updates the balance display result based on the clearing transaction receipt.
[0010] In one possible implementation, before storing the transaction order on the blockchain, the method further includes:
[0011] Obtain target data related to the data content of the transaction order; wherein, the target data is data related to the data content of the transaction order within N seconds prior to the current time.
[0012] Based on the target data, abnormal data in the transaction orders are filtered to obtain filtered transaction order data;
[0013] The step of storing the transaction order on the blockchain to obtain the stored transaction order includes:
[0014] The filtered transaction order data is stored on the blockchain in the order of the transaction order occurrence time to obtain the stored transaction orders.
[0015] In one possible implementation, the transaction order includes buy orders and sell orders, and the method further includes:
[0016] The buy orders are arranged in descending order of price to obtain a buy order sequence, and the sell orders are arranged in ascending order of price to obtain a sell order sequence.
[0017] One order is selected from each of the buy order sequence and the sell order sequence to obtain multiple order pairs; wherein, each order pair includes one buy order and one sell order;
[0018] Based on the price difference between the buy and sell orders in each order pair, the first score of each order pair is obtained;
[0019] Based on the first score, transactions are matched and transaction records are generated.
[0020] In one possible implementation, after obtaining the first score for each group of said order pairs, the method further includes:
[0021] The second score is obtained by acquiring the compliance trust score of the buyer and seller to which the order pair is pointed based on the first oracle;
[0022] The network latency of the settlement channel used by the order pair is obtained based on the second oracle, and a third score is obtained based on the network latency;
[0023] The current exchange rate is obtained based on the third oracle, the cost of the order pair at the current exchange rate is determined, and a fourth score is obtained based on the cost.
[0024] The step of matching transactions based on the first score and generating transaction records includes:
[0025] The first score, the second score, the third score, and the fourth score are weighted and summed to obtain the matching score;
[0026] The order pairs corresponding to the highest matching score are matched for transactions, and transaction records are generated.
[0027] In one possible implementation, verifying the transaction record to obtain a second verification result includes:
[0028] The target parameters are obtained based on the transaction records; wherein, the target parameters include the addresses of the buyer and seller, the amount of assets, and the hash value.
[0029] The target parameters are verified to obtain the second verification result.
[0030] A second aspect of this application provides a data processing system, comprising:
[0031] The acquisition module is used to acquire transaction orders, verify the signature of the transaction orders, and obtain a first verification result;
[0032] The on-chain module is used to store the transaction order on the blockchain after the first verification result indicates successful verification, thereby obtaining the stored transaction order;
[0033] The matching module is used to obtain transaction records generated after matching transactions based on the stored transaction orders, verify the transaction records, and obtain a second verification result.
[0034] The update module is used to update the blockchain balance based on the transaction record and generate a settlement transaction receipt after the second verification result indicates successful verification.
[0035] The sending module is used to send the clearing transaction receipt to the client so that the client updates the balance display result based on the clearing transaction receipt.
[0036] One possible implementation also includes:
[0037] A filtering module is used to obtain target data related to the data content of the transaction order before storing the transaction order on the blockchain; wherein, the target data is data related to the data content of the transaction order within N seconds before the current time; and to filter abnormal data in the transaction order based on the target data to obtain filtered transaction order data;
[0038] The on-chain module is specifically used to store the filtered transaction order data on the blockchain in the order of the transaction order occurrence time, so as to obtain the stored transaction orders.
[0039] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the data processing method described in the first aspect or any implementation thereof.
[0040] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0041] The memory is used to store computer programs;
[0042] The processor is used to execute the computer program so that the electronic device can implement the data processing method of the first aspect or any implementation thereof.
[0043] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to perform the data processing method described in the first aspect or any implementation thereof.
[0044] By employing the aforementioned technical solution, the data processing method and related apparatus provided in this application acquire a transaction order, verify the signature of the transaction order to obtain a first verification result; after the first verification result indicates successful verification, the transaction order is stored on the blockchain to obtain a stored transaction order; the transaction record generated after transaction matching based on the stored transaction order is acquired, and the transaction record is verified to obtain a second verification result; after the second verification result indicates successful verification, the blockchain balance is updated based on the transaction record to generate a clearing transaction receipt; the clearing transaction receipt is sent to the client so that the client updates the balance display result based on the clearing transaction receipt. This application, by verifying the order signature, can ensure the integrity of the transaction order and transaction record. Through decentralized transaction matching using the blockchain, and by uploading the transaction order and transaction record to the blockchain, the risk of human intervention is reduced, and the efficiency and security of cross-border matching transactions are improved. Attached Figure Description
[0045] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0046] Figure 1 A flowchart of a data processing method provided in this application;
[0047] Figure 2 A data processing system architecture diagram provided in this application;
[0048] Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0049] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0050] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0051] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0052] This application provides a data processing method. The data processing method of this application embodiment will be described in detail below with reference to the accompanying drawings.
[0053] Reference Figure 1 , Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application, such as... Figure 1 As shown in the embodiment of this application, a data processing method may include steps 101 to 105, which are described in detail below.
[0054] Step 101: Obtain the transaction order, verify the signature of the transaction order, and obtain the first verification result.
[0055] When retrieving a transaction order, node deployment of an order storage contract in Ethereum can receive user-submitted order data. This transaction order can include buy and sell orders. After retrieving the order, it can be verified that the quantity and price are greater than 0, and that the trading pair involved in the order is in a preset list. When verifying the order signature, a Keccak256 hash can be generated based on the user's wallet address, quantity, price, and a nonce parameter (for preventing replay attacks). Ethereum can then use this hash value and the order signature to verify the ECDSA signature using the Elliptic Curve Digital Signature Algorithm, ensuring the order has not been tampered with.
[0056] Step 102: After the first verification result indicates successful verification, the transaction order is stored on the blockchain to obtain the stored transaction order.
[0057] After the first verification result indicates successful verification, the transaction order can be stored on the blockchain. In practical applications, the smart contract writes the verified transaction order into the order pool of the blockchain node. The transaction order can be stored in each blockchain node according to the buy order sequence and sell order sequence to achieve the goal of complete decentralization. Ethereum uses Merkle Patrica Trie technology to store the transaction order status.
[0058] Optionally, transaction orders can be stored on the blockchain using a multi-level storage structure. For example, transaction orders from the latest P blocks (e.g., 100 or other values) can be stored in a memory cache, transaction orders from the last Q months (e.g., the last month) can be stored on an SSD (Solid-State Drive), and historical orders (over Q months) can be archived and persistently saved using IPFS (InterPlanetary File System).
[0059] After the first verification result indicates successful verification, the user's assets can be checked to ensure that the balance of the bid tokens (equivalent to money) of the user who placed the order is greater than or equal to the order quantity × unit price, and the balance of the base tokens (equivalent to goods) of the user who placed the order is greater than or equal to the order quantity. The user's balance is then marked as locked, and no actual asset transfer occurs at this time.
[0060] In one possible implementation, before storing the transaction order on the blockchain, the following is also included:
[0061] Retrieve target data related to the data content of the transaction order; where the target data is the data related to the data content of the transaction order within N seconds prior to the current time.
[0062] The abnormal data in the transaction orders is filtered based on the target data to obtain the filtered transaction order data.
[0063] In this embodiment, step 102 involves uploading the filtered transaction order data to the blockchain in the order of the transaction order occurrence time to obtain the stored transaction orders.
[0064] Before assets are locked, trading orders do not need to immediately enter the matching pool for matching. Smart contracts can automatically call one or more decentralized oracles to obtain the latest data and correct the order status. By using oracles to input trusted data into a closed blockchain, the problem of smart contracts being unable to independently obtain off-chain data is solved. The interaction between the on-chain contract and the Oracle library in this application adopts Chainlink, supplemented by Band Protocol to reduce the probability of failure. A multi-source synchronization architecture together constitutes the oracle.
[0065] When acquiring target data related to the data content of a trading order, and filtering out abnormal data in the trading order based on the target data, the latest price data within T seconds (e.g., 60 seconds) can be obtained through a price verification oracle to ensure data freshness. It is also possible to filter out abnormal data in the trading order, such as abnormal data with a price fluctuation deviation of 5%, based on the data returned by the oracle, and take the median of the remaining prices as the market price that has passed verification.
[0066] This application digitally signs transaction orders based on the user's digital wallet, generates encrypted transaction credentials, constructs a data packet for blockchain transactions, and then calls an order storage contract deployed on the blockchain's core protocol layer. This order storage contract is used to verify the validity of the user's signature, check the compliance of the order format, and automatically and synchronously call a decentralized compliance oracle, which can guarantee the integrity of the transaction orders.
[0067] Step 103: Obtain the transaction records generated after matching the stored transaction orders, verify the transaction records, and obtain the second verification result.
[0068] After the transaction orders are stored on the blockchain, the blockchain returns transaction data to the Java service. The Java service listens for and captures events, then begins transaction matching and generates transaction records. Transaction matching takes place off-chain, while the transaction records generated after matching the stored transaction orders can be retrieved on-chain.
[0069] In one possible implementation, the data processing method provided in this application further includes:
[0070] Arrange the buy orders in descending order of price to obtain the buy order sequence, and arrange the sell orders in ascending order of price to obtain the sell order sequence.
[0071] Select one order from each of the buy and sell order sequences to obtain multiple order pairs; each order pair consists of one buy order and one sell order.
[0072] The first score for each order pair is obtained based on the price difference between the buy and sell orders in each order pair.
[0073] Transaction matching is performed based on the first score, and transaction records are generated.
[0074] In practical applications, the necessary and sufficient condition for a successful match is:
[0075] ,
[0076] That is, in the set of buy orders B and the set of sell orders S, there exists at least one buy order b and one sell order s such that the price of the buy order b.price is greater than or equal to the price of the sell order s.price.
[0077] One order is selected from each of the buy and sell order sequences, resulting in multiple order pairs. Each order pair consists of one buy order and one sell order. Then, based on the price difference between the buy and sell orders in each order pair, a first score is calculated for each order pair. Transactions are matched based on these first scores, generating transaction records. According to the price priority principle, the buy order sequence is sorted from highest to lowest price, with higher prices yielding higher scores; similarly, the sell order sequence is sorted from lowest to highest price, with lower prices yielding higher scores.
[0078] In one possible implementation, after obtaining the first score for each pair of orders, the following is also included:
[0079] The second score is obtained by using the compliance trust score of the buyer and seller pairs pointed to by the first oracle.
[0080] The network latency of the settlement channel used by the order pair is obtained based on the second oracle, and a third score is obtained based on the network latency;
[0081] The current exchange rate is obtained using the third oracle, the cost of the order pair at the current exchange rate is determined, and the fourth score is obtained based on the cost.
[0082] When obtaining a second score by calculating the compliance trust score between the buyer and seller in an order pair based on the first oracle, the first oracle can be a compliance oracle. The second score can be obtained by querying the results of the compliance oracle. For example, if the buyer and seller have a mutually recognized jurisdiction, the score is high; if one party is on the other party's risk blacklist, the score is 0.
[0083] When obtaining the network latency of the settlement channel used by the order pair based on the second oracle, and obtaining the third score based on the network latency, the second oracle can be a network state oracle. The network state oracle obtains the current network congestion and estimated latency of different settlement channels (such as SWIFT and Fedwire). The lower the network latency, the higher the third score.
[0084] When a third oracle is used to obtain the current exchange rate, determine the cost of an order pair at that rate, and then calculate a fourth score based on that cost, the third oracle can be considered an exchange rate oracle. For cross-border transactions, an exchange rate oracle is used to obtain real-time exchange rates and calculate the cost of the transaction at the optimal exchange rate; the lower the cost, the higher the score.
[0085] In this embodiment, transaction matching is performed based on the first score, and transaction records are generated, including:
[0086] The first, second, third, and fourth scores are weighted and summed to obtain the matching score;
[0087] The order pairs corresponding to the highest matching score are matched for transactions, and transaction records are generated.
[0088] A weighted sum of the first, second, third, and fourth scores yields a comprehensive matching score. When matching orders corresponding to the highest matching score, matching is performed based on the highest-scoring order. For orders with the same score, they are sorted by timestamp: the best buy and sell orders at the top are retrieved, and the buy price is checked against the sell price. If they are, matching continues, and the transaction volume is the minimum of the buy and sell orders. The remaining volume can continue to be matched. The final transaction price is the sell price, which is beneficial for market liquidity. The Java service listens for the final transaction price, actual transaction volume, and asset settlement instructions from both buyers and sellers, calls the asset settlement contract in the blockchain core protocol layer, and executes step 104.
[0089] This application, after storing transaction orders on the blockchain, involves each node on the blockchain synchronously writing its state into the order book, and then entering the off-chain matching stage. Compliant orders are pulled from the order pool, and large orders can be split for individual matching. To perform price matching and obtain compliance trust scores, settlement efficiency scores, and exchange rate optimization scores, multiple nodes running different smart contracts can be deployed. A transaction order is distributed to different nodes, which simultaneously calculate scores. Each node connects to oracles with different functions to obtain various data, and finally, a weighted scoring algorithm is used to calculate the matching score. This categorized parallel deployment method improves efficiency and facilitates scalability.
[0090] After obtaining the transaction records, the transaction records can be verified to obtain a second verification result.
[0091] After the matching is completed, the assets are settled. The entire settlement process must be completed within a single transaction, or be entirely rollbackable; this is known as atomicity, and therefore needs to be implemented within a smart contract. Based on the atomicity principle of the contract, the legality of the matching result is verified.
[0092] In one possible implementation, the transaction record is verified to obtain a second verification result, including:
[0093] The target parameters are obtained based on the transaction records; these parameters include the addresses of the buyer and seller, the amount of assets, and the hash value.
[0094] The target parameters were verified, and a second verification result was obtained.
[0095] The smart contract obtains transaction records and can then retrieve target parameters such as the addresses of both buyers and sellers, the amount of assets, and a hash value (randomly generated). These target parameters are then verified to obtain a second verification result. Specifically, this verifies whether the buy / sell order is still in an "incomplete" state. Only if both are in an "incomplete" state is the previous asset lock valid. To ensure atomicity, the contract state is set to "Settings".
[0096] Step 104: After the second verification result indicates successful verification, update the blockchain balance based on the transaction record and generate a settlement transaction receipt.
[0097] After the second verification result indicates successful verification, the asset transfer between the buyer and seller is completed through a token contract. The buyer receives the base token, and the seller receives the quoted token. The blockchain balance is updated based on the transaction record, i.e., the on-chain balances of both the buyer and seller are updated, generating a clearing transaction receipt including the transaction hash and change details. From successful matching to HTLC (HashedTimelock Contract) deployment, there is no time window for manual intervention or other system calls; it is an atomic process completed within the smart contract. After detecting the HTLC deployment event, a second confirmation can be performed with the on-chain data to ensure the transaction will not be rolled back. After confirmation, the final state of the recorded transaction order is updated.
[0098] The total transaction amount is calculated as transaction volume multiplied by the transaction price. To prevent network congestion from attacks involving millions of empty transfers and node state explosions due to excessive junk data, a transaction fee can be charged on each transaction. Considering sellers' focus on actual received funds and liquidity priority, a fee can be charged on buyer orders. The fee is calculated based on the total amount and a rate, which can be 0.3% or other values. Ultimately, the buyer receives base tokens (goods) = transaction volume, the seller receives quote tokens (money) = total amount - transaction fee, and the system receives quote tokens (money) = transaction fee. After asset transfer is complete, the order status is updated to "completed" or "partially executed," and the remaining assets are unlocked. The asset settlement contract has a certain degree of error recovery capability, allowing for rollback in case of failure, i.e., reversing all balance changes throughout the process.
[0099] Step 105: Send the clearing transaction receipt to the client so that the client can update the balance display result based on the clearing transaction receipt.
[0100] When sending clearing transaction receipts to the client so that the client can update the balance display based on the clearing transaction receipts, a WebSocket connection can be established with the message push service on the user submission page and maintained through a heartbeat mechanism. An independent thread is created to store sessions for each user, ensuring that each user does not interfere with others, guaranteeing their independence and security. After the transaction is completed, a transaction completion notification containing the clearing transaction receipt is proactively sent to the user. To ensure that transactions cannot be tampered with, this message push service does not process any messages proactively sent by the user.
[0101] After receiving the clearing transaction receipt, the client can first verify the transaction records across the entire blockchain, ensuring authenticity, and simultaneously save a copy of the transaction history. Once the transaction is confirmed to be correct, the client updates the balance display based on the clearing transaction receipt; that is, it updates the local asset balance display according to the asset changes indicated in the message.
[0102] The method provided in this application stores transaction records, order hashes, and account status on the blockchain. The immutability of the blockchain ensures that the data on the chain cannot be modified or deleted without authorization. Simultaneously, all historical operations (order submission, matching results, settlement) form a traceable chain of credentials, thus the system inherently possesses full lifecycle auditability. Regulators or users can independently verify the authenticity of any transaction. Asset settlement is executed by smart contracts, and the contract logic is open-source and verifiable. Smart contracts automatically execute preset rules, eliminating manual reconciliation and leaving no room for human intervention. Furthermore, user asset transfers are completed through atomic contract operations, avoiding counterparty risk. Therefore, the system can achieve fair matching with programmatic guarantees. Matching results are confirmed through consensus among multiple verification nodes (or miners / validators). Verification nodes are distributed across different entities, with no single point of control. Malicious nodes cannot tamper with data independently, providing high resilience against failures and resistance to single-point oppressive censorship. Matching is executed off-chain by a high-performance engine, with only batch verification and settlement performed on-chain. Off-chain engines focus on computation, avoiding the throughput bottleneck of blockchain, and achieving near-centralized system performance (high transactions per second + low latency) without sacrificing security.
[0103] The above describes a data processing method provided by an embodiment of this application. The following will describe a system that performs the above data processing method.
[0104] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a data processing system provided in an embodiment of this application. Figure 2 As shown, the data processing system includes:
[0105] The acquisition module 201 is used to acquire transaction orders, verify the signatures of the transaction orders, and obtain the first verification result. Transaction orders include buy orders and sell orders.
[0106] The on-chain module 202 is used to store the transaction order on the blockchain after the first verification result indicates successful verification, thus obtaining the stored transaction order.
[0107] The matching module 203 is used to obtain the transaction records generated after matching the stored transaction orders, verify the transaction records, and obtain a second verification result.
[0108] The update module 204 is used to update the blockchain balance based on the transaction record and generate a settlement transaction receipt after the second verification result indicates successful verification.
[0109] The sending module 205 is used to send clearing transaction receipts to the client so that the client can update the balance display result based on the clearing transaction receipts.
[0110] In one possible implementation, the data processing system provided in this application further includes:
[0111] The filtering module is used to obtain target data related to the data content of the transaction order before storing the transaction order on the blockchain; the target data is the data related to the data content of the transaction order within N seconds before the current time; based on the target data, abnormal data in the transaction order is filtered to obtain the filtered transaction order data;
[0112] The on-chain module is specifically used to store the filtered transaction order data on the blockchain in the order of the transaction order occurrence time, thus obtaining the stored transaction orders.
[0113] In one possible implementation, the data processing system provided in this application further includes:
[0114] The first calculation module is used to arrange buy orders in descending order of price to obtain a buy order sequence, and to arrange sell orders in ascending order of price to obtain a sell order sequence; select one order from each of the buy and sell order sequences to obtain multiple order pairs; wherein each order pair includes one buy order and one sell order; based on the price difference between the buy and sell orders in each order pair, obtain a first score for each order pair; and perform transaction matching based on the first score to generate transaction records.
[0115] In one possible implementation, the data processing system provided in this application further includes:
[0116] The second calculation module is used to obtain the compliance and mutual trust scores of the buyers and sellers pointed to by the order pair based on the first oracle after obtaining the first score of each order pair, and obtain the second score based on the network latency of the settlement channel used by the order pair based on the second oracle; and obtain the cost of the order pair at the current exchange rate based on the current exchange rate based on the third oracle, and obtain the fourth score based on the cost.
[0117] Optionally, the first calculation module is specifically used to: perform a weighted summation of the first score, the second score, the third score, and the fourth score to obtain a matching score; and match orders corresponding to the highest matching score to generate transaction records.
[0118] In one possible implementation, the matching module 203 is specifically used for:
[0119] The target parameters are obtained based on the transaction records; these parameters include the addresses of the buyer and seller, the amount of assets, and the hash value.
[0120] The target parameters were verified, and a second verification result was obtained.
[0121] This application provides a distributed matching engine system based on blockchain technology, leveraging the decentralized, highly transparent, and tamper-proof characteristics of blockchain to build a transaction matching platform. It transforms the business rules (compliance and risk control) in cross-border transactions into executable, deterministic technical parameters for smart contracts. The system adopts a layered architecture, from top to bottom: user interface layer, basic service layer (matching engine service layer, state synchronization service layer), smart contract core protocol layer, Ethereum infrastructure layer, and oracle adaptation layer. Core components requiring accuracy are placed on smart contracts (on-chain), while basic services are placed on a Java service cluster (off-chain). Through deep coupling at the architectural level, an atomic transaction system of "matching equals settlement" is formed, ensuring transaction integrity. Interactions between layers within the system are achieved through a subscription mechanism or message queue. The entire system's transaction matching and settlement process includes the order submission stage, matching calculation stage, settlement execution stage, and result synchronization stage, corresponding to the order storage contract and compliance pre-verification module, the multi-factor dynamic matching engine module, the atomic settlement trigger module, and the state synchronization and signaling module, respectively.
[0122] This application also provides an electronic device in its embodiments. (See reference...) Figure 3 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0123] like Figure 3 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. When the electronic device is powered on, the RAM 303 also stores various programs and data required for the operation of the electronic device. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0124] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, memory cards, hard drives, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0125] This electronic device is capable of performing the aforementioned data processing methods.
[0126] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the data processing methods provided in this application.
[0127] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the data processing methods provided in this application.
[0128] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0130] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.
[0131] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A data processing method, characterized in that, include: Obtain the transaction order, verify the signature of the transaction order, and obtain the first verification result; After the first verification result indicates successful verification, the transaction order is stored on the blockchain to obtain the stored transaction order; Obtain the transaction records generated after matching transactions based on the stored transaction orders, verify the transaction records, and obtain a second verification result; After the second verification result indicates successful verification, the blockchain balance is updated based on the transaction record, and a settlement transaction receipt is generated. The clearing transaction receipt is sent to the client so that the client updates the balance display result based on the clearing transaction receipt.
2. The data processing method according to claim 1, characterized in that, Before storing the transaction order on the blockchain, the method further includes: Obtain target data related to the data content of the transaction order; wherein, the target data is data related to the data content of the transaction order within N seconds prior to the current time. Based on the target data, abnormal data in the transaction orders are filtered to obtain filtered transaction order data; The step of storing the transaction order on the blockchain to obtain the stored transaction order includes: The filtered transaction order data is stored on the blockchain in the order of the transaction order occurrence time to obtain the stored transaction orders.
3. The data processing method according to claim 1, characterized in that, The transaction order includes buy orders and sell orders, and the method further includes: The buy orders are arranged in descending order of price to obtain a buy order sequence, and the sell orders are arranged in ascending order of price to obtain a sell order sequence. One order is selected from each of the buy order sequence and the sell order sequence to obtain multiple order pairs; wherein, each order pair includes one buy order and one sell order; Based on the price difference between the buy and sell orders in each order pair, the first score of each order pair is obtained; Based on the first score, transactions are matched and transaction records are generated.
4. The data processing method according to claim 3, characterized in that, After obtaining the first score for each group of order pairs, the process further includes: The second score is obtained by acquiring the compliance trust score of the buyer and seller to which the order pair is pointed based on the first oracle; The network latency of the settlement channel used by the order pair is obtained based on the second oracle, and a third score is obtained based on the network latency; The current exchange rate is obtained based on the third oracle, the cost of the order pair at the current exchange rate is determined, and a fourth score is obtained based on the cost. The step of matching transactions based on the first score and generating transaction records includes: The first score, the second score, the third score, and the fourth score are weighted and summed to obtain the matching score; The order pairs corresponding to the highest matching score are matched for transactions, and transaction records are generated.
5. The data processing method according to any one of claims 1 to 4, characterized in that, The verification of the transaction record to obtain a second verification result includes: The target parameters are obtained based on the transaction records; wherein, the target parameters include the addresses of the buyer and seller, the amount of assets, and the hash value. The target parameters are verified to obtain the second verification result.
6. A data processing system, characterized in that, include: The acquisition module is used to acquire transaction orders, verify the signature of the transaction orders, and obtain a first verification result; The on-chain module is used to store the transaction order on the blockchain after the first verification result indicates successful verification, thereby obtaining the stored transaction order; The matching module is used to obtain transaction records generated after matching transactions based on the stored transaction orders, verify the transaction records, and obtain a second verification result. The update module is used to update the blockchain balance based on the transaction record and generate a settlement transaction receipt after the second verification result indicates successful verification. The sending module is used to send the clearing transaction receipt to the client so that the client updates the balance display result based on the clearing transaction receipt.
7. The data processing system according to claim 6, characterized in that, Also includes: The filtering module is used to obtain target data related to the data content of the transaction order before storing the transaction order on the blockchain; wherein, the target data is data related to the data content of the transaction order within N seconds before the current time. Based on the target data, abnormal data in the transaction orders are filtered to obtain filtered transaction order data; The on-chain module is specifically used to store the filtered transaction order data on the blockchain in the order of the transaction order occurrence time, so as to obtain the stored transaction orders.
8. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the data processing method as described in any one of claims 1 to 5.
9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the data processing method as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the data processing method as described in any one of claims 1 to 5.