CN115358825A - Matching transaction method and system based on block chain prediction machine - Google Patents

Matching transaction method and system based on block chain prediction machine Download PDF

Info

Publication number
CN115358825A
CN115358825A CN202211037400.0A CN202211037400A CN115358825A CN 115358825 A CN115358825 A CN 115358825A CN 202211037400 A CN202211037400 A CN 202211037400A CN 115358825 A CN115358825 A CN 115358825A
Authority
CN
China
Prior art keywords
hash value
transaction
matching
transaction information
verified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211037400.0A
Other languages
Chinese (zh)
Inventor
王罗
蔡元纪
张险峰
于傲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
China Three Gorges Corp
Original Assignee
Tsinghua University
China Three Gorges Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University, China Three Gorges Corp filed Critical Tsinghua University
Priority to CN202211037400.0A priority Critical patent/CN115358825A/en
Publication of CN115358825A publication Critical patent/CN115358825A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Marketing (AREA)
  • Databases & Information Systems (AREA)
  • Water Supply & Treatment (AREA)
  • Public Health (AREA)
  • Human Resources & Organizations (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Tourism & Hospitality (AREA)
  • Primary Health Care (AREA)
  • Development Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a matching transaction method and system based on a block chain prediction machine, wherein the method comprises the following steps: each buyer and each seller upload transaction information to the block chain in sequence; sequentially updating a first increment hash value in the intelligent contract according to the hash value of the transaction information; calling the under-chain computing system through the prediction machine so that the under-chain computing system can compute a second incremental hash value according to the hash value of each transaction message, wherein the computing mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second incremental hash value to a block chain; and verifying the matching result to be verified by using the first increment hash value, the second increment hash value and the preset matching rule through the intelligent contract to determine the matching result. By implementing the invention, the safety of the transaction information is improved, and the matching efficiency of matching transactions is improved.

Description

Matching transaction method and system based on block chain prediction machine
Technical Field
The invention relates to the technical field of energy trading, in particular to a matching trading method and system based on a block chain prediction machine.
Background
According to the prior art and development, a block chain based matching transaction generally takes two implementation paths: one method is to realize ordering and matching transaction in the intelligent contract, and the other method is to establish an application layer exchange, and only a block chain is used for storing evidence. The disadvantages of each of the two methods are: the first method has the disadvantages that when the data volume is large, gas is consumed greatly, the speed is low, the follow-up transaction is influenced, and even the contract calling fails, so that the matching transaction fails. The second method transaction may be tampered in the upper layer application, and the blockchain evidence may not achieve the evidence preservation effect. Therefore, in the prior art, safe and quick matching transaction cannot be realized through the blockchain.
Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that a safe and fast matching transaction cannot be realized through a blockchain, so as to provide a matching transaction method and system based on a blockchain predictor.
The invention provides a block chain prediction machine-based matchmaking transaction method, which comprises the following steps: each buyer and each seller upload transaction information to the block chain in sequence; sequentially updating a first increment hash value in the intelligent contract according to the hash value of the transaction information; calling the down-link computing system through the prediction machine so that the down-link computing system computes a second incremental hash value according to the hash value of each transaction message, wherein the computing mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second incremental hash value to a block chain; and verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and a preset matching rule through the intelligent contract, and if the matching result to be verified passes the verification, judging the matching result to be verified as the matching result.
Optionally, in the matchmaking transaction method based on the blockchain predictor provided by the present invention, the nth transaction information uploaded to the blockchain includes a pre-hash value, where the pre-hash value is a hash value of the (n-1) th transaction information uploaded to the blockchain, and n is an integer greater than 1.
Optionally, in the method for matching transaction based on the blockchain predictive agent provided by the present invention, when the predictive agent calls the offline computing system, the pre-hash value in the last transaction information is sent to the offline computing system through the predictive agent, so that the offline computing system obtains a plurality of transaction information according to the pre-hash value in the last transaction information.
Optionally, in the matchmaking transaction method based on the blockchain prediction machine provided by the invention, when the first transaction information is uploaded to the blockchain, the first incremental hash value in the intelligent contract is calculated according to the hash value of the current transaction information; when the nth transaction information is uploaded to the block chain, the first increment hash value in the intelligent contract is obtained through calculation according to the hash value of the nth transaction information and the corresponding first increment hash value when the (n-1) th transaction information is uploaded to the block chain.
Optionally, in the block chain predictive-based matchmaking transaction method provided by the present invention, verifying a match result to be verified by using the first incremental hash value, the second incremental hash value, and a preset match rule, and if the match result passes the verification, determining the match result to be verified as a match result, includes: comparing the second delta hash value to the first delta hash value; if the second incremental hash value is the same as the first incremental hash value, verifying the matching result to be verified according to a preset matching rule to obtain a verification result; and if the matching result to be verified meets the preset matching rule according to the verification result, judging the matching result to be verified as the matching result.
Optionally, in the method for matching transaction based on blockchain prediction machine provided by the present invention, the transaction information includes quoted price and transaction type, the transaction information type includes quoted price and withdrawn quoted price, and after the step of uploading the transaction information to the blockchain in turn by each buyer and seller, before the step of calling the off-chain computing system by the prediction machine, the method further includes: when the transaction information is quotation information, adding 1 to the transaction frequency of the transaction corresponding to the transaction information; and when the transaction information is the revocation quotation information, subtracting 1 from the transaction frequency of the transaction corresponding to the transaction information.
Optionally, in the block chain predictive engine-based matching transaction method provided by the present invention, the matching result to be verified includes multiple effective transactions, the matching result to be verified is verified by using the first incremental hash value, the second incremental hash value and the preset matching rule, and if the matching result to be verified passes the verification, before the step of determining the matching result to be verified as the matching result, the method further includes: traversing each effective transaction, and subtracting 1 from the transaction frequency of the transaction corresponding to the effective transaction; and after traversing all effective transactions in the matching result to be verified, if the transaction frequency of each transaction is 0, executing a step of judging the matching result to be verified as the matching result.
The invention provides a block chain prediction machine-based match transaction system in a second aspect, which comprises: the system comprises a chain-down computing system, a first incremental hash value computing node, a chain-down computing system calling node, a verification node, a plurality of buyer nodes and seller nodes, wherein the first incremental hash value computing node, the chain-down computing system calling node, the verification node, the plurality of buyer nodes and the plurality of seller nodes are positioned in the same block chain, and each buyer node and each seller node are used for sequentially uploading transaction information to the block chain; the first incremental hash value calculation node is used for sequentially updating the first incremental hash values in the intelligent contract according to the hash values of the transaction information; the chain lower computing system calling node is used for calling the chain lower computing system through the prediction machine so that the chain lower computing system can calculate a second incremental hash value according to the hash value of each transaction message, and the calculation mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second incremental hash value to a block chain; the verification node is used for verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and the preset matching rule through the intelligent contract, and if the verification is passed, the matching result to be verified is judged as the matching result.
A third aspect of the present invention can provide a computer apparatus comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to perform the method for blockchain predictive-based matchmaking transaction as provided by the first aspect of the invention.
A fourth aspect of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for matching transactions based on blockchain speakers as provided in the first aspect of the present invention.
The technical scheme of the invention has the following advantages:
according to the matching transaction method and system based on the block chain prediction machine, after transaction information is uploaded to a block chain by each buyer and each seller, the prediction machine calls a calculation system under the chain, in the calculation system under the chain, the transaction information of the buyer and the transaction information of the seller are matched according to preset matching rules to obtain a result to be verified, the matching result to be verified is uploaded to the block chain, in the block chain, the verification result to be verified is verified through an intelligent contract to obtain a final matching result. In addition, in the block chain prediction machine-based matching transaction method and system provided by the invention, the second incremental hash value can be calculated in the same calculation mode as the first incremental hash value when the under-chain calculation system matches and matches the transaction information, and when the matching result to be verified is verified through an intelligent contract, the first incremental hash value and the second incremental hash value can be combined for verification, so that the matching transaction result to be verified is obtained according to all the transaction information uploaded to the block chain in a matching manner, and the reliability of the matching result is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating an exemplary method for matching transactions based on a blockchain predictive agent according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an exemplary method for matching transactions using a multi-user voting mechanism according to an embodiment of the present invention;
fig. 3 is a matching result obtained by executing the block chain prediction machine-based matching transaction method provided by the embodiment of the present invention;
FIG. 4 is a schematic block diagram of a specific example of a blockchain predictive-based matchmaking transaction system according to an embodiment of the invention;
fig. 5 is a schematic block diagram of a specific example of a computer device in the embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The embodiment of the invention provides a matching transaction method based on a block chain prediction machine, which comprises the following steps of:
step S11: each buyer and seller in turn uploads transaction information to the blockchain.
Step S12: and sequentially updating the first increment hash value in the intelligent contract according to the hash value of the transaction information.
In an alternative embodiment, each time transaction information is uploaded to the blockchain, the first delta hash value in the intelligent contract is updated according to the current transaction information.
Step S13: calling the down-link computing system through the prediction machine so that the down-link computing system computes a second incremental hash value according to the hash value of each transaction message, wherein the computing mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; and uploading the matching result to be verified and the second incremental hash value to the block chain.
In an alternative embodiment, the down-link computing system may be any computer device with computing capability, and is not limited in this embodiment of the present invention.
In an optional embodiment, when the second incremental hash value is calculated, the used calculation formula is the same as the formula used when the first incremental hash value is calculated, and the calculation order of the transaction information is also the same, for example, if every transaction information is uploaded to the block chain, and the first incremental hash value in the intelligent contract is updated once, it indicates that the first incremental hash value is obtained by calculating the hash value of the transaction information according to the order in which the transaction information is uploaded to the block chain, and at this time, when the second incremental hash value is calculated, the hash value of each transaction information is also calculated according to the order in which each transaction information is uploaded to the block chain, so that the second incremental hash value is obtained.
In an optional embodiment, the preset matching rule may be set according to an actual requirement, and for example, the preset matching rule may be: the buyer price is not less than the seller price.
Step S14: and verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and a preset matching rule through the intelligent contract, and if the matching result to be verified passes the verification, judging the matching result to be verified as the matching result.
According to the matching transaction method based on the block chain prediction machine provided by the embodiment of the invention, after transaction information is uploaded to a block chain by each buyer and each seller, the prediction machine calls a calculation system under the chain, in the calculation system under the chain, the transaction information of the buyer and the transaction information of the seller are matched according to a preset matching rule to obtain a result to be verified, the matching result to be verified is uploaded to the block chain, in the block chain, the verification result to be verified is verified through an intelligent contract to obtain a final matching result. In addition, in the matchmaking transaction method based on the blockchain predictive engine provided by the embodiment of the invention, the second incremental hash value is calculated in the same calculation mode as the first incremental hash value when the under-chain calculation system matches and matches the transaction information, and when the match result to be verified is verified through the intelligent contract, the first incremental hash value and the second incremental hash value are combined for verification, so that the match transaction result to be verified is obtained according to all the transaction information uploaded to the blockchain in a matching manner, and the reliability of the match result is further improved.
In an optional embodiment, in the matchmaking transaction method based on the blockchain prediction machine provided in the embodiment of the present invention, the nth transaction information uploaded to the blockchain includes a pre-hash value, where the pre-hash value is a hash value of the (n-1) th transaction information uploaded to the blockchain, and n is an integer greater than 1.
In an alternative embodiment, the hash value of the last transaction information may be recorded into the smart contract.
In the embodiment of the invention, the pre-Hash value is written in the transaction information, so that the chained storage of the transaction information is realized, and all transaction information can be acquired by traversing the Hash value of the last transaction information forward.
In an optional embodiment, the transaction information further includes (price, type, currentTimestamp, info, preHash), where the price represents the transaction price, the type represents the transaction type, currentTimestamp represents the current transaction time, info represents the service information, and the service information includes trader information, the transaction type, the transaction remarks, and the like.
In an optional embodiment, in the block chain prediction machine-based match transaction method provided in the embodiment of the present invention, when the prediction machine calls the offline calculation system, the prefix hash value in the last transaction information is sent to the offline calculation system through the prediction machine, so that the offline calculation system obtains a plurality of transaction information according to the prefix hash value in the last transaction information, and thus the offline calculation system can complete match transactions according to all transaction information.
In an optional embodiment, in the method for matching transactions based on a blockchain prediction machine provided in the embodiment of the present invention, when first transaction information is uploaded to a blockchain, a first incremental hash value in an intelligent contract is calculated according to a hash value of current transaction information; when the nth transaction information is uploaded to the blockchain, the first incremental hash value in the intelligent contract is obtained through calculation according to the hash value of the nth transaction information and the corresponding first incremental hash value when the (n-1) th transaction information is uploaded to the blockchain.
For example, if there are 4 transactions A, B, C, D, their hash values are w, x, y, z, respectively. The update of the first hash value h is the process:
h1= hash (w) (first ratio transaction has no pre-hash value)
h2=hash(x+h1)
h3=hash(y+h2)
h4= hash (z + h 3), when contract internal h is h4.
And finally, h4 is stored on the chain, and the calculation system under the chain can acquire all the previous transaction information through h4.
In an optional embodiment, the step S14 specifically includes the following steps:
the second delta hash value is first compared to the first delta hash value.
And if the second incremental hash value is the same as the first incremental hash value, verifying the matching result to be verified according to a preset matching rule to obtain a verification result.
Because the second incremental hash value and the first incremental hash value are calculated in the same way, if the second incremental hash value is different from the first incremental hash value, the transaction information used when the second incremental hash value is calculated is different from the transaction information used when the first incremental hash value is calculated, so that the matching result to be verified is not obtained according to the transaction information in the block chain, and at the moment, the matching result to be verified can be judged to be incorrect without further verification according to the matching rule.
And if the matching result to be verified meets the preset matching rule according to the verification result, judging the matching result to be verified as the matching result.
In an optional embodiment, in the method for matching transactions based on a blockchain prediction machine provided by the embodiment of the invention, the transaction information includes an offer price and a transaction type, and the transaction information type includes offer information and withdrawal offer information.
In an optional embodiment, the core methods of the intelligent contract are three, namely Add, revoke and call, and the corresponding functions are three functions of quotation, quotation withdrawal and trade matching. The method called by the prediction machine is an external method Match and is used for matching transaction. The three methods are implemented on the same intelligent contract, quotation and quotation withdrawal are carried out by quotation parties by calling add and rewind methods, and after a transaction is stopped, the matching party calls a calculate interface to match, wherein when a seller or a buyer calls the add method, the type of the transaction information uploaded to the block chain is quotation information, and when the seller or the buyer calls the rewind method, the type of the transaction information uploaded to the block chain is quotation withdrawal information.
add (price, type, info) quote method, where price is quote price including quote and quantity, type is transaction type, and info generally contains service information such as trader information, transaction type, transaction remark, etc. revoke (price, type, info) revokes the corresponding offer according to the service (price, type, info).
After the step of uploading the transaction information to the blockchain and before the step of calling the offline computing system through the prediction machine after the step of uploading the transaction information to the blockchain by each buyer and each seller, the method provided by the embodiment of the invention further comprises the following steps:
when the transaction information is quotation information, adding 1 to the transaction frequency of the transaction corresponding to the transaction information; and when the transaction information is the revocation quotation information, subtracting 1 from the transaction frequency of the transaction corresponding to the transaction information.
In the embodiment of the invention, the data statistics map statistics quotation frequency is added in the contract, so that whether the data is missing or added redundantly or not is checked when the data is verified.
The pseudo code of the add method is:
Figure BDA0003818449800000111
the revoke method is realized as follows:
when a transaction body cancels a transaction during a matching transaction, a certain price is removed in the transaction to be matched. Similar to the add method, the transaction cancellation message is first sent on the blockchain, and then the quote is reduced by one in the map. In practice, the transaction can be marked as a withdrawn transaction in the transaction information body, and when the transaction is matched under the chain, the transaction is read according to the quotation sequence, so that no null deletion is caused. Meanwhile, since the withdrawn transactions exist in pairs, the operation of adding one and subtracting one at a time is only completed in frequency, and the frequency table is not influenced in whole.
The revoke method pseudo-code is:
Figure BDA0003818449800000121
in an optional embodiment, in the method for matching transactions based on a blockchain prediction machine according to an embodiment of the present invention, a matching result to be verified includes multiple valid transactions, where a valid transaction refers to an offer that is not revoked, in step S14, in the embodiment of the present invention, when the step S14 is executed, a matching result to be verified is verified by using a first incremental hash value, a second incremental hash value, and a preset matching rule, and if the verification passes, before the step of determining the matching result to be verified as the matching result, the method further includes:
and traversing each effective transaction, reducing the transaction frequency of the transaction corresponding to the effective transaction by 1, and after the traversal of all the effective transactions in the matching result to be verified is completed, if the transaction frequency of each transaction is 0, executing the step of judging the matching result to be verified as the matching result.
In an optional embodiment, if the external matching approval is further enhanced, as shown in fig. 2, a multi-user voting mechanism may be adopted, that is, a plurality of external interfaces are called, calculation is performed simultaneously, the matching results obtained by the external interfaces are verified, and verification results corresponding to the matching results are obtained, if the matching results are consistent and the verification results are also consistent, each node (including but not limited to a buyer and a seller) in the block chain votes for the matching results, and after the number of agreeing tickets reaches a preset value, the matching results are determined as final matching results; if the matching results are inconsistent or the verification results are inconsistent, other third parties are adopted to match without voting, and a new round of voting is carried out.
The pseudocode for the calculate method is:
Figure BDA0003818449800000131
in a specific embodiment, after sorting according to the transaction prices in the transaction information, matching transactions are performed according to the rule that the seller offer is not lower than the seller offer, and the result shown in fig. 3 is obtained, where the line in fig. 3 is a successfully matched transaction. In the embodiment of the invention, the matching is mainly to be sorted, after the sorting is finished, the verification of the data integrity is only required to finish the frequency statistics of the prices of the buyer and the seller, for example, for the buyer quotation 10.5 and the quantity 100, the combination is that the price is added with one in the frequency statistics table.
After the ordering is finished, the interior of the contract only needs to be matched and traversed according to the highest price of the buyer and the seller, and if the price of the buyer is more than or equal to the price of the buyer, the number of the buyer is matched, and the match is carried out according to the maximum transaction volume. For example, in the table shown in fig. 3, 10.1 deals with 600 max seller deals, and the remainder 200 deals with seller quote 10, it can be seen that in the embodiment of the present invention, only the buyer and the seller need to match from top to bottom. Each bid traverses at most once, so the overall complexity of validation in the blockchain is the linear complexity O (n).
In terms of time complexity, the most complex operations of the three methods in the embodiment of the invention are all operations on a hash table hashmap, so that all add and revoke operations of the buyer and the seller are performed for n times, the total time complexity is O (n), the introduction of the complexity of a sequencing algorithm is avoided, the external sequencing can be freely optimized, and the logical decoupling is completed.
In the verification of matching transaction in the checkmatchmatchMatchResult of the study, only two sides of a buyer and a seller need to be scanned simultaneously to verify the size, the prefix and the relationship. Let the number of business-to-business operations be a, b, then a + b = n, so the total complexity is O (mac (a, b)) = O (n).
The sequencing correctness can be verified according to a mathematical induction method only by sequentially comparing front and back elements.
And in the verification time complexity, knowing that the frequency of all quotes is f, sequentially subtracting the frequency of corresponding elements in f from the sorted sequence, and finally if the frequency of all elements in f is 0, indicating that all elements are not involved in sorting in a leakage-free manner, namely the integrity of the matching transaction is proved.
Therefore, by implementing the method and the device, matching transaction can be completed, the safety of data is guaranteed, and the calculation loss in the block chain is effectively reduced.
The embodiment of the invention provides a matchmaking transaction system based on a block chain prediction machine, which comprises the following components as shown in fig. 4: a down-link computing system 21, and a first delta hash value computing node 24, a down-link computing system invocation node 25, a verification node 26, a plurality of buyer nodes 22 and seller nodes 23 located in the same blockchain, wherein,
each of the buyer node 22 and the seller node 23 is configured to upload the transaction information to the block chain in turn, and the details refer to the description of step S11 in the above embodiment, which is not described herein again.
The first incremental hash value calculation node 24 is configured to sequentially update the first incremental hash values in the intelligent contract according to the hash value of the transaction information, for details, refer to the description of step S12 in the foregoing embodiment, and details are not described here again.
The down-link computing system calling node 25 is configured to call the down-link computing system 21 through the predicting machine, so that the down-link computing system 21 calculates a second incremental hash value according to the hash value of each transaction information, and the calculation mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second incremental hash value to the block chain, where details refer to the description of step S13 in the above embodiment and are not described herein again.
The verification node 26 is configured to verify the matching result to be verified by using the first incremental hash value, the second incremental hash value, and the preset matching rule through the intelligent contract, and if the matching result to be verified passes the verification, determine the matching result to be verified as the matching result, for details, refer to the description of step S14 in the foregoing embodiment, and are not described herein again.
An embodiment of the present invention provides a computer device, as shown in fig. 5, the computer device mainly includes one or more processors 31 and a memory 32, where one processor 31 is taken as an example in fig. 5.
The computer device may further include: an input device 33 and an output device 34.
The processor 31, the memory 32, the input device 33 and the output device 34 may be connected by a bus or other means, and the bus connection is exemplified in fig. 5.
The processor 31 may be a Central Processing Unit (CPU). The Processor 31 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of the blockchain-based predictive agent matching transaction system, and the like. Further, the memory 32 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 32 may optionally include memory located remotely from the processor 31, which may be connected to the blockchain predictive-based matchmaking transaction system over a network. The input device 33 may receive a calculation request (or other numeric or character information) input by a user and generate a key signal input related to the blockchain predictive-based match transaction system. The output device 34 may include a display device such as a display screen for outputting the calculation result.
The embodiment of the invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions can execute the matching transaction method based on the blockchain prediction machine in any method embodiment. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. This need not be, nor should it be exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.

Claims (10)

1. A match transaction method based on a block chain prediction machine is characterized by comprising the following steps:
each buyer and each seller upload transaction information to the block chain in sequence;
sequentially updating a first increment hash value in the intelligent contract according to the hash value of the transaction information;
calling the under-chain computing system through the prediction machine so that the under-chain computing system can compute a second incremental hash value according to the hash value of each transaction message, wherein the second incremental hash value is computed in the same way as the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second increment hash value to a block chain;
and verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and a preset matching rule through an intelligent contract, and if the matching result to be verified passes the verification, judging the matching result to be verified as the matching result.
2. The blockchain predictive agent-based matchmaking transaction method of claim 1,
the nth transaction information uploaded to the blockchain comprises a pre-hash value, the pre-hash value is the hash value of the (n-1) th transaction information uploaded to the blockchain, and n is an integer greater than 1.
3. The blockchain predictive machine-based matchmaking transaction method of claim 2,
when the prediction machine calls the down-link computing system, the preposed hash value in the last transaction information is sent to the down-link computing system through the prediction machine, so that the down-link computing system obtains a plurality of transaction information according to the preposed hash value in the last transaction information.
4. The blockchain predictive machine-based matchmaking transaction method of claim 2,
when first transaction information is uploaded to the block chain, calculating a first incremental hash value in the intelligent contract according to the hash value of the current transaction information;
when the nth transaction information is uploaded to the block chain, the first increment hash value in the intelligent contract is obtained through calculation according to the hash value of the nth transaction information and the corresponding first increment hash value when the (n-1) th transaction information is uploaded to the block chain.
5. The blockchain predictive-based matching transaction method according to claim 1, wherein the verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and a preset matching rule, and if the verification is passed, determining the matching result to be verified as the matching result comprises:
comparing the second delta hash value to the first delta hash value;
if the second incremental hash value is the same as the first incremental hash value, verifying the matching result to be verified according to the preset matching rule to obtain a verification result;
and if the matching result to be verified meets the preset matching rule according to the verification result, judging the matching result to be verified as a matching result.
6. The blockchain predictive-based matchmaking transaction method of claim 1, wherein the transaction information comprises an offered price and a transaction type, the transaction information type comprises an offered price and a withdrawn price, and the method further comprises, after the step of uploading the transaction information to the blockchain in turn by each buyer and seller, before the step of calling the off-chain computing system through the predictive machine:
when the transaction information is quotation information, adding 1 to the transaction frequency of the transaction corresponding to the transaction information;
and when the transaction information is the revocation quotation information, subtracting 1 from the transaction frequency of the transaction corresponding to the transaction information.
7. The method for matching transactions based on a blockchain preplan machine according to claim 6, wherein the matching result to be verified comprises a plurality of valid transactions, the matching result to be verified is verified by using the first incremental hash value, the second incremental hash value and a preset matching rule, and if the verification is passed, before the step of determining the matching result to be verified as the matching result, the method further comprises:
traversing each effective transaction, and subtracting 1 from the transaction frequency of the transaction corresponding to the effective transaction;
and after traversing all effective transactions in the matching result to be verified, if the transaction frequency of each transaction is 0, executing a step of judging the matching result to be verified as the matching result.
8. A matchmaking transaction system based on a blockchain predictive agent, comprising: a down-link computing system, and a first delta hash value computing node, a down-link computing system invocation node, a verification node, a plurality of buyer nodes and seller nodes located in the same blockchain,
each buyer node and each seller node are used for sequentially uploading transaction information to the block chain;
the first increment hash value calculation node is used for sequentially updating a first increment hash value in the intelligent contract according to the hash value of the transaction information;
the chain down computing system calling node is used for calling the chain down computing system through the prediction machine so that the chain down computing system can calculate a second incremental hash value according to the hash value of each transaction message, and the calculation mode of the second incremental hash value is the same as that of the first incremental hash value; matching and matching the transaction information of the buyer and the transaction information of the seller according to a preset matching rule to obtain a matching result to be verified; uploading the matching result to be verified and the second increment hash value to a block chain;
the verification node is used for verifying the matching result to be verified by using the first incremental hash value, the second incremental hash value and a preset matching rule through an intelligent contract, and if the verification is passed, the matching result to be verified is judged as the matching result.
9. A computer device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to perform the method for blockchain predictive-based matchmaking as claimed in any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the method for blockchain predictive-based matchmaking transaction according to any one of claims 1-7.
CN202211037400.0A 2022-08-26 2022-08-26 Matching transaction method and system based on block chain prediction machine Pending CN115358825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211037400.0A CN115358825A (en) 2022-08-26 2022-08-26 Matching transaction method and system based on block chain prediction machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211037400.0A CN115358825A (en) 2022-08-26 2022-08-26 Matching transaction method and system based on block chain prediction machine

Publications (1)

Publication Number Publication Date
CN115358825A true CN115358825A (en) 2022-11-18

Family

ID=84005178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211037400.0A Pending CN115358825A (en) 2022-08-26 2022-08-26 Matching transaction method and system based on block chain prediction machine

Country Status (1)

Country Link
CN (1) CN115358825A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116051172A (en) * 2023-03-07 2023-05-02 天聚地合(苏州)科技股份有限公司 Data element auxiliary pricing method, device and system based on blockchain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116051172A (en) * 2023-03-07 2023-05-02 天聚地合(苏州)科技股份有限公司 Data element auxiliary pricing method, device and system based on blockchain
CN116051172B (en) * 2023-03-07 2023-08-08 天聚地合(苏州)科技股份有限公司 Data element auxiliary pricing method, device and system based on blockchain

Similar Documents

Publication Publication Date Title
CN108846659B (en) Block chain-based transfer method and device and storage medium
CN110121727B (en) Method and system for providing authenticated, auditable and immutable input for intelligent contracts
US20210049715A1 (en) Blockchain-based data procesing method, apparatus, and electronic device
CN108985772A (en) A kind of verification method, device, equipment and the storage medium of block chain
CN111815169B (en) Service approval parameter configuration method and device
CN115358825A (en) Matching transaction method and system based on block chain prediction machine
WO2022199076A1 (en) Service processing method for multiple types of services, computer device, and storage medium
CN107274284B (en) Bidirectional matching method and device and transaction system
CN113157479A (en) Data error correction method, system, device, equipment and storage medium
CN113962786A (en) Commodity bidding method, device and equipment based on block chain and storage medium
US20200304421A1 (en) Resource stabilization in a distributed network
CN115987799A (en) Method, device and equipment for expanding two-layer network of block chain
CN113689296A (en) Contract scheduling method and device for asynchronous trusted computing and electronic equipment
CN113760367A (en) Data processing method and device, electronic equipment and storage medium
CN111986033A (en) Equivalent expression identification method and identification device and terminal equipment
CN111324787A (en) Block chain data display method and device in block chain browser
CN117707936B (en) Multisystem multi-version full-link testing method, device, equipment and storage medium
CN114677186B (en) Offer calculation method and device for financial product, computer equipment and storage medium
CN114881546B (en) Method and device for determining resource consumption
CN115941693B (en) Method, device, equipment and medium for accessing chain group into blockchain
CN111080394B (en) Matching method, device and storage medium
CN117633313A (en) Document generation method, device, computer equipment and computer readable storage medium
CN115378954A (en) Block chain fragmentation method integrating spectral clustering and credit value mechanism
CN117331983A (en) Method, device, equipment and medium for searching overdue loan data
CN117114873A (en) Method, device, computer equipment and storage medium for determining resource conversion ratio

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination