CN111028059B - Article exchange method, device, equipment and storage medium based on blockchain - Google Patents

Article exchange method, device, equipment and storage medium based on blockchain Download PDF

Info

Publication number
CN111028059B
CN111028059B CN201911268211.2A CN201911268211A CN111028059B CN 111028059 B CN111028059 B CN 111028059B CN 201911268211 A CN201911268211 A CN 201911268211A CN 111028059 B CN111028059 B CN 111028059B
Authority
CN
China
Prior art keywords
user
article
exchange
item
blockchain
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.)
Active
Application number
CN201911268211.2A
Other languages
Chinese (zh)
Other versions
CN111028059A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911268211.2A priority Critical patent/CN111028059B/en
Publication of CN111028059A publication Critical patent/CN111028059A/en
Application granted granted Critical
Publication of CN111028059B publication Critical patent/CN111028059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06Q30/0601Electronic shopping [e-shopping]
    • 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/03Credit; Loans; Processing thereof
    • 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
    • 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/10Services
    • G06Q50/16Real estate

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Tourism & Hospitality (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Primary Health Care (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for exchanging articles based on a blockchain, and belongs to the technical field of blockchains. The method comprises the following steps: obtaining an item exchange contract in an unfinished state from a blockchain of the blockchain system, wherein the item exchange contract is used for executing an item exchange process between a first user and a second user; acquiring article ownership information of the first user corresponding to the article exchange contract and article ownership information of the second user corresponding to the article exchange contract from the blockchain; and executing the item exchange contract when the first user and the second user are determined to meet the item exchange qualification according to the item ownership information of the first user and the item ownership information of the second user. The application solves the trust problem in the related technology without the help of a third party, and improves the reliability of the goods exchange.

Description

Article exchange method, device, equipment and storage medium based on blockchain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a blockchain-based article exchange method, apparatus, device, and storage medium.
Background
The article exchange is the action of exchanging the ownership of the article among the owners of the article in an equivalent or complementary price mode on the basis of mutual equality and willingness. For example, the item exchange may be a property exchange, and under the condition that the government has a set of properties, each of the user a and the user B having a set of properties may improve their own housing conditions by means of the property exchange.
At present, taking property exchange as an example, a user a and a user B want to exchange properties and make up for differences, at this time, the user a and the user B cannot purchase and sell at first, and the following transaction mode needs to be performed through an intermediate party C and an intermediate party D: user a sells property 1 to intermediary party C, user B sells property 2 to intermediary party D, user a purchases property 2 from intermediary party D, and user B purchases property 1 from intermediary party C.
When the technology is used for exchanging the articles, a third party is needed, so that the trust problem exists, all the participants cannot be guaranteed to execute according to contracts, unnecessary loss can be caused, and the reliability of the article exchange is poor.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for exchanging articles based on a blockchain, which can solve the problem of poor reliability of the article exchange in the related technology. The technical scheme is as follows:
In one aspect, there is provided a blockchain-based item exchange method, the method comprising:
obtaining an item exchange contract in an unfinished state from a blockchain of the blockchain system, wherein the item exchange contract is used for executing an item exchange process between a first user and a second user;
acquiring article ownership information of the first user corresponding to the article exchange contract and article ownership information of the second user corresponding to the article exchange contract from the blockchain;
and executing the item exchange contract when the first user and the second user are determined to meet the item exchange qualification according to the item ownership information of the first user and the item ownership information of the second user.
In one possible implementation, the item exchange condition further includes the first user and the second user having applied for a loan qualification.
In one possible implementation manner, before the acquiring, from the blockchain, the item ownership information of the first user corresponding to the item exchange contract, and the item ownership information of the second user corresponding to the item exchange contract, the method further includes:
And storing the article ownership information of the first user and the article ownership information of the second user into the blockchain.
In one possible implementation, the acquiring an item exchange contract in an unfinished state from a blockchain of the blockchain system includes:
periodically acquiring an item exchange contract in an unfinished state from the blockchain.
In one possible implementation, after the executing the item exchange contract, the method further includes:
generating article exchange completion information;
storing the item exchange completion information into the blockchain.
In one possible implementation, the acquiring an item exchange contract in an unfinished state from a blockchain of the blockchain system includes:
an item exchange contract whose status is marked as incomplete is obtained from a blockchain of the blockchain system.
In one possible implementation, after the executing the item exchange contract, the method further includes:
modifying the status flag of the item exchange contract from an incomplete state to a completed state.
In one aspect, there is provided a blockchain-based item exchange device, the device comprising:
An acquisition module for acquiring an item exchange contract in an unfinished state from a blockchain of the blockchain system, the item exchange contract being used for executing an item exchange process between a first user and a second user;
the acquisition module is further used for acquiring the article ownership information of the first user corresponding to the article exchange contract and the article ownership information of the second user corresponding to the article exchange contract from the blockchain;
and the execution module is used for executing the article exchange contract when the first user and the second user are determined to meet the article exchange qualification according to the article ownership information of the first user and the article ownership information of the second user.
In one possible implementation manner, the execution module is configured to:
executing the article exchange contract when the quantity of the article ownership corresponding to the first user after the article exchange process is completed is determined to meet a quantity condition according to the article ownership information of the first user and the article ownership information of the second user, and the quantity of the article ownership corresponding to the second user meets the quantity condition;
The article ownership corresponding to the first user comprises the article ownership of the first user and the article ownership of the family member of the first user, and the article ownership of the second user comprises the article ownership of the second user and the article ownership of the family member of the second user.
In one possible implementation, the item exchange contract includes the following information:
the first user's item exchange requirement information indicating that a second item of the second user is exchanged using the first item of the first user;
the second user's item exchange demand information indicating that the first item of the first user is exchanged using the second user's second item.
In one possible implementation, the article exchange requirement information of the first user is further used to instruct the first user to obtain the target funds, and the article exchange requirement information of the second user is further used to instruct the second user to pay out the target funds;
the item exchange contract also includes an item exchange condition including the second user having deposited a target funds into a target account of the blockchain.
In one possible implementation manner, the acquiring module is configured to:
and when the article exchange condition is determined to be met, acquiring the article ownership information of the first user and the article ownership information of the second user from the blockchain.
In one possible implementation, the item exchange condition further includes the first user and the second user having applied for a loan qualification.
In one possible implementation, the apparatus further includes:
the receiving module is used for receiving an article exchange request, wherein the article exchange request carries the article exchange requirement information of the first user and the article exchange requirement information of the second user;
the generation module is used for generating the article exchange contract based on the article exchange demand information of the first user and the article exchange demand information of the second user carried by the article exchange request;
and the storage module is used for signing the article exchange contract by using the private key of the first user and the private key of the second user, and storing the signed article exchange contract into the blockchain.
In one possible implementation manner, the acquiring module is configured to:
Periodically acquiring an item exchange contract in an unfinished state from the blockchain.
In one possible implementation, the apparatus further includes:
and the storage module is used for storing the article ownership information of the first user and the article ownership information of the second user into the blockchain.
In one possible implementation, the apparatus further includes:
the generation module is used for generating article exchange completion information;
and the storage module is used for storing the article exchange completion information into the blockchain.
In one possible implementation manner, the acquiring module is configured to:
an item exchange contract whose status is marked as incomplete is obtained from a blockchain of the blockchain system.
In one possible implementation, the apparatus further includes:
and the modifying module is used for modifying the state mark of the article exchange contract from an incomplete state to a completed state.
In one aspect, a computer device is provided that includes a processor and a memory having stored therein at least one program code that is loaded and executed by the processor to perform the operations performed by the blockchain-based item exchange described above.
In one aspect, a computer readable storage medium having at least one program code stored therein is provided, the at least one program code loaded and executed by a processor to perform operations performed by a blockchain-based item exchange as described above.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
the unfinished article exchange contract is acquired from the blockchain of the blockchain system, then the article ownership information of the two exchange parties corresponding to the article exchange contract is acquired, when the two exchange parties are confirmed to meet the article exchange qualification, the article exchange process is automatically completed without the help of a third party, the trust problem in the related technology is solved, and the reliability of the article exchange is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a blockchain system provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a blockchain system provided by an embodiment of the present application;
FIG. 3 is a block chain architecture diagram according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a block generation process according to an embodiment of the present application;
FIG. 5 is a flow chart of a blockchain-based item exchange method provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a block chain based article exchange device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal 700 according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server 800 according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals (including but not limited to signals transmitted between the user terminal and other devices, etc.) related to the present application are fully authorized by the user or related aspects, and the collection, use, and processing of the related data is required to comply with the relevant laws and regulations and standards of the relevant country and region.
For convenience of understanding, the terms involved in the embodiments of the present application are explained below:
blockchain (Blockchain): is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain is essentially a decentralised database, and is a series of data blocks which are generated by association by using a cryptography method, and each data block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. Each block contains a time stamp and a link to the previous block. In a narrow sense, a blockchain is a chain data structure that combines blocks of data in a sequential manner in time order, and cryptographically guaranteed, non-tamperable and non-counterfeitable, distributed ledgers, i.e., the data in the blockchain will be irreversible once recorded.
Consensus mechanism (Consensus mechanism): is a mathematical algorithm for realizing trust establishment and rights acquisition among different nodes in a block chain system. In a blockchain system, the verification and confirmation of a transaction can be completed in a short time through voting of special nodes, and if a plurality of nodes with irrelevant interests can reach consensus for one transaction, all the nodes in the system can be considered to reach consensus for the same.
Smart contract: is a computer protocol that aims to propagate, verify or execute contracts in an informative manner. Each node in the blockchain system can operate the data stored on the chain according to the contract program automatically executed by the specific condition, and is an important way for users to interact with the blockchain and realize business logic by using the blockchain. The purpose of smart contracts is to provide a secure method over traditional contracts and reduce other transaction costs associated with the contracts, which allows trusted transactions to be conducted without third parties, which transactions are traceable and irreversible.
Public Key (Public Key) and Private Key (Private Key): the method is characterized in that the method comprises the steps that a key pair (namely a public key and a private key) is obtained through an algorithm, the public key is a public part of the key pair, confidentiality is not needed, and a decryption party can obtain the key through various channels; the private key is a non-public part, and needs to be kept secret only by the secret key held by the encryption party. Public keys are commonly used to encrypt data, verify digital signatures, and the like. By means of this algorithm it is ensured that the resulting key pair is unique, and when using this key pair, if one of the keys is used to encrypt a piece of data, it must be decrypted with the other key, e.g. the data encrypted with the public key must be decrypted with the corresponding private key, and if the data is encrypted with the private key it must also be decrypted with the corresponding public key, otherwise the decryption will not succeed.
Fig. 1 is a schematic diagram of a blockchain system according to an embodiment of the present application, where, as shown in fig. 1, the blockchain system 100 may include a plurality of node devices 101, where the plurality of node devices 101 are configured with the same blockchain, and any node device 101 in the blockchain system may perform one or more steps in the blockchain-based item exchange method according to the embodiment of the present application. The plurality of node devices 101 may belong to different institutions or individual users. For example, at least one node device 101 of the plurality of node devices 101 belongs to an individual user, at least one node device 101 belongs to an item ownership authority, at least one node device belongs to a bank, and at least one node device 101 belongs to a civil institution. Of course, it is also possible that at least one node device 101 belongs to other institutions. The plurality of node apparatuses 101 may be servers or terminals, which is not particularly limited in the embodiment of the present application.
Taking an article as a property as an example, as shown in fig. 2, the plurality of node devices in the blockchain system may include node devices corresponding to a housing administration, node devices corresponding to a civil administration, and node devices corresponding to a loan bank. The node equipment corresponding to the housing management bureau is used for carrying out property inquiry and transaction passing; the node equipment corresponding to the civil administration is used for inquiring the user and the household registration and inquiring the purchase condition of the limited purchase user through the housing administration; the node equipment corresponding to the loan bank is used for issuing housing loans, interest settlement and the like. As shown in fig. 2, the plurality of node devices in the blockchain system may also include different user-corresponding node devices. Of course, in addition to the point node devices shown in fig. 2, the blockchain system may also include other node devices, such as transaction node devices, which are not particularly limited in this embodiment of the present application.
These institutions or users in fig. 2 may register as blockchain users, with unique user identification and private keys. The user identification may be a user public key for uniquely identifying a user or an organization in the blockchain system. These institutions or users may contract for intelligent contracts, for example, the intelligent contract may be an item exchange contract, which is used to contract the flow of an item exchange.
Data sharing can be performed between node devices in the blockchain system, each node device can receive input information when performing normal work, and shared data in the blockchain system is maintained based on the received input information. In order to ensure the information intercommunication in the blockchain system, information connection can exist between every node equipment in the blockchain system, and the node equipment can transmit information through the information connection. For example, when any node device in the blockchain system receives input information, other node devices in the blockchain system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all node devices in the blockchain system are consistent.
Each node device in the blockchain system has a node identifier corresponding to the node device, and each node device in the blockchain system can store the node identifiers of other node devices in the blockchain system so as to broadcast the generated blocks to other node devices in the blockchain system according to the node identifiers of the other node devices. Each node device may maintain a node identifier list as shown in the following table, and store the node device name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol, protocol of interconnection between networks) address, and any other information that can be used to identify the node device, and table 1 is only illustrated by taking an IP address as an example.
TABLE 1
Each node device in the blockchain system stores one and the same blockchain. The blockchain is composed of a plurality of blocks, referring to fig. 3, the blockchain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, referring to fig. 4, when the node equipment where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein SHA256 is a eigenvalue algorithm used to calculate eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; the merkle_root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. And then, the node equipment of the block chain respectively sends the newly generated blocks to other node equipment in the block chain system according to the node identification of other node equipment in the block chain system, the other node equipment checks the newly generated blocks, and the newly generated blocks are added into the stored block chain after the checking is completed.
FIG. 5 is a flow chart of a blockchain-based item exchange method provided by an embodiment of the application. The method may be applied to a node device in a blockchain system, see fig. 5, and may include:
501. the first node device receives an item exchange request carrying item exchange requirement information of a first user and item exchange requirement information of a second user.
Wherein the first node device may be any node device in a blockchain system, the item exchange request is for requesting an item exchange between the first user and the second user. For example, the item may be a property or other type of item.
For the item exchange demand information, in one possible implementation, the item exchange demand information of the first user is used to instruct to exchange a second item of the second user with a first item of the first user; the second user's item exchange demand information is used to instruct the first user's first item to be exchanged with the second user's second item.
The first user's item exchange demand information may also be used to indicate that the first user obtains a target funds, and the second user's item exchange demand information may also be used to indicate that the second user pays a target funds.
Since there is a certain gap between the first article of the first user and the second article of the second user, a target fund can be contracted when the articles are exchanged, and one party pays out the target fund, and the other party obtains the target fund.
Taking an article as a property as an example, the article exchange requirement information of the first user may be: selling the property X, buying the property Y and obtaining funds Z; the item exchange requirement information of the second user may be: sell property Y, buy property X, and pay funds Z.
The first node device may receive the item exchange request in any one of the following possible implementations:
in the first manner, the first user may initiate the article exchange request on a first device, where the first device is the first node device.
The first user and the second user can together determine respective article exchange requirements, the first user initiates an article exchange request on the first device, the article exchange request carries the article exchange requirement information of the first user and the article exchange requirement information of the second user, and the first device is the first node device, so that the first node device can receive the article exchange request carrying the article exchange requirement information of the first user and the article exchange requirement information of the second user.
In the second mode, the second user may initiate the article exchange request on a second device, where the second device is the second node device.
The first user and the second user can together determine respective article exchange requirements, and the second user initiates an article exchange request on the second device, wherein the article exchange request carries the article exchange requirement information of the first user and the article exchange requirement information of the second user, and the second device is the first node device, so that the first node device can receive the article exchange request carrying the article exchange requirement information of the first user and the article exchange requirement information of the second user.
In a third mode, a first user can initiate a first article exchange request on a first device, the first article exchange request carries article exchange requirement information of the first user, and the first device sends the first article exchange request to a third device; the second user may initiate a second item exchange request on the second device, the second item exchange request carrying item exchange requirement information for the second user, and the second device sends the second item exchange request to the third device. The third device is the first node device.
The first user and the second user can together determine respective article exchange requirements, the first user initiates a first article exchange request on the second device and sends the first article exchange request to the third device, the first user initiates a second article exchange request on the second device and sends the second article exchange request to the third device, and the third device is the first node device, so that the first node device can receive the article exchange request carrying the article exchange requirement information of the first user and the article exchange requirement information of the second user.
In one possible implementation, the item exchange request may carry, in addition to item exchange demand information of a first user and item exchange demand information of a second user, a transaction type and an item exchange condition (transaction condition), wherein the transaction type may be a interlinked transaction (interchange transaction), the item exchange condition may include that the second user has deposited a target funds into a target account of the blockchain, and may include that the first user and the second user have applied for a loan qualification.
The target account may be a specified shared guaranteed account of a blockchain, and after the funds are stored, a contract ID (Identification) corresponding to the use of the funds needs to be specified. The first user and the second user can apply loan qualification to the node equipment corresponding to the bank in the blockchain system, the node equipment can carry out approval operation of loan definition and loan qualification according to the conditions and application information of the two parties, and the approval result is stored in the blockchain, namely, the approval result is synchronized to the blockchain.
502. The first node device generates an item exchange contract based on the item exchange demand information of the first user and the item exchange demand information of the second user carried by the item exchange request.
The first node device may obtain, from the item exchange request received in step 501, item requirement information of the first user and item exchange requirement information of the second user, and for a case that the item exchange request further carries a transaction type and an item exchange condition, the first node device may also obtain the transaction type and the item exchange condition from the item exchange request.
The first node device may generate an item exchange contract based on information carried in the item exchange request, where the item exchange contract may include item exchange requirement information of the first user and item exchange requirement information of the second user. For the case where the item exchange request also carries a transaction type and item exchange conditions, the item exchange contract may also include a transaction type and item exchange conditions. The item exchange contract may correspond to a contract ID for uniquely identifying the item exchange contract.
503. The first node device signs the item exchange contract using the private key of the first user and the private key of the second user, and stores the item exchange contract in the blockchain.
Wherein the item exchange contract is stored to the blockchain, i.e., the item exchange contract is synchronized to the blockchain, which may also be referred to as the uplink.
The first node device may use the private key of the first user and the private key of the second user to sign the item exchange contract and store the item exchange contract including the private key signature in a blockchain of the blockchain system. When any node device in the blockchain system acquires the article exchange contract comprising the private key signature, the private key signature of the article exchange contract can be verified, for example, public keys of a first user and a second user are acquired from a blockchain of the blockchain system, the public key signature is verified by using the public key of the first user and the public key of the second user, and after the verification, the authenticity of the article exchange contract can be confirmed, that is, the article exchange contract can be confirmed to be the contract signed by the first user and the second user. The authenticity of the goods exchange contract can be ensured by signing the exchange in the intelligent contract mode.
The first node device may store the item exchange contract in the blockchain based on a consensus mechanism such that any node device in the blockchain system may obtain the item exchange contract. The first node device may generate a target block based on the item exchange contract, the target block may be agreed by the blockchain system, and the target block may be added to the blockchain after the target block is agreed, so that the item exchange contract in the target block is stored in the blockchain. Specific details of the first node device generating the target block and adding the target block to the blockchain may be referred to in the corresponding descriptions of fig. 3 and fig. 4, and will not be described herein.
Steps 501 through 503 are processes by which node devices in the blockchain system store item exchange contracts into the blockchain. Steps 501 through 503 are optional steps that are not performed every time an item exchange is performed, so long as it is ensured that the item exchange contract is already stored on the blockchain when the item exchange is performed.
The item exchange contracts stored in the blockchain system may be added with status flags for marking the item exchange contracts as being in a completed or unfinished state.
504. The second node device obtains an item exchange contract in an unfinished state from a blockchain of the blockchain system, the item exchange contract being used to perform an item exchange process between the first user and the second user.
The second node device may be any node device in the blockchain system, and the second node device may be the same as or different from the first node device.
In one possible implementation, the second node device may obtain, from a blockchain of the blockchain system, an item exchange contract whose status is marked as an incomplete status, according to which it may be known that an item exchange is performed between the first user and the second user.
Each item exchange contract stored in the blockchain system is added with a state label, and the second node device can query the state label of each item exchange contract to obtain the item exchange contract with the state label of which is not finished.
For the second node device to acquire the opportunity of the item exchange contract in the unfinished state, in one possible implementation, the second node device may periodically acquire the item exchange contract in the unfinished state from the blockchain.
The second node device may periodically (periodically) query the blockchain for status flags for individual item exchange contracts, obtain item exchange contracts whose status flags are incomplete. By timing the acquisition of outstanding item exchange contracts in the blockchain, these contracts can be handled in a timely manner.
505. When the article exchange condition is determined to be met, the second node device acquires the article ownership information of the first user corresponding to the article exchange contract and the article ownership information of the second user corresponding to the article exchange contract from the blockchain.
The item exchange condition is an item exchange condition corresponding to the item exchange contract, that is, an item exchange condition included in the item exchange contract. The article ownership information of the first user is used for indicating the article ownership status of the first user, i.e. which articles the first user has ownership, and the article ownership information of the second user is used for indicating the article ownership status of the second user, i.e. which articles the second user has ownership.
When the second node device acquires the item exchange contract, the second node device can determine whether the item exchange condition corresponding to the item exchange contract is met currently. Taking the article exchange condition as an example that the second user has deposited the target funds into the target account of the blockchain and the first user and the second user have applied for obtaining the loan qualification, the second node device may query whether the target funds exist in the target account, specifically, the second node device may query whether the contract ID corresponding to the fund use is the target funds of the contract ID of the article exchange contract in the target account, and if so, may determine that the second user has deposited the target funds into the target account. The second node device may query the blockchain for approval results of the first user and the second user for loan qualification, and determine whether the first user and the second user have obtained the loan qualification according to the approval results. If the second node device determines that the second user has deposited the target funds into the target account of the blockchain and the first user and the second user have applied for qualification of the loan, then it may be determined that the item exchange condition is currently satisfied.
It will be appreciated that if it is determined that the item exchange condition is not met, the second node device may temporarily not process the item exchange contract, but wait until the next time the unfinished item exchange contract is retrieved from the blockchain.
The second node device can learn the first user and the second user to exchange the articles according to the article exchange contract, and further acquire the stored article ownership information of the first user and the stored article ownership information of the second user from the blockchain.
In one possible implementation, before the second node device performs the step 505, the first user and the second user may authorize the second node device to query for the article exchange qualification of both sides, that is, authorize the second node device to query for the article ownership information of the first user and the second user, and determine whether the first user and the second user satisfy the article exchange qualification according to the article ownership information. Accordingly, the second node device may be a node device authorized to query for the item exchange qualifications of the first user and the second user.
In this step 505, the second node device may initiate a query request for the article exchange eligibility of the first user and the second user, and other node devices in the blockchain system may determine whether the first user and the second user have authorized the second node device to query for the article exchange eligibility of the first user and the second user. For example, the first user and the second user may pre-upload authorization information into the blockchain system indicating that the second node device in the blockchain system is authorized to query for the item exchange qualifications of the first user and the second user. In this way, other node devices in the blockchain system can query the authorization information of the first user and the second user when receiving the query request, and determine whether the first user and the second user authorize the second node device to query the article exchange qualification of the first user and the second user according to the query result. Specifically, if the authorization information is queried, it may be determined that the first user and the second user have authorized the second node device to query the article exchange qualification of the first user and the second user, and if the authorization information is not queried, it may be determined that the first user and the second user do not authorize the second node device to query the article exchange qualification of the first user and the second user. In addition, the first user and the second user can authorize the node device corresponding to the bank to automatically complete the items of the loan settlement and the loan application, and the authorization mode is the same as the authorization mode for authorizing the second node device to inquire about the article exchange qualification of the first user and the second user, and the details are not repeated.
In one possible implementation, before acquiring the item ownership information of the first user and the item ownership information of the second user from the blockchain, the method further includes: the item ownership information of the first user and the item ownership information of the second user are stored into the blockchain.
The article ownership information of the first user and the article ownership information of the second user may be prestored in the blockchain by the second node device, or may be prestored in the blockchain by a node device other than the second node device. The respective property information of the first user and the second user may be stored in the blockchain by a node device corresponding to the property management mechanism, and, taking the property as an example, the respective property information of the first user and the second user may be stored in the blockchain by a node device corresponding to the housing management mechanism.
The manner in which the node device stores the item ownership information of the first user and the item ownership information of the second user in the blockchain is the same as the manner in which the item exchange contract is stored in the blockchain in step 503, and the specific details are described with reference to fig. 3 and fig. 4, and are not repeated herein.
Step 505 is one possible implementation of obtaining the item ownership information of the first user and the item ownership information of the second user from the blockchain. By querying the article exchange qualification of the first user and the second user only when the condition is satisfied, the smooth completion of the article exchange process can be ensured.
506. The item exchange contract is executed when the second node device determines that the first user and the second user satisfy the item exchange qualification based on the item ownership information of the first user and the item ownership information of the second user.
The second node device may learn, according to the article ownership information of the first user, which articles the first user owns, learn, according to the article ownership information of the second user, which articles the second user owns, and determine, based on these information, whether the first user and the second user satisfy the article exchange qualification. If the item exchange qualification is not satisfied, the item exchange contract is not executed, and if the item exchange qualification is satisfied, an item exchange process between the first user and the second user is automatically completed.
In one possible implementation, this step 506 may include: and executing the article exchange contract when the quantity of the article ownership corresponding to the first user meets the quantity condition after the article exchange process is completed according to the article ownership information of the first user and the article ownership information of the second user.
The article ownership corresponding to the first user comprises the article ownership of the first user and the article ownership of the family member of the first user, and the article ownership of the second user comprises the article ownership of the second user and the article ownership of the family member of the second user.
For the ownership of the first user's household member, the second node device may obtain the ownership information of the first user's household member from the blockchain, so as to learn which household member of the first user owns the ownership of the first user's household member. Specifically, the second node device may first obtain the family member information of the first user from the blockchain, learn which family members of the first user have, and then obtain the item ownership information of these family members from the blockchain. The information of the family members of the first user may be stored in the blockchain by node devices corresponding to civil authorities, the information of the ownership of the articles of the family members of the first user may be stored in the blockchain by node devices corresponding to the ownership of articles management authorities, and the information of the ownership of the articles of the family members of the first user may be stored in the blockchain by node devices corresponding to the housing management authorities, taking articles as properties.
The first user and the second user meeting the article exchange qualification may mean that after the first user and the second user complete the article exchange process, the number of the article ownership corresponding to the first user and the number of the article ownership corresponding to the second user both meet a number condition, and the number condition may be less than a number threshold. Taking an article as a property for example, the first user and the second user satisfy the article exchange qualification, that is, the first user and the second user satisfy the existing limited purchase rule.
If it is determined that the first user and the second user satisfy the item exchange qualification, the second node device may execute the item exchange contract to automatically complete an item exchange process between the first user and the second user contracted in the item exchange contract.
507. The second node device generates item exchange completion information and stores the item exchange completion information into the blockchain.
Wherein the item exchange completion information is used to indicate that an item exchange process between the first user and the second user is complete.
After the second node device completes the article exchange process between the first user and the second user, article exchange completion information can be generated and synchronized to the blockchain, so that other node devices in the blockchain system can receive the article exchange completion information and complete corresponding operations according to requirements. Taking an article as a house property as an example, after node equipment corresponding to a bank receives the article exchange completion information, the operation of loan settlement and loan application can be completed, and after node equipment corresponding to a housing administration receives the article completion information, the operation of passing the house property can be completed. The manner in which the second node device stores the item exchange completion information in the blockchain is the same as the manner in which the first node device stores the item exchange contract in the blockchain in step 503, and the specific details refer to the corresponding descriptions in fig. 3 and fig. 4, which are not repeated here.
In one possible implementation, the second node device may also modify the status flag of the item exchange contract from an incomplete state to a completed state. By modifying the status flag of an item exchange contract after completion of the item exchange contract, the node device is made aware that the item exchange contract in the blockchain is completed.
It should be noted that, step 507 is an optional step, for example, if in step 506, an abnormality occurs when the second node device executes the item exchange contract, so that the item exchange process between the first user and the second user is not completed, the second node device may retry or prompt an error, without executing step 507.
According to the technical scheme, the technology of the blockchain and the intelligent contract is adopted, the article ownership information and the personal information of the user are stored through the blockchain, signed and exchanged in the intelligent contract mode, and the transaction is automatically completed under the condition that the conditions are met through the multiparty intelligent contract, so that the trust problem in the transaction is solved; the time consumption of the transaction is reduced, the transaction is automatically completed after the condition is met, no participation of a third party is needed, and the problems of trust, difficult operation and the like in the process of exchanging the articles in the related technology are solved.
According to the method provided by the embodiment of the application, the unfinished article exchange contract is acquired from the blockchain of the blockchain system, then the article ownership information of the two exchange parties corresponding to the article exchange contract is acquired, when the two exchange parties are determined to meet the article exchange qualification, the article exchange process is automatically completed without a third party, the trust problem in the related technology is solved, and the reliability of the article exchange is improved.
Fig. 6 is a schematic structural diagram of a block chain-based article exchange device according to an embodiment of the present application. Referring to fig. 6, the apparatus includes:
an obtaining module 601, configured to obtain an item exchange contract in an unfinished state from a blockchain of the blockchain system, where the item exchange contract is used to perform an item exchange process between a first user and a second user;
the obtaining module 601 is further configured to obtain, from the blockchain, item ownership information of the first user corresponding to the item exchange contract, and item ownership information of the second user corresponding to the item exchange contract;
an execution module 602, configured to execute the item exchange contract when it is determined that the first user and the second user satisfy the item exchange qualification according to the item ownership information of the first user and the item ownership information of the second user.
In one possible implementation, the execution module 602 is configured to:
when the quantity of the article ownership corresponding to the first user after the article exchange process is completed is determined to meet the quantity condition according to the article ownership information of the first user and the article ownership information of the second user, and the quantity of the article ownership corresponding to the second user meets the quantity condition, executing the article exchange contract;
the article ownership corresponding to the first user comprises the article ownership of the first user and the article ownership of the family member of the first user, and the article ownership of the second user comprises the article ownership of the second user and the article ownership of the family member of the second user.
In one possible implementation, the item exchange contract includes the following information:
the first user's item exchange demand information indicating that a second item of the second user is exchanged using the first item of the first user;
the second user's item exchange demand information indicating that the first item of the first user is exchanged using the second user's second item.
In one possible implementation, the item exchange requirement information of the first user is further used to instruct the first user to obtain the target funds, and the item exchange requirement information of the second user is further used to instruct the second user to pay out the target funds;
the item exchange contract also includes an item exchange condition including the second user having deposited a target funds into a target account of the blockchain.
In one possible implementation, the obtaining module 601 is configured to:
and when the item exchange condition is determined to be met, acquiring the item ownership information of the first user and the item ownership information of the second user from the blockchain.
In one possible implementation, the item exchange condition further includes the first user and the second user having applied for a loan qualification.
In one possible implementation, the apparatus further includes:
the receiving module is used for receiving an article exchange request, wherein the article exchange request carries article exchange demand information of the first user and article exchange demand information of the second user;
the generation module is used for generating the article exchange contract based on the article exchange demand information of the first user and the article exchange demand information of the second user carried by the article exchange request;
And the storage module is used for signing the article exchange contract by using the private key of the first user and the private key of the second user and then storing the signed article exchange contract into the blockchain.
In one possible implementation, the obtaining module 601 is configured to:
the timing obtains the item exchange contract in an unfinished state from the blockchain.
In one possible implementation, the apparatus further includes:
and the storage module is used for storing the article ownership information of the first user and the article ownership information of the second user into the blockchain.
In one possible implementation, the apparatus further includes:
the generation module is used for generating article exchange completion information;
and the storage module is used for storing the article exchange completion information into the blockchain.
In one possible implementation, the obtaining module 601 is configured to:
an item exchange contract whose status is marked as incomplete is obtained from a blockchain of the blockchain system.
In one possible implementation, the apparatus further includes:
and a modifying module for modifying the status flag of the item exchange contract from an incomplete state to a completed state.
It should be noted that: in the block chain-based article exchange device provided in the above embodiment, only the division of the above functional modules is used for illustration when exchanging articles, in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the blockchain-based item exchange device and the blockchain-based item exchange method provided in the foregoing embodiments belong to the same concept, and detailed implementation processes of the blockchain-based item exchange device and the blockchain-based item exchange method are detailed in the method embodiments and are not described herein.
The node device provided by the above technical solution may be implemented as a terminal or a server, where the schematic structural diagram of the terminal is shown in fig. 7, and the schematic structural diagram of the server is shown in fig. 8.
Fig. 7 is a schematic structural diagram of a terminal 700 according to an embodiment of the present application. The terminal 700 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal 700 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 700 includes: one or more processors 701, and one or more memories 702.
Processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 701 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 702 is used to store at least one instruction for execution by processor 701 to implement the blockchain-based item exchange method provided by the method embodiments of the present application.
In some embodiments, the terminal 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 703 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 704, a display 705, a camera assembly 706, audio circuitry 707, a positioning assembly 708, and a power supply 709.
A peripheral interface 703 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 701 and memory 702. In some embodiments, the processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 704 is configured to receive and transmit RF (Radio Frequency) signals, also referred to as electromagnetic signals. The radio frequency circuitry 704 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 704 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 704 may also include NFC (Near Field Communication ) related circuitry, which is not limiting of the application.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 705 is a touch display, the display 705 also has the ability to collect touch signals at or above the surface of the display 705. The touch signal may be input to the processor 701 as a control signal for processing. At this time, the display 705 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 705 may be one, providing a front panel of the terminal 700; in other embodiments, the display 705 may be at least two, respectively disposed on different surfaces of the terminal 700 or in a folded design; in still other embodiments, the display 705 may be a flexible display disposed on a curved surface or a folded surface of the terminal 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 705 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 706 is used to capture images or video. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing, or inputting the electric signals to the radio frequency circuit 704 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 700. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 707 may also include a headphone jack.
The location component 708 is operative to locate the current geographic location of the terminal 700 for navigation or LBS (Location Based Service, location-based services).
A power supply 709 is used to power the various components in the terminal 700. The power supply 709 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 700 further includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: acceleration sensor 711, gyroscope sensor 712, pressure sensor 713, fingerprint sensor 714, optical sensor 715, and proximity sensor 716.
The acceleration sensor 711 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 700. For example, the acceleration sensor 711 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 701 may control the display screen 705 to display a user interface in a landscape view or a portrait view based on the gravitational acceleration signal acquired by the acceleration sensor 711. The acceleration sensor 711 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 712 may detect a body direction and a rotation angle of the terminal 700, and the gyro sensor 712 may collect a 3D motion of the user to the terminal 700 in cooperation with the acceleration sensor 711. The processor 701 may implement the following functions based on the data collected by the gyro sensor 712: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 713 may be disposed at a side frame of the terminal 700 and/or at a lower layer of the display screen 705. When the pressure sensor 713 is disposed at a side frame of the terminal 700, a grip signal of the user to the terminal 700 may be detected, and the processor 701 performs left-right hand recognition or quick operation according to the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed at the lower layer of the display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 714 is used to collect a fingerprint of the user, and the processor 701 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 714 may be provided on the front, back or side of the terminal 700. When a physical key or vendor Logo is provided on the terminal 700, the fingerprint sensor 714 may be integrated with the physical key or vendor Logo.
The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 may control the display brightness of the display screen 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 705 is turned up; when the ambient light intensity is low, the display brightness of the display screen 705 is turned down. In another embodiment, the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 715.
A proximity sensor 716, also referred to as a distance sensor, is typically provided on the front panel of the terminal 700. The proximity sensor 716 is used to collect the distance between the user and the front of the terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front face of the terminal 700 gradually decreases, the processor 701 controls the display 705 to switch from the bright screen state to the off screen state; when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 gradually increases, the processor 701 controls the display screen 705 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 7 is not limiting of the terminal 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 8 is a schematic structural diagram of a server 800 according to an embodiment of the present application, where the server 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 and one or more memories 802, where at least one program code is stored in the memories 802, and the at least one program code is loaded and executed by the processors 801 to implement the methods provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium storing at least one program code, such as a memory storing at least one program code, is also provided, where the at least one program code is loaded and executed by a processor to implement the blockchain-based item exchange method in the above embodiment. For example, the computer readable storage medium may be Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), compact disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, optical data storage device, etc.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing is illustrative of the present application and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., which fall within the spirit and principles of the present application.

