Foreign exchange transaction exposure statistical method, electronic device and computer-readable medium
Through Merkle tree branch technology, cross-border payment transaction data is received and verified in real time, solving the problem of inaccurate statistics of foreign exchange transaction exposure in cross-border payments and ensuring the integrity and accuracy of transaction data.
Patent Information
- Application Number
- CN202510991424.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-07-18
AI Technical Summary
The problem of inaccurate statistics of foreign exchange transaction exposure in cross-border payments, especially when the transaction date and delivery date are inconsistent, leads to inaccurate exposure statistics results.
Using Merkle tree branch technology, the packaging node receives transaction data in real time, determines the exposure section, and constructs a Merkle tree branch. The verification center verifies the authenticity of the transaction data, and finally the root node information is publicized by the monitoring node to ensure the integrity and accuracy of the transaction data.
It achieves the comprehensiveness and accuracy of foreign exchange transaction exposure statistics in cross-border payments, ensures that transaction data is not tampered with, and improves the reliability of statistics.
Smart Images

Figure CN120508583B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cross-border payments, and in particular to a foreign exchange transaction exposure statistics method, an electronic device, and a computer-readable medium. Background Art
[0002] In the cross-border payment industry, where foreign exchange transactions are substantial, exposure management is essential. Exposure management refers to the process of identifying, assessing, and controlling unhedged or unprotected risk exposures in financial activities.
[0003] In order to conduct exposure management, exposure statistics must be conducted first. That is to say, the company needs to gather all transaction data every day, but inaccurate statistics are inevitable. Summary of the Invention
[0004] The present invention aims to solve one of the technical problems in the related art to a certain extent. To this end, the present invention provides a foreign exchange trading exposure statistics method, electronic device and computer-readable medium.
[0005] To achieve the above-mentioned objectives, as a first aspect of the present invention, a foreign exchange trading exposure statistics method is disclosed, which is used for packaging nodes. The foreign exchange trading exposure statistics method includes:
[0006] Receive at least one set of transaction data in real time;
[0007] Determining the time of the exposure section into which the real-time received transaction data is to be inserted according to the transaction time of the real-time received transaction data;
[0008] Inserting all transaction data received in real time after the exposure section;
[0009] Perform hash operations on the transaction data received in real time to obtain the corresponding hash value, and send the obtained hash value to the verification center;
[0010] According to the statistical dimension, all transaction data after the exposed section in the statistical database are used to construct Merkle tree branches respectively, and obtain root node information of each Merkle tree branch, wherein the root node information of the Merkle tree branch includes a root node hash value and corresponding statistical dimension information;
[0011] The root node information of each of the Merkle tree branches is sent to the verification center.
[0012] Optionally, in the case of receiving multiple sets of transaction data, determining the time of the open section into which the transaction data is to be inserted according to the transaction time of the transaction data received in real time includes:
[0013] The earliest transaction time among the multiple groups of transaction data is used as the time of the exposure section to be inserted.
[0014] Optionally, in the step of constructing Merkle tree branches respectively according to the statistical dimension using the transaction data in the statistical database, the root node information of the multiple Merkle tree branches is stored in different blocks respectively.
[0015] Optionally, the statistical dimension includes a currency pair dimension and a delivery time dimension, and the transaction data includes a transaction identifier, transaction time, delivery time, and currency pair.
[0016] Optionally, before receiving at least one set of transaction data in real time, the foreign exchange transaction exposure statistics method further includes:
[0017] At a set time, the transaction data before the set time is counted, and the transaction data obtained by the statistics is used to build the initial version of the Merkle tree branch chain, and the corresponding root node information is obtained.
[0018] As a second aspect of the present invention, a foreign exchange trading exposure statistics method is provided for use in a verification center, wherein the foreign exchange trading exposure statistics method includes:
[0019] Receive the hash value of the transaction data;
[0020] Receive multiple root node information, wherein the root node information is the root node information of a Merkle tree branch, and the root node information includes a root node hash value and a corresponding statistical dimension, and the root node hash value is a hash value obtained by constructing the Merkle tree branch according to the statistical dimension using all transaction data after the open section inserted by the transaction data in the statistical database;
[0021] Based on the statistical dimension, the hash value of the received transaction data is used to construct a Merkle tree branch chain. The root node information of the constructed Merkle tree branch chain includes the hash value and the corresponding dimension information.
[0022] Comparing the root node information of the Merkle tree constructed by the verification center with the received root node information, and generating a verification result, wherein if the received root node information is consistent with the root node information of the Merkle tree branch constructed by the verification center, the verification result is passed;
[0023] The verification result is sent to the monitoring node.
[0024] Optionally, the statistical dimension includes a currency pair dimension and a delivery time dimension, and the transaction data includes a transaction identifier, transaction time, delivery time, and currency pair.
[0025] As a third aspect of the present invention, a foreign exchange trading exposure statistics method is provided for use in a monitoring node. The foreign exchange trading exposure statistics method includes:
[0026] Receiving a verification result issued by the verification center, wherein the verification result is generated by comparing the root node information of the Merkle tree branch chain constructed by the verification center using the hash value of the received transaction data with the received root node information;
[0027] If the verification result indicates that the verification is passed, the root node information of the corresponding Merkle tree branch chain is publicized as the statistical main chain information, wherein the corresponding transaction data can be restored and obtained from the publicized root node information of the statistical main chain.
[0028] As a fourth aspect of the present invention, an electronic device is provided, comprising:
[0029] one or more processors;
[0030] A storage module stores an executable program thereon, which, when called by the one or more processors, can implement the foreign exchange transaction exposure statistics method described in at least one of the first to third aspects of the present invention.
[0031] As a fifth aspect of the present invention, a computer-readable medium is provided, on which one or more computer programs are stored. When the one or more computer programs are called, the foreign exchange transaction exposure statistics method described in at least one of the first to third aspects of the present invention can be implemented.
[0032] The foreign exchange trading exposure statistics method provided in an embodiment of the present invention is executed by a packaging node, which must cooperate with a verification center and a monitoring node to ultimately complete foreign exchange trading exposure statistics. Specifically, upon receiving transaction data in real time, the packaging node first determines the transaction time of the transaction data. It then compares the transaction time of the transaction data with existing foreign exchange trading exposure statistics to determine the exposure profile corresponding to the transaction time. After determining the exposure profile, the real-time received transaction data is inserted after the corresponding exposure profile. Inserting transaction data causes the data structure in the statistical database to change. Accordingly, a Merkle tree branch is constructed based on all transaction data in the statistical database, ultimately obtaining the root node information. By reverse engineering the root node information, the transaction data can be extracted, thus ensuring that the transaction data has not been tampered with. The verification center restores the root node information to obtain the leaf node information of the Merkle tree branch. By comparing the leaf node information with the hash value of the transaction data, the authenticity of the transaction data can be verified. Specifically, only transaction data verified by the verification center is considered authentic and valid. After the monitoring node detects that the verification is successful, the root node information of the Merkle tree branch can be made public.
[0033] External business nodes that need to obtain transaction data can obtain the transaction data by reverse-recovering the root node information. By aggregating the transaction data into a statistical database, foreign exchange trading exposure statistics can be completed. This embodiment of the present invention ensures both the comprehensiveness and accuracy of foreign exchange trading exposure statistics.
[0034] These features and advantages of the present invention will be further disclosed in the following detailed description and accompanying drawings. The preferred embodiments and means of the present invention will be fully illustrated in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. Furthermore, although multiple features, elements, and components may be present in each of the following text and accompanying drawings, they may be labeled with different symbols or numbers for convenience, but all represent components with the same or similar structure or function. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The present invention will be further described below in conjunction with the accompanying drawings:
[0036] Figure 1 This is a flowchart of an embodiment of the foreign exchange transaction exposure statistics method provided by the first aspect of the present invention;
[0037] Figure 2 This is a flowchart of an embodiment of the foreign exchange transaction exposure statistics method provided by the second aspect of the present invention;
[0038] Figure 3This is a flowchart of an embodiment of the foreign exchange transaction exposure statistics method provided by the third aspect of the present invention;
[0039] Figure 4 This is a diagram showing different versions of Merkle tree branches;
[0040] Figure 5 is a schematic diagram of the data structure in a block according to an embodiment of the present invention;
[0041] Figure 6 It is a schematic diagram of the signaling interaction of each node in the implementation of the foreign exchange trading exposure statistics method;
[0042] Figure 7 is a schematic diagram of the data structure in a block according to another embodiment of the present invention;
[0043] Figure 8 is a schematic diagram of an electronic device provided in a fourth aspect of the present invention;
[0044] Figure 9 is a schematic diagram of a computer-readable medium.
[0045] Description of Reference Numerals
[0046] 101: Processor 102: Memory
[0047] 103: I / O interface 104: bus DETAILED DESCRIPTION
[0048] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described in the embodiments are intended to explain the present invention and are not to be construed as limiting the present invention.
[0049] References in this specification to "one embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with the embodiment itself can be included in at least one embodiment disclosed herein. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
[0050] Exposure statistics are typically collected on fixed dates, with transaction data received prior to that date collected and publicly disclosed. For cross-border payments, exposure statistics are difficult because the transaction date and delivery date are very likely to be different, and the delivery date may be later than the transaction date. This means that transaction data from transactions prior to the transaction date may be received after the statistical date, leading to inaccurate exposure statistics.
[0051] In view of this, as a first aspect of the present invention, a foreign exchange transaction exposure statistics method is provided for packaging nodes, wherein, Figure 1 As shown, the foreign exchange trading exposure statistical method includes:
[0052] In step S110, at least one set of transaction data is received in real time;
[0053] In step S120, the time of the open section into which the transaction data is to be inserted is determined according to the transaction time of the transaction data received in real time;
[0054] In step S130, all transaction data received in real time are inserted after the open section;
[0055] In step S140, a hash operation is performed on the transaction data received in real time to obtain a corresponding hash value, and the obtained hash value is sent to the verification center;
[0056] In step S150, based on the statistical dimension, all transaction data after the open section in the statistical database are used to construct Merkle tree branches respectively, and the root node information of each Merkle tree branch is obtained, wherein the root node information of the Merkle tree branch includes the root node hash value and the corresponding statistical dimension information;
[0057] In step S160, the root node information of each Merkle tree branch is sent to the verification center.
[0058] The foreign exchange trading exposure statistics method provided in an embodiment of the present invention is executed by a packaging node, which must cooperate with a verification center and a monitoring node to ultimately complete foreign exchange trading exposure statistics. Specifically, upon receiving transaction data in real time, the packaging node first determines the transaction time of the transaction data. It then compares the transaction time of the transaction data with existing foreign exchange trading exposure statistics to determine the exposure profile corresponding to the transaction time. After determining the exposure profile, the real-time received transaction data is inserted after the corresponding exposure profile. Inserting transaction data causes the data structure in the statistical database to change. Accordingly, a Merkle tree branch is constructed based on all transaction data in the statistical database, ultimately obtaining the root node information. By reverse engineering the root node information, the transaction data can be extracted, thus ensuring that the transaction data has not been tampered with. The verification center restores the root node information to obtain the leaf node information of the Merkle tree branch. By comparing the leaf node information with the hash value of the transaction data, the authenticity of the transaction data can be verified. Specifically, only transaction data verified by the verification center is considered authentic and valid. After the monitoring node detects that the verification is successful, the root node information of the Merkle tree branch can be made public.
[0059] External business nodes that need to obtain transaction data can obtain the transaction data by reverse-reducing the root node information. By aggregating the transaction data into a statistical database, foreign exchange trading exposure statistics can be completed. Through the embodiments of the present invention, both the comprehensiveness and accuracy of foreign exchange trading exposure statistics can be ensured. Of course, the present invention is not limited to this. For example, the root node information can also include statistical data, which is the data obtained by clustering all transaction data after the exposure section according to the statistical dimension. It should be noted that the category of the statistical data should match the dimensional information in the root node information to which the statistical data belongs.
[0060] External service nodes can directly obtain the statistical data stored in the corresponding block. Correspondingly, monitoring nodes can also directly read the statistical data stored on the block storing the root node information.
[0061] Blockchains are characterized by their block-based storage. Blocking the root node information of constructed Merkle tree branches is a key issue addressed by the embodiments of the present invention. Compared to typical domestic payments, cross-border payments are also unique in that they involve a greater number of statistical dimensions. To simplify computational complexity, the embodiments of the present invention construct Merkle tree branches based on these statistical dimensions, carry the corresponding dimensional information at the root node of each Merkle tree branch, and store different Merkle tree branches in different blocks based on this dimensional information. This simplifies the computational complexity required to store the Merkle tree branches and subsequently query their root node information.
[0062] That is, in the step of constructing Merkle tree branches respectively according to the statistical dimension using the transaction data in the statistical database, the root node information of the multiple Merkle tree branches is stored in different blocks respectively.
[0063] Optionally, the statistical dimensions include currency pair and delivery time dimensions, and the transaction data includes a transaction identifier, transaction time, delivery time, and currency pair. In other words, each root node includes currency pair and delivery time dimension information. Merkle tree branches constructed from transaction data with the same currency pair and delivery time are stored in the same block.
[0064] For example, block 1 stores the root node information of the Merkle tree branch generated by transaction data with a delivery date of the 20th of a certain month and a currency pair of (RMB, USD); block 2 stores the root node information of the Merkle tree branch generated by transaction data with a delivery date of the 21st of a certain month and a currency pair of (RMB, USD); block 3 stores the root node information of the Merkle tree branch generated by transaction data with a delivery date of the 20th of a certain month and a currency pair of (EUR, JPY).
[0065] Specifically, the method of constructing Merkle tree branches based on the statistical dimension using the transaction data in the statistical database includes:
[0066] Clustering all transaction data after the exposure section in the statistical database according to statistical dimensions to obtain statistical data;
[0067] Corresponding Merkle tree branches are constructed using statistical data, wherein root node information of multiple Merkle tree branches is stored in different blocks respectively.
[0068] Through clustering, transaction data can be classified and corresponding category information can be obtained. The category information is compared with the dimension information, and the matching statistical data, dimension information, and root node hash value are encapsulated together to form the root node information.
[0069] As an optional implementation, each time a Merkle tree branch is constructed, a corresponding version number is generated for that branch. For example, block 1 stores the Merkle tree branch with version v1 and version v2 generated for transaction data with a settlement date of the 20th of a month and a currency pair of (RMB, USD).
[0070] After the statistical time, steps S120 to S160 are executed once each time transaction data is received. Therefore, the same block may store the root node information of Merkle tree branches constructed at different times. When publishing the root node information of the statistical main chain, the main chain published is the root node information of the Merkle tree branch that was generated and verified last.
[0071] As an optional implementation, there is no particular limitation on the amount of transaction data received in step S110. For example, one set of transaction data may be obtained in real time, or multiple sets of transaction data may be obtained in real time.
[0072] When multiple sets of transaction data are obtained, step S120 is specifically performed as follows:
[0073] The earliest transaction time among the multiple groups of transaction data is used as the time of the exposure section to be inserted.
[0074] It should be noted that, before step S110, the foreign exchange transaction exposure statistics method further includes:
[0075] At a set time, the transaction data before the set time is counted, and the transaction data obtained by the statistics is used to build the initial version of the Merkle tree branch chain, and the corresponding root node information is obtained.
[0076] The set time may be 5 a.m. every day, or other time, and may be set according to business needs.
[0077] As mentioned above, it is necessary to use a verification center to verify the authenticity of the transaction data. Accordingly, as a second aspect of the present invention, a foreign exchange transaction exposure statistics method is provided for use in a verification center, wherein, Figure 2 As shown, the foreign exchange trading exposure statistical method includes:
[0078] In step S210, a hash value of transaction data is received;
[0079] In step S220, a plurality of root node information is received, wherein the root node information is the root node information of a Merkle tree branch, and the root node information includes a root node hash value and a corresponding statistical dimension, and the root node hash value is a hash value obtained by constructing a Merkle tree branch according to the statistical dimension using all transaction data after the open section inserted into the transaction data in the statistical database;
[0080] In step S230, a Merkle tree branch is constructed using the hash value of the received transaction data according to the statistical dimension. The root node information of the constructed Merkle tree branch includes the hash value and the corresponding dimension information.
[0081] In step S240, the root node information of the Merkle tree constructed by the verification center is compared with the received root node information, and a verification result is generated. If the received root node information is consistent with the root node information of the Merkle tree branch constructed by the verification center, the verification result is passed.
[0082] In step S250, the verification result is sent to the monitoring node.
[0083] It should be noted that the hash value received in step S210 is the hash value sent by the packaging node in step S140. The root node information received in step S230 is the root node information sent by the packaging node in step S160.
[0084] By setting up a verification center, the authenticity and validity of transaction data obtained in real time can be verified.
[0085] In step S230, a Merkle tree branch is constructed using the received hash value. In step S240, the root node information of the Merkle tree branch constructed by the verification center itself is compared with the received root node information. If the verification passes, it indicates that the transaction data involved in the statistics is real and has not been tampered with.
[0086] Furthermore, the foreign exchange transaction exposure statistics method may further include:
[0087] After step S210, the hash value of the received transaction data is compared with the leaf node of the existing Merkle tree branch in the verification center, and the transaction data that has been counted and the transaction data that has been re-added are confirmed based on the comparison result.
[0088] Before executing step S210, the verification center has already stored the previous version of the Merkle tree branch. The current version of the Merkle tree branch is constructed and stored in step S230. As described above, the packaging node uses all transaction data after the exposure section inserted by the real-time transaction data to construct the Merkle tree branch. Therefore, what is received in step S210 is also the hash value of all transaction data after the exposure section. By comparing the received hash value with the leaf node of the previous version of the Merkle tree branch, the difference data is the transaction data inserted into the re-executed foreign exchange transaction exposure statistics. The hash value repeated with the leaf node of the previous version of the Merkle tree branch is the transaction value that has been counted in the previous exposure statistics. By "using the leaf node of the Merkle tree branch that already exists in the verification center to compare with the hash value of the received transaction data", it is also possible to confirm whether the previous foreign exchange transaction exposure statistics are accurate and whether the statistical results have been tampered with.
[0089] As a third aspect of the present invention, a foreign exchange transaction exposure statistics method is provided for monitoring nodes, wherein: Figure 3 As shown, the foreign exchange trading exposure statistical method includes:
[0090] In step S310, a verification result issued by the verification center is received, wherein the verification result is generated by comparing the root node information of the Merkle tree branch constructed by the verification center using the hash value of the received transaction data with the received root node information;
[0091] In step S320, if the verification result indicates that the verification is passed, the root node information of the corresponding Merkle tree branch chain is publicized as the statistical main chain information, wherein the corresponding transaction data can be restored and obtained from the publicized root node information of the statistical main chain.
[0092] It should be noted that the verification result received in step S310 is the verification result sent in step S250. The monitoring node only publicizes the root node information that has passed the verification.
[0093] External business nodes can restore the corresponding transaction data through the publicly disclosed root node information, aggregate the transaction data, and import it into the statistical database to finally complete the foreign exchange transaction exposure statistics.
[0094] The foreign exchange transaction exposure statistics method provided by the embodiment of the present invention is explained and illustrated below with reference to the accompanying drawings.
[0095] In the embodiment of the present invention, the transaction data stored in the statistical database is in the form of a time series. As an optional implementation, Figure 4 As shown, the statistical device performs open section statistics at 5:00 AM every day. Assuming today is April 30, 2025, all transaction data up to April 29, 2025 can be counted at 5:00 AM, and a Merkle tree branch with version number v1 is constructed based on this. At 12:00 PM on April 30, 2025, another transaction data with a transaction date of April 2, 2025 is received. This transaction data is inserted after the open section of April 2, 2025 and imported into the statistical database. Then, all transaction data in the statistical database is used to construct a Merkle tree branch with version number v2.
[0096] Figure 5 Figure 1 shows a schematic diagram of the data structure stored in a block according to one embodiment of the present invention. As shown, the root node information carries not only the root node hash value but also statistical dimension information (currency pair, delivery date). The leaf nodes at the bottom level contain the hash values of all transaction data used to construct the Merkle tree branch. Specifically, the hash values of transaction 1, transaction 2, ..., transaction (2N-1), and transaction 2N are shown. By performing a hash operation on the hash values of each transaction data pair, we can obtain the hash values of node 1, ..., and so on, up to node N. By performing a hash operation on the hash values of each node, we can obtain the hash value of the root node.
[0097] Figure 6 , which is an interactive signaling diagram among a packaging node, a verification center, a monitoring node, and multiple external service nodes (for ease of understanding, the figure shows external service node 1 and external service node 2).
[0098] like Figure 6 As shown:
[0099] After the set time, external service node 1 and external service node 2 send the transaction data to the packaging node;
[0100] The packaging node performs hash operations on the transaction data and constructs a Merkle tree branch for all transaction data after the exposure section based on the statistical dimension to obtain the corresponding root node information;
[0101] Then the hash value of the node reward transaction data and the obtained root node information are packaged and sent to the verification center;
[0102] The verification center verifies the root node information and sends the verification results to the monitoring node;
[0103] The monitoring node publicizes the verified root node information;
[0104] The external business node (external business node 1 and / or external business node 2) pulls the root node information from the monitoring node based on statistical requirements and restores the transaction data;
[0105] External business nodes aggregate the restored transaction data into the statistical database to complete foreign exchange transaction exposure statistics.
[0106] Figure 7 Figure 2 shows a schematic diagram of the data structure stored in a block according to another embodiment of the present invention. As shown, the root node information contains not only the root node hash value and statistical dimension information (currency pair, delivery date), but also statistical data. The leaf nodes at the bottom level contain the hash values of all transaction data used to construct the Merkle tree branch. Specifically, the hash values of transaction 1, transaction 2, ..., transaction (2N-1), and transaction 2N are shown. By performing a hash operation on the hash values of each transaction data pair, we can obtain the hash values of node 1, ..., and so on, up to node N. By performing a hash operation on the hash values of each node, we can obtain the hash value of the root node.
[0107] exist Figure 7 In the implementation shown in [1], external service nodes can obtain statistical data without having to reverse engineer the root node information. Once the monitoring node verifies the authenticity of the root node hash value stored in the block, it can directly pull the statistical data stored in the block and aggregate it into the statistical database, completing the foreign exchange trading exposure statistics.
[0108] As a third aspect of the present invention, an electronic device is provided, such as Figure 8 As shown, the electronic device includes:
[0109] One or more processors 101;
[0110] The storage module 102 stores an executable program, and when the one or more processors 101 call the executable program, it can implement the foreign exchange transaction exposure statistics method described in at least one of the first to third aspects of the present invention.
[0111] When the electronic device implements the foreign exchange trading exposure statistics method provided in the first aspect of the present invention, the electronic device serves as a packaging node. When the electronic device implements the foreign exchange trading exposure statistics method provided in the second aspect of the present invention, the electronic device serves as a verification center. When the electronic device implements the foreign exchange trading exposure statistics method provided in the third aspect of the present invention, the electronic device serves as a monitoring node.
[0112] The electronic device may further include one or more I / O interfaces 103 connected between the processor 101 and the memory 102 and configured to implement information exchange between the processor 101 and the memory 102 .
[0113] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the processor and the memory, including but not limited to a data bus (Bus), etc.
[0114] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the electronic device.
[0115] As a fourth aspect of the present invention, Figure 9 As shown, a computer-readable medium is provided, on which one or more computer programs are stored. When the one or more computer programs are called, the foreign exchange transaction exposure statistics method described in at least one of the first to third aspects of the present invention can be implemented.
[0116] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when the computer program is executed, it can implement the method of any of the above-mentioned embodiments. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0117] These are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modifications that do not deviate from the functional and structural principles of the present invention are included within the scope of the claims.
Claims
1. A foreign exchange trading exposure statistics method for packaging nodes, characterized in that: The exposure statistical methods include: Receive at least one set of transaction data in real time; Determining the time of the exposure section into which the real-time received transaction data is to be inserted according to the transaction time of the real-time received transaction data; Inserting all transaction data received in real time after the exposure section; Perform hash operations on the transaction data received in real time to obtain the corresponding hash value, and send the obtained hash value to the verification center; Based on the statistical dimension, all transaction data after the exposed section in the statistical database is used to construct Merkle tree branches respectively, and obtain root node information of each Merkle tree branch, wherein the root node information of the Merkle tree branch includes a root node hash value and corresponding statistical dimension information; The root node information of each of the Merkle tree branches is sent to the verification center.
2. The foreign exchange transaction exposure statistics method according to claim 1, characterized in that: In the case of receiving multiple sets of transaction data, determining the time of the open section to be inserted into the transaction data according to the transaction time of the transaction data received in real time includes: The earliest transaction time among the multiple groups of transaction data is used as the time of the exposure section to be inserted.
3. The foreign exchange transaction exposure statistics method according to claim 1, characterized in that: The method of constructing Merkle tree branches based on the statistical dimension using the transaction data in the statistical database includes: Clustering all transaction data after the exposure section in the statistical database according to statistical dimensions to obtain statistical data; Corresponding Merkle tree branches are constructed using statistical data, wherein root node information of multiple Merkle tree branches is stored in different blocks respectively.
4. The foreign exchange transaction exposure statistics method according to any one of claims 1 to 3, characterized in that: The statistical dimensions include a currency pair dimension and a delivery time dimension, and the transaction data includes a transaction identifier, transaction time, delivery time, and currency pair.
5. The foreign exchange transaction exposure statistics method according to any one of claims 1 to 3, characterized in that: The root node information also includes statistical data, which is data obtained by clustering all transaction data after the exposure section according to statistical dimensions.
6. A foreign exchange trading exposure statistics method for use in a verification center, characterized in that: The statistical method for foreign exchange trading exposure includes: Receive the hash value of the transaction data; Receive multiple root node information, wherein the root node information is the root node information of a Merkle tree branch, and the root node information includes a root node hash value and a corresponding statistical dimension, and the root node hash value is a hash value obtained by constructing the Merkle tree branch according to the statistical dimension using all transaction data after the open section inserted by the transaction data in the statistical database; Based on the statistical dimension, the hash value of the received transaction data is used to construct a Merkle tree branch chain. The root node information of the constructed Merkle tree branch chain includes the hash value and the corresponding dimension information. Comparing the root node information of the Merkle tree constructed by the verification center with the received root node information, and generating a verification result, wherein if the received root node information is consistent with the root node information of the Merkle tree branch constructed by the verification center, the verification result is passed; The verification result is sent to the monitoring node.
7. The foreign exchange transaction exposure statistics method according to claim 6, characterized in that: The statistical dimensions include a currency pair dimension and a delivery time dimension, and the transaction data includes a transaction identifier, transaction time, delivery time, and currency pair.
8. A foreign exchange trading exposure statistics method for monitoring nodes, characterized in that: The statistical method for foreign exchange trading exposure includes: Receiving a verification result issued by the verification center, wherein the verification result is generated by comparing the root node information of the Merkle tree branch chain constructed by the verification center using the hash value of the received transaction data with the received root node information; If the verification result indicates that the verification is passed, the root node information of the corresponding Merkle tree branch chain is publicized as the statistical main chain information, wherein the corresponding transaction data can be restored and obtained from the publicized root node information of the statistical main chain.
9. An electronic device, comprising: one or more processors; A storage module having an executable program stored thereon, which can implement the foreign exchange transaction exposure statistics method according to any one of claims 1 to 8 when the one or more processors call the executable program.
10. A computer-readable medium, characterized in that One or more computer programs are stored thereon, and when the one or more computer programs are called, the foreign exchange transaction exposure statistics method according to any one of claims 1 to 8 can be implemented.
Citation Information
Patent Citations
Merkel tree-based transaction account checking method and system
CN114266578A
Tamper-proof block chain data storage method and system
CN115081031A