CN117011052A - Transaction method, POS machine and transaction system based on intelligent contract - Google Patents

Transaction method, POS machine and transaction system based on intelligent contract Download PDF

Info

Publication number
CN117011052A
CN117011052A CN202310981132.6A CN202310981132A CN117011052A CN 117011052 A CN117011052 A CN 117011052A CN 202310981132 A CN202310981132 A CN 202310981132A CN 117011052 A CN117011052 A CN 117011052A
Authority
CN
China
Prior art keywords
transaction
verification
information
contract
blockchain network
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
CN202310981132.6A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310981132.6A priority Critical patent/CN117011052A/en
Publication of CN117011052A publication Critical patent/CN117011052A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G1/00Cash registers
    • G07G1/12Cash registers electronically operated
    • G07G1/14Systems including one or more distant stations co-operating with a central processing unit

Abstract

The embodiment of the specification relates to the field of blockchain, and provides a transaction method, a POS machine and a transaction system based on intelligent contracts, wherein the transaction method is applied to the POS machine registered in a blockchain network and comprises the following steps: generating information to be verified and transaction information according to the transaction request obtained by the POS machine; acquiring verification information required by verification through a relay server; executing contracts deployed in the blockchain network according to the information to be verified and the verification information, and verifying the information to be verified; broadcasting consensus is carried out on the verification result in the block chain network; when the verification result is that the verification is passed, the transaction information is sent to the banking system terminal to execute the transaction, and the transaction execution result returned by the banking system terminal is received; the validation results and transaction execution results are uplink in the blockchain network. The embodiment of the specification can solve the problems of off-line transaction mutual trust and long transaction time consumption, and ensure the safety and the controllability of the transaction all-link data.

Description