Claims (24)

1. A blockchain-based item exchange method for use with a node device in a blockchain system, the method comprising:
obtaining an item exchange contract in an unfinished state from a blockchain of the blockchain system, wherein the item exchange contract is used for executing an item exchange process between a first user and a second user;
acquiring article ownership information of the first user corresponding to the article exchange contract and article ownership information of the second user corresponding to the article exchange contract from the blockchain;
Executing the article exchange contract when the quantity of the article ownership corresponding to the first user after the article exchange process is completed is determined to meet a quantity condition according to the article ownership information of the first user and the article ownership information of the second user, and the quantity of the article ownership corresponding to the second user meets the quantity condition;
the article ownership corresponding to the first user comprises the article ownership of the first user and the article ownership of the family member of the first user, and the article ownership of the second user comprises the article ownership of the second user and the article ownership of the family member of the second user.
2. The method of claim 1, wherein the item exchange contract includes the following information:
the first user's item exchange requirement information indicating that a second item of the second user is exchanged using the first item of the first user;
the second user's item exchange demand information indicating that the first item of the first user is exchanged using the second user's second item.
3. The method of claim 2, wherein the first user's item exchange demand information is further used to indicate that the first user obtains a target funds, and the second user's item exchange demand information is further used to indicate that the second user pays a target funds;
the item exchange contract also includes an item exchange condition including the second user having deposited a target funds into a target account of the blockchain.
4. The method of claim 3, wherein the obtaining, from the blockchain, item ownership information of the first user corresponding to the item exchange contract and item ownership information of the second user corresponding to the item exchange contract comprises:
and when the article exchange condition is determined to be met, acquiring the article ownership information of the first user and the article ownership information of the second user from the blockchain.
5. The method of claim 1, wherein prior to the acquiring the item exchange contract in an unfinished state from the blockchain of the blockchain system, the method further comprises:
Receiving an article exchange request, wherein the article exchange request carries the article exchange demand information of the first user and the article exchange demand information of the second user;
generating the article exchange contract based on the article exchange demand information of the first user and the article exchange demand information of the second user carried by the article exchange request;
and signing the goods exchange contract by using the private key of the first user and the private key of the second user, and storing the signed goods exchange contract into the blockchain.
6. The method of claim 1, wherein after the executing the item exchange contract, the method further comprises:
modifying the status flag of the item exchange contract from an incomplete state to a completed state.
7. The method of claim 3, wherein the item exchange condition further comprises the first user and the second user having applied for a loan qualification.
8. The method of claim 1, wherein prior to the obtaining, from the blockchain, item ownership information for the first user corresponding to the item exchange contract, and item ownership information for the second user corresponding to the item exchange contract, the method further comprises:
And storing the article ownership information of the first user and the article ownership information of the second user into the blockchain.
9. The method of claim 1, wherein the acquiring the item exchange contract in an unfinished state from a blockchain of the blockchain system comprises:
periodically acquiring an item exchange contract in an unfinished state from the blockchain.
10. The method of claim 1, wherein after the executing the item exchange contract, the method further comprises:
generating article exchange completion information;
storing the item exchange completion information into the blockchain.
11. The method of claim 1, wherein the acquiring the item exchange contract in an unfinished state from a blockchain of the blockchain system comprises:
an item exchange contract whose status is marked as incomplete is obtained from a blockchain of the blockchain system.
12. A blockchain-based item exchange device, the device comprising:
an acquisition module for acquiring an item exchange contract in an unfinished state from a blockchain of a blockchain system, the item exchange contract being used for executing an item exchange process between a first user and a second user;
The acquisition module is further used for acquiring the article ownership information of the first user corresponding to the article exchange contract and the article ownership information of the second user corresponding to the article exchange contract from the blockchain;
the execution module is used for executing the article exchange contract when the quantity of the article ownership corresponding to the first user meets the quantity condition after the article exchange process is completed according to the article ownership information of the first user and the article ownership information of the second user and the quantity of the article ownership corresponding to the second user meets the quantity condition;
the article ownership corresponding to the first user comprises the article ownership of the first user and the article ownership of the family member of the first user, and the article ownership of the second user comprises the article ownership of the second user and the article ownership of the family member of the second user.
13. The apparatus of claim 12, wherein the item exchange contract includes the following information:
the first user's item exchange requirement information indicating that a second item of the second user is exchanged using the first item of the first user;
The second user's item exchange demand information indicating that the first item of the first user is exchanged using the second user's second item.
14. The apparatus of claim 13, wherein the first user's item exchange demand information is further for indicating that the first user obtains a target funds, and wherein the second user's item exchange demand information is further for indicating that the second user pays a target funds;
the item exchange contract also includes an item exchange condition including the second user having deposited a target funds into a target account of the blockchain.
15. The apparatus of claim 14, wherein the acquisition module is configured to:
and when the article exchange condition is determined to be met, acquiring the article ownership information of the first user and the article ownership information of the second user from the blockchain.
16. The apparatus of claim 12, wherein the apparatus further comprises:
the receiving module is used for receiving an article exchange request, wherein the article exchange request carries the article exchange requirement information of the first user and the article exchange requirement information of the second user;
The generation module is used for generating the article exchange contract based on the article exchange demand information of the first user and the article exchange demand information of the second user carried by the article exchange request;
and the storage module is used for signing the article exchange contract by using the private key of the first user and the private key of the second user, and storing the signed article exchange contract into the blockchain.
17. The apparatus of claim 12, wherein the apparatus further comprises:
and the modifying module is used for modifying the state mark of the article exchange contract from an incomplete state to a completed state.
18. The apparatus of claim 14, wherein the item exchange condition further comprises the first user and the second user having applied for a loan qualification.
19. The apparatus of claim 12, wherein the apparatus further comprises:
and the storage module is used for storing the article ownership information of the first user and the article ownership information of the second user into the blockchain.
20. The apparatus of claim 12, wherein the acquisition module is configured to:
Periodically acquiring an item exchange contract in an unfinished state from the blockchain.
21. The apparatus of claim 12, wherein the apparatus further comprises:
the generation module is used for generating article exchange completion information;
and the storage module is used for storing the article exchange completion information into the blockchain.
22. The apparatus of claim 12, wherein the acquisition module is configured to:
an item exchange contract whose status is marked as incomplete is obtained from a blockchain of the blockchain system.
23. A computer device comprising a processor and a memory having stored therein at least one program code that is loaded and executed by the processor to implement the blockchain-based item exchange method of any of claims 1 to 11.
24. A computer readable storage medium having stored therein at least one program code, the at least one program code loaded and executed by a processor to implement the blockchain-based item exchange method of any of claims 1 to 11.
CN201911268211.2A 2019-12-11 2019-12-11 Article exchange method, device, equipment and storage medium based on blockchain Active CN111028059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911268211.2A CN111028059B (en) 2019-12-11 2019-12-11 Article exchange method, device, equipment and storage medium based on blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911268211.2A CN111028059B (en) 2019-12-11 2019-12-11 Article exchange method, device, equipment and storage medium based on blockchain