Transaction method, POS machine and transaction system based on intelligent contract
Technical Field
The embodiment of the specification relates to the field of blockchains, in particular to a transaction method, a POS machine and a transaction system based on intelligent contracts.
Background
At present, the acceptance of online payment such as code scanning, card swiping and mobile phone touching is to upload data to the cloud for transaction authentication, so that the problems of long time consumption, payment delay and the like are easy to occur in a high concurrency scene, meanwhile, the safety risks such as transaction data leakage and the like exist, cloud computing pressure cannot be shared for acceptance terminals such as a POS machine and the like, the whole transaction link is increased, and the transaction failure risk is increased.
Therefore, a transaction method based on intelligent contracts is needed, the problems of online transaction mutual trust and long transaction time consumption are solved, and the safety and the controllability of transaction all-link data are ensured.
Disclosure of Invention
The embodiment of the specification aims to provide a transaction method, a POS machine and a transaction system based on intelligent contracts, so as to solve the problems of off-line transaction mutual trust and long transaction time consumption and ensure the safety and the controllability of transaction all-link data.
To achieve the above object, in one aspect, an embodiment of the present disclosure provides a transaction method based on an intelligent contract, applied to a POS machine registered in a blockchain network, including:
generating information to be verified and transaction information according to the transaction request obtained by the POS machine;
acquiring verification information required by verification through a relay server;
executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified;
broadcasting consensus is carried out on the verification result in the block chain network;
when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received;
and the verification result and the transaction execution result are uplink in the blockchain network.
Preferably, the registration method of the POS machine in the blockchain network comprises the following steps:
after installing contracts in the blockchain network, submitting a hardware registration code of the POS machine to the blockchain network for registration;
after broadcasting consensus is carried out by a block chain network, registration is completed, and related information of the POS machine is uplink;
and after the registration is successful, receiving a key returned by the blockchain network, and locally storing the key.
Preferably, the contract deployment method in the blockchain network comprises the following steps:
acquiring a contract template issued by a block chain network;
selecting contract templates corresponding to users to sign up, and publishing the contract templates to a blockchain network for broadcast consensus;
encrypting the contract codes corresponding to the corresponding contract templates through the key and then locally storing the encrypted contract codes;
loading locally stored contract codes and compiling the contract codes into byte code files;
and after the compiling is successful, the contract deployment is completed.
Preferably, compiling the contract code into a byte code file further includes:
selecting a corresponding compiler according to the software and hardware environment of the POS machine;
and compiling the contract codes in a sectional loading way by combining stream type compiling and layered compiling.
Preferably, preconditions for contract deployment in the blockchain network include:
acquiring a time threshold value corresponding to a user when executing a contract;
after compiling the contract code into a byte code file, the blockchain network calculates the operation times required by the contract;
according to the operation times, the consumed time for the POS machine to complete one-time contract execution is calculated;
and deploying the contract when the elapsed time is below the time threshold.
Preferably, the step of linking the verification result and the transaction execution result in the blockchain network further includes:
the POS machine broadcasts the verification result and the transaction execution result to the whole network;
the block chain network performs three-stage verification, each node in each stage enters the next stage after receiving at least 2f+1 other node verification consistent messages, wherein the number of nodes in the block chain network is 3f+1, and f is the number of fault-tolerant nodes in the block chain network;
if the 2f+1 other nodes do not receive the message confirming the coincidence in any stage, the next stage is not entered;
and (5) after finishing three-stage verification, the chain is booted.
In another aspect, the present description provides a smart contract-based POS machine that registers in a blockchain network, including:
the generation unit is used for generating information to be verified and transaction information according to the transaction request obtained by the POS machine;
an acquisition unit configured to acquire authentication information required for authentication through a relay server;
the execution unit is used for executing contracts deployed in a blockchain network according to the information to be verified and the verification information and verifying the information to be verified;
the verification unit is used for carrying out broadcast consensus on the verification result in the block chain network;
the receiving unit is used for sending the transaction information to the banking system terminal to execute the transaction when the verification result is verification passing and receiving the transaction execution result returned by the banking system terminal;
and the uplink unit is used for uplink the verification result and the transaction execution result in the blockchain network.
In still another aspect, an embodiment of the present disclosure further provides a transaction system based on an intelligent contract, based on the POS machine described above, including:
the transaction terminal is used for initiating a transaction request to the POS machine;
the POS machine is registered in the blockchain network and is used for generating information to be verified and transaction information according to the transaction request obtained by the POS machine; acquiring verification information required by verification through a relay server; executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified; broadcasting consensus is carried out on the verification result in the block chain network; when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received; linking the validation result and transaction execution result in the blockchain network;
and the banking system terminal is used for executing the transaction and returning the transaction execution result to the POS machine.
In yet another aspect, embodiments of the present disclosure further provide a computer device including a memory, a processor, and a computer program stored on the memory, which when executed by the processor, performs instructions of any one of the methods described above.
In yet another aspect, embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of a computer device, performs instructions of any of the methods described above.
In yet another aspect, the present description embodiment also provides a computer program product, which when executed by a processor of a computer device, performs the instructions of any of the methods described above.
According to the technical scheme provided by the embodiment of the specification, the POS machine is registered in the blockchain network, the POS machine can generate the information to be verified and the transaction information by the transaction request, the verification result of the information to be verified is subjected to consensus verification in the blockchain network, the transaction can be executed through the banking system terminal after the verification is passed, and the verification result and the transaction execution result are linked up, so that the problems of mutual trust of off-line transaction and long time consumption of the transaction are solved, and the safety and controllability of the transaction all-link data are ensured.
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular description of preferred embodiments, as illustrated in the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a smart contract-based transaction method provided by embodiments of the present disclosure;
FIG. 2 is a flowchart illustrating a method for registering a POS machine in a blockchain network according to an embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of a contract deployment method in a blockchain network provided by embodiments of the present disclosure;
FIG. 4 is a flow chart illustrating compiling contract code into a byte code file according to an embodiment of the present disclosure;
FIG. 5 shows a flow diagram of a premise provided by an embodiment of the present description for embodying contract deployment in a blockchain network;
FIG. 6 illustrates a flow diagram provided by embodiments of the present disclosure for linking validation results and transaction execution results in a blockchain network;
FIG. 7 is a schematic diagram of a POS machine based on intelligent contracts according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an end-side contract processing module according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram showing another configuration of a POS machine based on smart contracts according to an embodiment of the present disclosure;
FIG. 10 is a schematic diagram showing a module structure of a transaction system of a smart contract according to an embodiment of the present disclosure;
fig. 11 shows a schematic structural diagram of a computer device provided in an embodiment of the present specification.
Description of the drawings:
100. a generating unit;
200. an acquisition unit;
300. an execution unit;
400. a verification unit;
500. a receiving unit;
600. a chaining unit;
111. a transaction main control module;
112. a card reading module;
113. a data receiving and transmitting module;
114. a voice broadcasting module;
115. a power supply module;
116. a printing module;
117. a touch screen display module;
118. a camera shooting module;
21. an end-side contract processing module;
211. a contract running sub-module;
212. a blockchain network transmission sub-module;
213. a data storage sub-module;
214. a computing force detection sub-module;
215. a conditional triggering sub-module;
1102. a computer device;
1104. a processor;
1106. a memory;
1108. a driving mechanism;
1110. an input/output module;
1112. an input device;
1114. an output device;
1116. a presentation device;
1118. a graphical user interface;
1120. a network interface;
1122. a communication link;
1124. a communication bus.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the embodiments herein, are intended to be within the scope of the embodiments herein.
At present, the acceptance of online payment such as code scanning, card swiping and mobile phone touching is to upload data to the cloud for transaction authentication, so that the problems of long time consumption, payment delay and the like are easy to occur in a high concurrency scene, meanwhile, the safety risks such as transaction data leakage and the like exist, cloud computing pressure cannot be shared for acceptance terminals such as a POS machine and the like, the whole transaction link is increased, and the transaction failure risk is increased.
In order to solve the above problems, embodiments of the present disclosure provide a transaction method based on smart contracts. FIG. 1 is a flow chart of a method of trading based on smart contracts provided by an embodiment of the present disclosure, which provides the method steps of operation as described in the examples or flow charts, but may include more or fewer steps of operation based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When a system or apparatus product in practice is executed, it may be executed sequentially or in parallel according to the method shown in the embodiments or the drawings.
It should be noted that the terms "first," "second," and the like in the description and the claims of the embodiments of the present specification and the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the present description described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
Referring to fig. 1, an embodiment of the present disclosure discloses a transaction method based on an intelligent contract, applied to a POS machine registered in a blockchain network, including:
s101: generating information to be verified and transaction information according to the transaction request obtained by the POS machine;
s102: acquiring verification information required by verification through a relay server;
s103: executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified;
s104: broadcasting consensus is carried out on the verification result in the block chain network;
s105: when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received;
s106: and the verification result and the transaction execution result are uplink in the blockchain network.
Generally, merchants support card swiping and consumption through a POS machine when selling commodities, and when a user swipes cards through the POS machine, a transaction request is initiated to the POS machine, the POS machine obtains the corresponding transaction request and generates information to be verified and transaction information. Wherein the transaction information may include user data: user name, identification card number, card data required for transaction: card number, card type, transaction data: transaction voucher number, transaction amount, transaction time, merchant data: merchant number, etc., wherein the information to be verified is at least a part of the transaction information, for example, may be user data and merchant data, and the content in the information to be verified needs to be verified.
During verification, a specific verification step can be executed through a relay server, the relay server and all POS machines in the blockchain network can communicate, user data in information to be verified is taken as an example, the relay server is connected with a central credit investigation system, verification information required by verification is obtained by inquiring credit investigation conditions of corresponding users according to user identity card numbers XXX, and the verification information is fed back to the corresponding POS machines.
The corresponding POS machine executes contracts deployed in the blockchain network to verify the information to be verified, specifically, specific contents of different contracts of the information to be verified are different, for example, if the credit investigation situation of the corresponding user is judged to be normal, the verification is passed, and if the credit investigation situation is abnormal, the verification is failed. After the POS machine verification is finished and a verification result is obtained, the verification result is subjected to consensus verification in the blockchain network so as to ensure the security of the transaction.
When the verification result is that the transaction information can be sent to the banking system terminal after the verification is passed, the banking system terminal is used for executing specific transaction content, for example, a user A pays the RMB 200 yuan to a merchant B through a POS machine card swiping, the banking system terminal executes specific payment operation, after the payment is completed, the transaction execution result is fed back to the POS machine, and the POS machine can further link the verification result and the transaction execution result, so that all nodes in the blockchain record corresponding results, and the consistency of the results and the transaction safety are ensured.
Through the content of the embodiment of the specification, the POS machine is registered in the blockchain network, the POS machine can generate information to be verified and transaction information from a transaction request, the verification result of the information to be verified is subjected to consensus verification in the blockchain network, after verification is passed, the transaction can be executed through a banking system terminal, and the verification result and the transaction execution result are linked up, so that the problems of off-line transaction mutual trust and long transaction time consumption are solved, and the safety and controllability of transaction all-link data are ensured.
In this embodiment of the present disclosure, referring to fig. 2, the method for registering a POS machine in a blockchain network includes:
s201: after installing contracts in the blockchain network, submitting a hardware registration code of the POS machine to the blockchain network for registration;
s202: after broadcasting consensus is carried out by a block chain network, registration is completed, and related information of the POS machine is uplink;
s203: and after the registration is successful, receiving a key returned by the blockchain network, and locally storing the key.
The installation can be completed by downloading the contract SDK installation package according to the configuration (CPU, memory, storage and the like) of the POS machine. The hardware registration code of the POS machine can be the MAC value of the POS machine, and the like, and broadcasting consensus is carried out on the blockchain network, so that the credibility of the POS machine can be ensured, the credibility of subsequent transactions is ensured, and after successful registration, the key returned by the blockchain network is received, and the subsequent encryption operation of a key user is carried out.
In the embodiment of the present specification, referring to fig. 3, the contract deployment method in the blockchain network includes:
s301: acquiring a contract template issued by a block chain network;
s302: selecting contract templates corresponding to users to sign up, and publishing the contract templates to a blockchain network for broadcast consensus;
s303: encrypting the contract codes corresponding to the corresponding contract templates through the key and then locally storing the encrypted contract codes;
s304: loading locally stored contract codes and compiling the contract codes into byte code files;
s305: and after the compiling is successful, the contract deployment is completed.
Taking N contracts for deployment into a blockchain network as an example: after initiating contract deployment, broadcasting N contracts to a blockchain network, the blockchain network including M consensus nodes, M being an integer greater than or equal to 1, the blockchain network configured to: and under the condition that the verification results of the M consensus nodes meet the deployment consensus condition, storing N contracts into the blockchain.
Illustratively, the M consensus nodes may perform consensus according to any consensus mechanism, such as POW workload certification, POS stock certificate, DPOS authorized stock certificate, PBFT practical bayer fault tolerance, proof of Participation, and the like, so as to achieve post-consensus chaining.
Wherein, referring to fig. 4, compiling the contract code into a byte code file further includes:
s401: selecting a corresponding compiler according to the software and hardware environment of the POS machine;
s402: and compiling the contract codes in a sectional loading way by combining stream type compiling and layered compiling.
The method has the advantages that by combining stream type and layered compiling, sectional loading of contract codes is realized, a section is loaded, a section is compiled, then the section is executed, starting speed is improved, sectional compiling optimization is carried out in the later stage, hot replacement is carried out, and starting operation efficiency of byte code files is further improved.
In the embodiment of the present specification, referring to fig. 5, preconditions for contract deployment in the blockchain network include:
s501: acquiring a time threshold value corresponding to a user when executing a contract;
s502: after compiling the contract code into a byte code file, the blockchain network calculates the operation times required by the contract;
s503: according to the operation times, the consumed time for the POS machine to complete one-time contract execution is calculated;
s504: and deploying the contract when the elapsed time is below the time threshold.
When a user submits a contract deployment request, a time threshold is required to be submitted when the contract is executed, after the blockchain network compiles the intelligent contract into a byte code file according to the WebAssemble standard, the operation times required by the contract are calculated, so that the time required by the POS machine to complete the contract execution once is obtained, and when the time threshold is lower than the time threshold when the contract is executed, the contract can be deployed.
In this embodiment of the present disclosure, referring to fig. 6, the step of uplink the verification result and the transaction execution result in the blockchain network further includes:
s601: the POS machine broadcasts the verification result and the transaction execution result to the whole network;
s602: the block chain network performs three-stage verification, each node in each stage enters the next stage after receiving at least 2f+1 other node verification consistent messages, wherein the number of nodes in the block chain network is 3f+1, and f is the number of fault-tolerant nodes in the block chain network;
s603: if the 2f+1 other nodes do not receive the message confirming the coincidence in any stage, the next stage is not entered;
s604: and (5) after finishing three-stage verification, the chain is booted.
The block chain network provides data services such as contract trusted storage, transaction verification, multiparty consensus and the like for the POS machine, the decentralized file storage is adopted, a plurality of nodes are deployed in the block chain network, all the nodes are responsible for receiving and forwarding information, each node of the block chain network adopts a Bayesian fault tolerance (PBFT) algorithm as a consensus mechanism to realize transaction consensus, each node is deployed according to a preset rule, and rule judgment is completed and corresponding processing is executed. For example, the number of nodes in a blockchain network is generally 3f+1, where f represents the number of fault-tolerant nodes supportable by the blockchain network, and is 1 at the minimum, because transaction consensus and determination by using the bayer fault tolerance (PBFT) algorithm are adopted, in the blockchain network with 3f+1 nodes, a master node is first selected, a new block is responsible for generating, each node broadcasts transaction information (verification result and transaction execution result) to the whole network, the master node sorts and stores a list of a plurality of transaction information collected from the network and to be placed in the new block, and broadcasts the list to the whole network, but in the blockchain network of the federation, three stages of submission and verification must be performed, and each stage receives at least 2f+1 consistent acknowledgement messages from other nodes, and then enters the next stage. If 2f+1 identical acknowledgement messages from other phases cannot be received in any phase, the acknowledgement message is not sent continuously. After three stages are completed, the transaction is considered as consensus, and the new block and the local blockchain and state database of the transaction update can be submitted.
In this embodiment of the present disclosure, referring to fig. 7, the pos machine includes a transaction main control module 111, a card reading module 112, a data transceiver module 113, a voice broadcast module 114, a power supply module 115, a printing module 116, a touch screen display module 117, a camera shooting module 118, and an end contract processing module 21.
Transaction master control module 111: as the core module of the device, it is connected with the card reading module 112, the data transceiver module 113, the voice broadcast module 114, the power supply module 115, the printing module 116, the touch screen display module 117 and the camera shooting module 118 respectively, and is responsible for cooperative control and data exchange among the modules, and the contract instance (the contract instance is a triplet formed by contract template, contract wallet and contract storage and reflects the contract signed by each party) is matched according to transaction parameters such as contract account, merchant number and the like through the abutting end side contract processing module 21, and if the matching is successful, the blockchain network is called to pull the corresponding contract code and drive the contract to execute; if the matching is not successful, the transaction is processed according to the common order receiving service (namely, a common bank card order receiving transaction).
End-side contract processing module 21: and deploying a contract loader and a condition trigger, and realizing dynamic issuing of contracts and trusted execution of programs through a butt joint blockchain network to ensure that the operating environment of the contracts is trusted. Meanwhile, the cloud contract platform is kept synchronous, appointed contract data is downloaded from a contract warehouse at regular time, and local data storage is updated. (the contract loader is a virtual machine environment of the contract, security and credibility must be ensured and the contract loader is not attacked by the outside; the condition trigger is a background batch monitor, and the transaction is triggered after time or event hit).
Card reading module 112: the embedded SE chip card reader supports offline digital authentication ODA, reads information of a bank card and an identity card, analyzes card surface data and provides the analyzed card surface data for the transaction main control module 111 to process.
The data transceiver module 113 is configured to receive the transaction request or send a message, and perform local processing on the message to complete data transmission processing, including message parsing, data format conversion and data dispatch transmission.
The voice broadcasting module 114 is responsible for broadcasting the payment result and the abnormal prompt tone.
And the printing module 116 is used for printing certificates such as tickets after the transaction is successful.
The camera shooting module 118 is mainly used for scanning codes and checking tickets and returning two-dimensional code data.
The touch screen display module 117 is used for displaying an operation interface and supporting MIS cashing and financial payment operations.
The power supply module 115 is responsible for supplying power to the transaction main control module 111, and the device is started to work by battery work or power on by a power switch.
Referring to fig. 8, the end-side contract processing module 21 includes a contract running sub-module 211, a blockchain network transmission sub-module 212, a data storage sub-module 213, a calculation power detection sub-module 214, and a condition triggering sub-module 215.
A contract execution sub-module 211 comprising a wasm bytecode executor module and a bytecode loading sub-module; the byte code executor submodule is in a pluggable mode, a wasm executor such as Wasmtime, WAMR, SSVM can be selected according to software and hardware environments of the side equipment, for example, in a scene with strict requirements on power consumption and hardware resources, a WAMR executor is generally recommended, and by using an AOT mode of WAMR, a byte code file (wasm file) contract code is translated into a machine code before operation and then is operated, so that the resource requirements are further reduced; also, for example, by deploying an AI, blockchain application on a better-resource edge device, a high-performance, extensible SSVM actuator may be selected. The wasm byte code loading module is used for loading the wasm file, the contract wasm file is obtained through the block chain network transmission sub-module 212 or the local contract wasm file is read through the data storage sub-module 213, and the wasm byte code loading module and the wasm byte code executor realize sectional loading of the wasm file through combination of stream and layered compiling, load a section, compile a section, then execute the section, improve the starting speed, optimize the sectional compiling in the later stage, perform hot replacement, and further improve the starting operation efficiency of the wasm file.
The blockchain network transmission sub-module 212 provides the basic functions of the side device and the blockchain network transmission service, which are self-contained by the side contract processing module 21, and provides the link-up and link-down interactive capability for contract deployment, execution and other transactions.
The data storage sub-module 213 provides a data persistence storage service, stores world state values (e.g., balance of an account on the blockchain) on the blockchain, and stores world state values mainly for the purpose of enabling the POS machine to execute contracts in an offline scenario, but if the past data needs to be traced back, real-time access to the blockchain query is required.
The computing power detection sub-module 214 provides computing power detection service for the POS machine, and the computing power detection sub-module 214 can calculate that the POS machine can complete multiple operations within a certain time; when a user submits a contract deployment request, the user needs to submit the contract execution timeout time, the blockchain network compiles the contract into a wasm file according to the standard, the operation times required by the contract are calculated, the calculation force of the POS machine is obtained through the calculation force detection sub-module 214, the time required by the POS machine to complete one intelligent contract execution is obtained, and the contract can be deployed when the time is lower than the contract execution timeout time.
The conditional trigger sub-module 215: triggering contract transaction to be automatically executed according to a timing event or a business logic event meeting expectations, such as initiating a timed rated water fee payment, monitoring the event by a batch scanning mode, and driving appointed contract execution according to the conventions during registration.
The user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party. In addition, the technical scheme described by the embodiment of the application accords with the relevant regulations of national laws and regulations for acquiring, storing, using, processing and the like of the data.
Based on the transaction method based on the intelligent contract, the embodiment of the specification correspondingly provides a transaction device based on the intelligent contract. The apparatus may include a system (including a distributed system), software (applications), modules, components, servers, clients, etc. that employ the methods described in the embodiments of the present specification in combination with the necessary apparatus to implement the hardware. Based on the same innovative concepts, the embodiments of the present description provide means in one or more embodiments as described in the following embodiments. Because the implementation scheme and the method for solving the problem by the device are similar, the implementation of the device in the embodiment of the present disclosure may refer to the implementation of the foregoing method, and the repetition is not repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Specifically, fig. 9 is a schematic block diagram of an embodiment of a POS machine based on an intelligent contract according to an embodiment of the present disclosure, and referring to fig. 9, the POS machine based on an intelligent contract according to an embodiment of the present disclosure is registered in a blockchain network, and includes: generation unit 100, acquisition unit 200, execution unit 300, authentication unit 400, reception unit 500, and uplink unit 600.
The generating unit 100 is configured to generate information to be verified and transaction information according to a transaction request obtained by a POS device;
an acquisition unit 200 for acquiring authentication information required for authentication through a relay server;
the execution unit 300 is configured to execute a contract deployed in a blockchain network according to the information to be verified and the verification information, and verify the information to be verified;
a verification unit 400, configured to perform broadcast consensus on a verification result in the blockchain network;
the receiving unit 500 is configured to send the transaction information to a banking system terminal to execute a transaction when the verification result is verification passing, and receive a transaction execution result returned by the banking system terminal;
a uplink unit 600, configured to uplink the verification result and the transaction execution result in the blockchain network.
Based on the transaction method based on the intelligent contract, the embodiment of the present disclosure further correspondingly provides a transaction system based on the intelligent contract, referring to fig. 10, based on the POS machine described above, including:
the transaction terminal is used for initiating a transaction request to the POS machine;
the POS machine is registered in the blockchain network and is used for generating information to be verified and transaction information according to the transaction request obtained by the POS machine; acquiring verification information required by verification through a relay server; executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified; broadcasting consensus is carried out on the verification result in the block chain network; when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received; linking the validation result and transaction execution result in the blockchain network;
and the banking system terminal is used for executing the transaction and returning the transaction execution result to the POS machine.
Referring to fig. 11, a computer device 1102 is further provided in an embodiment of the present disclosure based on a smart contract-based transaction method as described above, where the method is run on the computer device 1102. The computer device 1102 may include one or more processors 1104, such as one or more Central Processing Units (CPUs) or Graphics Processors (GPUs), each of which may implement one or more hardware threads. The computer device 1102 may also comprise any memory 1106 for storing any kind of information, such as code, settings, data, etc., and in a particular embodiment a computer program on the memory 1106 and executable on the processor 1104, which when executed by the processor 1104, may execute instructions according to the methods described above. For example, and without limitation, memory 1106 may comprise any one or more of the following combinations: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any memory may store information using any technique. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent fixed or removable components of the computer device 1102. In one case, when the processor 1104 executes associated instructions stored in any memory or combination of memories, the computer device 1102 may perform any of the operations of the associated instructions. The computer device 1102 also includes one or more drive mechanisms 1108 for interacting with any memory, such as a hard disk drive mechanism, optical disk drive mechanism, and the like.
The computer device 1102 may also include an input/output module 1110 (I/O) for receiving various inputs (via an input device 1112) and for providing various outputs (via an output device 1114). One particular output mechanism may include a presentation device 1116 and an associated graphical user interface 1118 (GUI). In other embodiments, input/output module 1110 (I/O), input device 1112, and output device 1114 may not be included, but merely as a computer device in a network. The computer device 1102 may also include one or more network interfaces 1120 for exchanging data with other devices via one or more communication links 1122. One or more communication buses 1124 couple together the components described above.
The communication link 1122 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the internet), a point-to-point connection, etc., or any combination thereof. Communication link 1122 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
Corresponding to the method in fig. 1-6, the present description also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above method.
The present description also provides computer-readable instructions, wherein the program therein causes the processor to perform the method as shown in fig. 1 to 6 when the processor executes the instructions.
The present description also provides a computer program product which, when executed by a processor of a computer device, performs the method as shown in fig. 1 to 6.
It should be understood that, in various embodiments of the present disclosure, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation of the embodiments of the present disclosure.
It should also be understood that, in the embodiments of the present specification, the term "and/or" is merely one association relationship describing the association object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In the embodiment of the present specification, the character "/", generally indicates that the front and rear associated objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the various illustrative elements and steps have been described above generally in terms of function in order to best explain the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purposes of the embodiments of the present description.
In addition, each functional unit in each embodiment of the present specification may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present specification are essential or contribute to the prior art, or all or part of the technical solutions may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present specification. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Specific embodiments are applied in the present specification to illustrate the principles and implementations of the embodiments of the present specification, and the description of the above embodiments is only used to help understand the methods of the embodiments of the present specification and the core ideas thereof; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope based on the ideas of the embodiments of the present specification, the contents of the present specification should not be construed as limiting the embodiments of the present specification in view of the above.