Publications (2)

Publication Number Publication Date
CN111028059A CN111028059A (en) 2020-04-17
CN111028059B true CN111028059B (en) 2023-09-15

Family

ID=70205871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911268211.2A Active CN111028059B (en) 2019-12-11 2019-12-11 Article exchange method, device, equipment and storage medium based on blockchain

Country Status (1)

Country Link
CN (1) CN111028059B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201805871A (en) * 2016-08-03 2018-02-16 碩網資訊股份有限公司 A barter system using block chain technology and method thereof
WO2018090331A1 (en) * 2016-11-18 2018-05-24 深圳前海达闼云端智能科技有限公司 Blockchain network, article transaction method and apparatus, and node device
CN109074580A (en) * 2016-02-23 2018-12-21 区块链控股有限公司 Method and system for secure transfer of entities over a blockchain
CN109155035A (en) * 2016-02-23 2019-01-04 区块链控股有限公司 Method and system for efficient transfer of entities on a point-to-point distributed book using blockchains
CN109829824A (en) * 2019-03-05 2019-05-31 河钢国际科技(北京)有限公司 A kind of commodity transaction information sharing method based on block chain technology
CN110264226A (en) * 2019-06-28 2019-09-20 江苏物联网研究发展中心 It is a kind of based on block chain article retrospect and exchange contract system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170200147A1 (en) * 2016-01-08 2017-07-13 Akbar Ali Ansari System and the computer methods of issuing, transferring and manipulating value or gift cards using blockchain technology
US11164228B2 (en) * 2016-06-24 2021-11-02 Raise Marketplace, Llc Method and medium for determining exchange item compliance in an exchange item marketplace network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109074580A (en) * 2016-02-23 2018-12-21 区块链控股有限公司 Method and system for secure transfer of entities over a blockchain
CN109155035A (en) * 2016-02-23 2019-01-04 区块链控股有限公司 Method and system for efficient transfer of entities on a point-to-point distributed book using blockchains
TW201805871A (en) * 2016-08-03 2018-02-16 碩網資訊股份有限公司 A barter system using block chain technology and method thereof
WO2018090331A1 (en) * 2016-11-18 2018-05-24 深圳前海达闼云端智能科技有限公司 Blockchain network, article transaction method and apparatus, and node device
CN109829824A (en) * 2019-03-05 2019-05-31 河钢国际科技(北京)有限公司 A kind of commodity transaction information sharing method based on block chain technology
CN110264226A (en) * 2019-06-28 2019-09-20 江苏物联网研究发展中心 It is a kind of based on block chain article retrospect and exchange contract system