Claims (11)

1. A smart contract-based transaction method, applied to a POS machine registered in a blockchain network, comprising:
generating information to be verified and transaction information according to the transaction request obtained by the POS machine;
acquiring verification information required by verification through a relay server;
executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified;
broadcasting consensus is carried out on the verification result in the block chain network;
when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received;
and the verification result and the transaction execution result are uplink in the blockchain network.
2. The method of claim 1, wherein the method of registering the POS in the blockchain network comprises:
after installing contracts in the blockchain network, submitting a hardware registration code of the POS machine to the blockchain network for registration;
after broadcasting consensus is carried out by a block chain network, registration is completed, and related information of the POS machine is uplink;
and after the registration is successful, receiving a key returned by the blockchain network, and locally storing the key.
3. The method of claim 2, wherein the contract deployment method in the blockchain network comprises:
acquiring a contract template issued by a block chain network;
selecting contract templates corresponding to users to sign up, and publishing the contract templates to a blockchain network for broadcast consensus;
encrypting the contract codes corresponding to the corresponding contract templates through the key and then locally storing the encrypted contract codes;
loading locally stored contract codes and compiling the contract codes into byte code files;
and after the compiling is successful, the contract deployment is completed.
4. The method of claim 3, wherein compiling the contract code into a byte code file further comprises:
selecting a corresponding compiler according to the software and hardware environment of the POS machine;
and compiling the contract codes in a sectional loading way by combining stream type compiling and layered compiling.
5. The method of claim 1, wherein the premise of contract deployment in the blockchain network comprises:
acquiring a time threshold value corresponding to a user when executing a contract;
after compiling the contract code into a byte code file, the blockchain network calculates the operation times required by the contract;
according to the operation times, the consumed time for the POS machine to complete one-time contract execution is calculated;
and deploying the contract when the elapsed time is below the time threshold.
6. The method of claim 1, wherein the linking the validation result and transaction execution result in the blockchain network further comprises:
the POS machine broadcasts the verification result and the transaction execution result to the whole network;
the block chain network performs three-stage verification, each node in each stage enters the next stage after receiving at least 2f+1 other node verification consistent messages, wherein the number of nodes in the block chain network is 3f+1, and f is the number of fault-tolerant nodes in the block chain network;
if the 2f+1 other nodes do not receive the message confirming the coincidence in any stage, the next stage is not entered;
and (5) after finishing three-stage verification, the chain is booted.
7. A POS machine based on intelligent contracts, wherein the POS machine is registered in a blockchain network, comprising:
the generation unit is used for generating information to be verified and transaction information according to the transaction request obtained by the POS machine;
an acquisition unit configured to acquire authentication information required for authentication through a relay server;
the execution unit is used for executing contracts deployed in a blockchain network according to the information to be verified and the verification information and verifying the information to be verified;
the verification unit is used for carrying out broadcast consensus on the verification result in the block chain network;
the receiving unit is used for sending the transaction information to the banking system terminal to execute the transaction when the verification result is verification passing and receiving the transaction execution result returned by the banking system terminal;
and the uplink unit is used for uplink the verification result and the transaction execution result in the blockchain network.
8. A transaction system based on smart contracts, characterized in that it comprises, based on the POS machine of claim 7:
the transaction terminal is used for initiating a transaction request to the POS machine;
the POS machine is registered in the blockchain network and is used for generating information to be verified and transaction information according to the transaction request obtained by the POS machine; acquiring verification information required by verification through a relay server; executing contracts deployed in a blockchain network according to the information to be verified and the verification information, and verifying the information to be verified; broadcasting consensus is carried out on the verification result in the block chain network; when the verification result is that the verification is passed, the transaction information is sent to a banking system terminal to execute the transaction, and a transaction execution result returned by the banking system terminal is received; linking the validation result and transaction execution result in the blockchain network;
and the banking system terminal is used for executing the transaction and returning the transaction execution result to the POS machine.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory, characterized in that the computer program, when being executed by the processor, performs the instructions of the method according to any of claims 1-6.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor of a computer device, executes instructions of the method according to any one of claims 1-6.
11. A computer program product, characterized in that the computer program product, when being executed by a processor of a computer device, executes instructions of the method according to any of claims 1-6.
CN202310981132.6A 2023-08-04 2023-08-04 Transaction method, POS machine and transaction system based on intelligent contract Pending CN117011052A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310981132.6A CN117011052A (en) 2023-08-04 2023-08-04 Transaction method, POS machine and transaction system based on intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310981132.6A CN117011052A (en) 2023-08-04 2023-08-04 Transaction method, POS machine and transaction system based on intelligent contract

Publications (1)

Publication Number Publication Date
CN117011052A true CN117011052A (en) 2023-11-07

Family

ID=88565076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310981132.6A Pending CN117011052A (en) 2023-08-04 2023-08-04 Transaction method, POS machine and transaction system based on intelligent contract

Country Status (1)

Country Link
CN (1) CN117011052A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252599A (en) * 2023-11-17 2023-12-19 深圳合纵富科技有限公司 Dual security authentication method and system for intelligent POS machine
CN117668924A (en) * 2024-01-31 2024-03-08 广东通莞科技股份有限公司 Pos machine business audit system based on-chain settlement data
CN117668924B (en) * 2024-01-31 2024-05-03 广东通莞科技股份有限公司 Pos machine business audit system based on-chain settlement data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252599A (en) * 2023-11-17 2023-12-19 深圳合纵富科技有限公司 Dual security authentication method and system for intelligent POS machine
CN117252599B (en) * 2023-11-17 2024-03-15 深圳合纵富科技有限公司 Dual security authentication method and system for intelligent POS machine
CN117668924A (en) * 2024-01-31 2024-03-08 广东通莞科技股份有限公司 Pos machine business audit system based on-chain settlement data
CN117668924B (en) * 2024-01-31 2024-05-03 广东通莞科技股份有限公司 Pos machine business audit system based on-chain settlement data