Also Published As

Publication number Publication date
CN111028059A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN110602089B (en) Block chain-based medical data storage method, device, equipment and storage medium
CN109615515B (en) Credit right certificate transfer method, device, electronic equipment and storage medium
CN110598482B (en) Digital certificate management method, device, equipment and storage medium based on blockchain
CN108614878B (en) Protocol data management method, device, storage medium and system
CN111080443B (en) Block chain-based service processing method, device, equipment and storage medium
CN110689460B (en) Traffic accident data processing method, device, equipment and medium based on block chain
WO2020258748A1 (en) Bank card binding system, method and apparatus, and device and storage medium
CN111401867A (en) Resource transfer method and device based on block chain, node equipment and storage medium
CN111245745A (en) Message sending method, device, node equipment and storage medium
CN111340482B (en) Conflict detection method, device, node equipment and storage medium
CN110597924B (en) Block chain-based user identification processing method, device, equipment and storage medium
CN110826103B (en) Method, device, equipment and storage medium for processing document authority based on blockchain
CN110555780B (en) Insurance data processing method, device and equipment based on block chain and storage medium
CN111339086A (en) Block processing method, and data query method and device based on block chain
CN110933113A (en) Block chain-based interactive behavior detection method, device, equipment and storage medium
CN111260347A (en) Resource processing method, device and equipment based on block chain and storage medium
CN110598386B (en) Block chain-based data processing method, device, equipment and storage medium
CN111212074B (en) Blockchain-based qualification identification method, device, equipment and storage medium
CN111667371B (en) Resource aggregation method, system, device and storage medium based on block chain
CN110599210B (en) Information management method and device for block chain
CN111145034A (en) Block chain-based social security management method, device and system and storage medium
CN111327427B (en) Method, device, node equipment, system and storage medium for submitting alternative blocks
CN110597868B (en) Information query method, device, terminal and storage medium based on block chain
CN110597840B (en) Partner relationship establishment method, device, equipment and storage medium based on blockchain
CN110570289A (en) service processing method, device, equipment and storage medium based on block chain

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
GR01 Patent grant
GR01 Patent grant