Similar Documents

Publication Publication Date Title
CN112330326B (en) Business processing method and device applied to bank transaction blockchain system
CN104038924B (en) Realize the method and system of Resource Exchange information processing
CN101834946A (en) Method for performing safe mobile phone payment and mobile phone for performing safe payment
CN110535648A (en) Electronic certificate is generated and verified and key controlling method, device, system and medium
CN105741536A (en) Anonymous taxi taking system and mobile security payment method
CN117011052A (en) Transaction method, POS machine and transaction system based on intelligent contract
CN104794613A (en) Mobile equipment authentication method based on point-of-sale terminal
CN110601896A (en) Data processing method and equipment based on block chain nodes
CN102262803A (en) Automatic signing method and device of bank financing products
GB2605949A (en) Secure sensor data distribution
Lin et al. A Blockchain-enabled decentralized settlement model for IoT data exchange services
CN107038025B (en) SOA architecture-based system calling method and device
KR102333811B1 (en) System and method for processing card payment based on block-chain
CN111461799A (en) Data processing method, data processing device, computer equipment and medium
CN111416709A (en) Voting method, device, equipment and storage medium based on block chain system
CN104881781A (en) Method, system, and client based on secure transaction
CN101408970A (en) Method, system and apparatus for implementing batch electronic transaction, and electronic signing tool
CN101540031A (en) Confirmation method for ensuring data validity in network electronic trade
WO2023093876A1 (en) Authorization device-based transaction method and system
CN115244526A (en) Method and system for decentralized transaction communication protocols
CN105160531B (en) Transaction data processing method and processing device
CN111553678A (en) Two-dimensional code payment method and system based on mobile phone business card
WO2023005500A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
CN114169895A (en) Payment information processing system, method, device, medium, product and equipment
CN111538899B (en) Resource information pushing method, equipment side and server side

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