WO2023045532A1 - Blockchain-based transaction processing - Google Patents

Blockchain-based transaction processing Download PDF

Info

Publication number
WO2023045532A1
WO2023045532A1 PCT/CN2022/107785 CN2022107785W WO2023045532A1 WO 2023045532 A1 WO2023045532 A1 WO 2023045532A1 CN 2022107785 W CN2022107785 W CN 2022107785W WO 2023045532 A1 WO2023045532 A1 WO 2023045532A1
Authority
WO
WIPO (PCT)
Prior art keywords
participant
service time
time window
smart contract
transaction
Prior art date
Application number
PCT/CN2022/107785
Other languages
French (fr)
Chinese (zh)
Inventor
韩喆
陈聪明
Original Assignee
蚂蚁区块链科技(上海)有限公司
支付宝(杭州)信息技术有限公司
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 蚂蚁区块链科技(上海)有限公司, 支付宝(杭州)信息技术有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023045532A1 publication Critical patent/WO2023045532A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Definitions

  • the present disclosure relates to the technical field of block chains, in particular to a transaction processing method and device based on block chains.
  • the off-chain service of the participant is not available, for example, if it is not within the time window for the participant to provide services, the transaction will not be accepted for a long time, and a large number of unavailable Completed transactions cause on-chain transactions to block.
  • the present disclosure provides a blockchain-based transaction processing method and device to avoid on-chain transaction blocking caused by not being within the service time window of the participant.
  • a transaction processing method based on a block chain is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction
  • the service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, the method includes : Receive the first call request of the first smart contract from the first participant, the first call request is used to set the service time window of the first participant; according to the first call request, set The service time window of the first participant.
  • a transaction processing method based on a block chain is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction
  • the service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, and the method applies
  • the method includes: sending a first call request of the first smart contract to the block chain, the first call request is used to set the service time of the first participant window.
  • a block chain-based transaction processing device where a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction
  • the service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction
  • the at least one party includes the first party
  • the device includes : a first receiving unit configured to receive a first call request of the first smart contract from the first participant, the first call request is used to set the service time window of the first participant; set A unit configured to set a service time window of the first participant according to the first call request.
  • a block chain-based transaction processing device is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of the multiple participants in the target transaction.
  • the service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, and the device application
  • the device includes: a sending unit configured to send a first call request of the first smart contract to the blockchain, the first call request is used to set the first A service time window for a party.
  • a block chain-based transaction processing device including a memory and a processor, wherein executable code is stored in the memory, and the processor is configured to execute the executable code, so as to realize the The method described in one aspect or the second aspect.
  • a computer-readable storage medium on which executable code is stored, and when the executable code is executed, the method as described in the first aspect or the second aspect can be implemented.
  • a computer program product including executable codes, and when the executable codes are executed, the method as described in the first aspect or the second aspect can be implemented.
  • FIG. 1 is an example diagram of a blockchain system provided by an embodiment of the present disclosure.
  • FIG. 2 is a schematic diagram of a transaction involving multiple parties provided by an embodiment of the present disclosure.
  • FIG. 3 is an example diagram of a system architecture provided by an embodiment of the present disclosure.
  • Fig. 4 is an example diagram of a first smart contract provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart of a transaction processing method based on blockchain provided by an embodiment of the present disclosure.
  • Fig. 6 is a schematic flowchart of setting a service time window of a first participant provided by an embodiment of the present disclosure.
  • Fig. 7 is a schematic flowchart of querying the service time window of the first participant provided by an embodiment of the present disclosure.
  • FIG. 8 is an exemplary diagram of another system architecture provided by an embodiment of the present disclosure.
  • Fig. 9 is a schematic structural diagram of a transaction processing device based on blockchain provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a blockchain-based transaction processing device provided by another disclosed embodiment of the present disclosure.
  • Fig. 11 is a schematic structural diagram of a transaction processing device based on blockchain provided by another embodiment of the present disclosure.
  • Blockchain is a distributed chain storage accounting technology based on cryptography technology. Blockchain technology can organize and maintain a large amount of data in a decentralized or multi-centralized manner. It has the characteristics of distributed, non-tamperable, traceable, safe and reliable, and has been widely used in many fields.
  • Fig. 1 is an example diagram of a blockchain system provided by an embodiment of the present disclosure.
  • a blockchain system 100 may include a blockchain client (client for short) 110 and a blockchain network 120 .
  • the blockchain network 120 may include multiple blockchain nodes (referred to as nodes), for example, node 120-A, node 120-B, node 120-C, ..., node 120-N in FIG. 1 .
  • the client 110 and/or the nodes in the blockchain network 120 may include various types of computing devices, such as smart phones, desktop computers, or servers.
  • the server may be an independent server or a server group, and the server group may be centralized or distributed.
  • the server may execute on a cloud platform.
  • the client 110 is a terminal that can use blockchain services.
  • the client 110 can link to a certain node in the blockchain network 120 to obtain blockchain services.
  • the client 110 can obtain blockchain services by initiating a blockchain transaction (transaction for short, also called a request), that is, the client 110 can generate a transaction and send the generated transaction to the block chain network 120 .
  • a blockchain transaction transaction for short, also called a request
  • Nodes in the blockchain network 120 may receive transactions broadcast in the blockchain network 120 . After receiving the transaction, the blockchain node can perform related operations according to the transaction content, that is, execute the transaction. For example, transferring funds (or assets) between accounts to perform remittance transactions. Another example is to query blockchain data to execute transactions for querying data. Alternatively, invoke (or execute) a smart contract deployed on the blockchain to execute a transaction that invokes the smart contract.
  • a smart contract is a set of promises defined in digital form, including an agreement on which the parties to the contract can enforce those promises.
  • the essence of a smart contract is a piece of code running in the blockchain network to complete the business logic assigned by the user.
  • a smart contract can contain information about a transaction, and the resulting action will only be executed if the requirements are met. Smart contracts can execute traceable, irreversible and secure transactions.
  • blockchain has the characteristics of non-tampering, security and trustworthiness. Therefore, conducting transactions on the blockchain can solve the problem of mutual trust between transaction participants. Based on this, blockchain can be used as an important development direction in transaction scenarios involving multi-party participation. For example, blockchain can be widely used in fund transfer (such as remittance transactions), trade finance, equipment leasing and other transaction scenarios involving multi-party participation and natural distrust.
  • fund transfer such as remittance transactions
  • trade finance such as equipment leasing and other transaction scenarios involving multi-party participation and natural distrust.
  • a transaction can have multiple parties.
  • the plurality of parties may include party A, which may be the initiator of the transaction.
  • the multiple participants may also include participant B and participant C, and participant B and participant C may be the promoter or executor of the transaction.
  • participant A may refer to the initiator of the remittance transaction (for example, the financial system of an enterprise), participant B may refer to the remittance bank, and participant C may refer to the beneficiary bank.
  • Participant A can initiate a remittance request to the blockchain, requesting participant B to pay a certain amount of funds to a certain bank account of participant C from its corresponding bank account.
  • the remittance transaction may refer to cross-border remittance.
  • the remittance transaction may refer to inter-bank remittance.
  • participant A may refer to the lessee (for example, a factory), participant B may refer to the lessor (for example, a leasing platform), and participant C may refer to the supplier.
  • Participant A can initiate a lease request to the blockchain, requesting participant B to lease a certain device to participant A. After receiving the request, participant B needs to request participant C to send the device to participant A.
  • the blockchain when the blockchain is responsible for recording the transaction on the chain and advancing the transaction status, and the real transaction operation requires the cooperation of the participants off the chain (for example, in the remittance transaction, the participant B sends Participant C remits money; or, in the equipment leasing transaction, supplier C sends the equipment to participant A) off the chain.
  • the transaction cannot be automatically promoted on the chain, but requires the participant to call the relevant smart Contract interface to advance transaction state.
  • transaction reliability verification can be performed on the blockchain.
  • the real fund transfer also depends on the participants operating off-chain, and the on-chain status of each transaction needs to be confirmed by the participants.
  • the participant's off-chain service is unavailable when the on-chain state of the transaction needs to be confirmed by the participant, for example, it is not within the time window in which the participant can provide the service, which will cause the transaction state on the current blockchain to be unavailable. It may remain as "created, pending confirmation by the participant", until the participant's business system calls the smart contract interface to advance the transaction, the transaction can normally reach the final state on the chain. In other words, the completion of a transaction depends on the service capabilities of each participant, especially the time window in which services can be provided.
  • the participant fails to confirm the transaction status in time after the transaction is initiated, the transaction will not be accepted for a long time, and in turn, a large number of unfinished transactions will cause transaction blockage on the chain.
  • transaction congestion can affect customer experience.
  • a remittance transaction involving fund transfer after participant A initiates a request for a remittance transaction, the initiation time of the remittance transaction is not within the time window during which participant C can provide services, resulting in the occupation of funds for this remittance transaction.
  • participant A is not aware of the situation, and cannot use the funds, which affects the customer experience.
  • the transaction can be carried out through the money transfer company.
  • Quick Remittance Company can pre-deposit the account in the corresponding beneficiary bank first, so that the transaction involving multiple parties can be transformed into two independent intra-bank remittances (the remittance bank directly conducts intra-bank transfer and collection, and the beneficiary bank also directly conducts intra-bank transfer and remittance ).
  • the embodiments of the present disclosure provide a blockchain-based transaction processing method and device, so as to avoid on-chain transaction blocking caused by not being within the service time window of the participant.
  • Fig. 3 is an example diagram of a system architecture provided by an embodiment of the present disclosure.
  • the system 300 may include a first participant 310 , a second participant 320 and a blockchain 330 . Both the first party 310 and the second party 320 belong to one of a plurality of parties to the target transaction.
  • the first participant 310 may be a promoter or an execution party of the target transaction. During the completion of a target transaction, multiple first participants 310 may promote or execute the target transaction.
  • the first participant 310 can operate the target transaction off-chain. In addition, the first participant 310 can also confirm the target transaction, and then submit the confirmation result to the blockchain to automatically advance the status of the target transaction.
  • the second party 320 may be the initiator of the targeted transaction.
  • the second participant 320 may initiate a remittance transaction on the blockchain.
  • the first participant 310 and the second participant 320 may be clients on the blockchain.
  • the first participant 310 and the second participant 320 can send a smart contract call request to the block chain 330 (or block chain network) in the form of a transaction, and all nodes in the block chain 330 call and execute the corresponding smart contract.
  • the first participant 310 and the second participant 320 can communicate with the blockchain 330 . In some embodiments, there is no direct communication between the first party 310 and the second party 320 .
  • a first smart contract can be deployed in the block chain 330, and the first smart contract can be used to manage the service time window of at least one of the multiple participants in the target transaction, wherein the service time window of at least one participant can be Used to indicate the time when the at least one participant can participate in the target transaction.
  • the first smart contract can be used to manage the service time window of the first party 310 .
  • the first smart contract may contain 2 main interfaces. Calling the first interface may set its own service time window, for example, the first participant 310 may set its own service time window through the first interface. Calling the second interface can query the service time window of the first participant, for example, the second participant 320 can query the service time window of the first participant 310 through the second interface.
  • the first smart contract may include a first interface (or called, an interface for setting a service time window, setupServiceTimeWindow) and a second interface (or called, an interface for querying a service time window, queryServiceTimeWindow).
  • the first smart contract may also include stored on-chain persistent data.
  • the first participant can call the first interface to create or update its own service time window information.
  • the first smart contract receives the calling request of the first interface, it can correspondingly create or update the content of the persistent data on the chain according to the calling request.
  • the present disclosure does not specifically limit the content of the on-chain persistent data stored in the first smart contract.
  • the core on-chain persistent data in the first smart contract may include the information of the service time window of each first participant and the loop rule (loop_order) within the service time window.
  • the information of the service time window of the first participant may include a series of time slice information (TimeSlice), and a service time window (ServiceTimeWindow) composed of combined information of these time slices.
  • TimeSlice time slice information
  • ServiceTimeWindow service time window
  • each time slice may include a pair of start and end times and a corresponding time zone, and the start and end times are the corresponding service time windows of the first participant.
  • the row with an id of 1 may indicate that the service time window of the first participant is 9:00-16:00 corresponding to the time zone GMT+8 (Eastern Eighth District).
  • the first participant or the second participant may call the second interface to query the service time window of a certain first participant, so as to confirm whether the first participant can provide services at a certain time point.
  • the first smart contract can dynamically analyze the rules corresponding to each service time window. After the parsing is completed, it can be judged whether the current day in the time point to be matched (for example, the initiation time of the target transaction, the current time point, etc.) matches the date matching (day_match) rule in the time slice. After matching, further match the time point to be matched with the start and end time in the time slice. If they all match, it can be considered that the time point to be matched matches the time slice, and then it can be known whether each service time window matches.
  • the current day in the time point to be matched for example, the initiation time of the target transaction, the current time point, etc.
  • day_match date matching
  • the date matching rules can be directly written into the first smart contract.
  • an input parameter can be added to the second interface, allowing the first participant to define its own corresponding date matching rules. For example, the judgment rules for weekends and weekdays are universal and can be directly written in the logic of the first smart contract, while various holidays will change dynamically, allowing the first participant to customize the settings.
  • the block chain-based transaction processing method provided by the embodiment of the present disclosure will be described in detail below with reference to FIG. 5 .
  • the blockchain-based transaction processing method provided by the embodiments of the present disclosure can be applied to the system architecture shown in FIG. 3 .
  • the method shown in Fig. 5 is described from the perspective of interaction between the first participant and the blockchain.
  • step 510 the first participant sends a first invocation request of the first smart contract to the block chain.
  • the first call request may be used to set the service time window of the first participant.
  • the first call request may include the service time rules of the first participant.
  • the service time rule can be used to indicate the time when the first participant can provide the service.
  • the service time rule can indicate that the service is available or unavailable in a certain period of time.
  • the service time rule can take any of the following forms or Its combination: "Not available every Saturday 12:00 to every Sunday 18:00", “Not available on US holidays", or "Available every weekday 9:00-18:00".
  • the first participant may send the first call request by calling an interface in the first smart contract.
  • the first participant can call the first interface in the first smart contract to set its own service time window.
  • step 520 the blockchain sets the service time window of the first participant according to the first call request.
  • the blockchain After receiving the first call request sent by the first participant, the blockchain can set the service time window of the first participant according to the first call request. For example, when the service time window of the first participant is not stored in the blockchain, the blockchain can create the service time window of the first participant in the blockchain according to the first call request; or, when the block chain When the service time window of the first participant has been stored in the chain, the block chain can update the service time window of the first participant stored in the block chain according to the first call request.
  • the block chain after the block chain receives the first call request sent by the first participant, it can check the authority of the first participant to confirm whether the first call request is the corresponding first call request. It is sent by one participant, so as to ensure that each first participant can only call the interface to set its own service time window on the blockchain.
  • the first call request can include the digital signature of the first participant, that is, the first participant can use the private key of its own account on the blockchain to perform a digital signature when sending the first call request,
  • the block chain After the block chain receives the first call request, it can verify the digital signature in the first call request based on the public key of the first participant stored in the first smart contract, where the public key is The public key corresponding to the private key used by the first participant to generate the digital signature. If the digital signature in the first call request passes the verification, it can be confirmed that the first call request is sent by the corresponding first participant, and the first participant can set its own service time window on the blockchain.
  • the blockchain can also verify the legality of the rules of the service time window submitted by the first participant. For example, you can check whether the rules of the first participant’s service time window are within your own support range; or, you can check whether the time point of the first participant’s service time window is legal; for another example, you can check whether the first participant Whether the corresponding holidays in the party’s service time window have been maintained in the first smart contract (for example, the first smart contract needs to pre-enter, for example, the specific time corresponding to American holidays).
  • the blockchain can set the service time of the first participant based on the first call request sent by the first participant window; when the authority of the first participant or the legality of the rules of the service time window of the first participant fail to pass the verification, the blockchain can refuse to set the service time window of the first participant, and at the same time return to the first participant The result of a failed call.
  • the embodiment of the present disclosure ensures that the service time window of each participant of the target transaction can be managed on the blockchain by deploying the first smart contract on the blockchain, thereby avoiding failures due to not being within the service time window of the participant The resulting blockage of on-chain transactions.
  • the multiple participants further include a second participant, and the second participant may send a second invocation request of the first smart contract to the blockchain.
  • the second call request can be used to query the service time window of the first participant.
  • Fig. 7 is a schematic flowchart of querying the service time window of the first participant provided by an embodiment of the present disclosure.
  • the second participant when the second participant needs to query the service time window of the first participant on the blockchain, the second participant can query by calling the second interface of the first smart contract. After the block chain receives the second call request from the second participant, it can return the query result of the service time window of the first participant to the second participant.
  • the second participant if the target transaction involves multiple first participants, the second participant can uniformly query the service time windows of the multiple first participants by calling the second interface of the first smart contract.
  • the query result of the service time window of the first participant sent to the second participant may be the service time window of the first participant.
  • the blockchain can directly return the service time window of the first participant to the second participant, so that the second participant can determine when to initiate a transaction on the blockchain according to the service time window.
  • the second call request may include the initiation time of the target transaction, for example, it may be the current time point, or it may also be a time point at which a transaction is planned to be initiated.
  • the query result of the first participant's service time window sent to the second participant may be used to indicate whether the initiation time of the target transaction is within the first participant's service time window.
  • the blockchain queries the service time window of the first participant based on the second call request, it can also determine whether the initiation time of the target transaction is within the service time window of the first participant.
  • the query result returned by the blockchain to the second participant may be that the service is available; when the initiation time of the target transaction is within the service time window of the first participant When the party's service time window is outside, the query result returned by the blockchain to the second party may be, for example, that the service is unavailable.
  • the smart contract and time calculation can be combined, and the dynamic calculation of the service time window can be dynamically expanded and calculated by using the characteristics of the dynamic calculation of the smart contract to determine whether the initiation time of the target transaction is within the first participant's service between windows.
  • the blockchain receives the second invocation request of the first smart contract from the second participant, it can dynamically expand the service time window of the first participant into time periods according to the initiation time of the target transaction, and judge the target Whether the initiation time of the transaction is within the time period, and then return the query result of the service time window of the first participant to the second participant according to the judgment result.
  • the second participant when sending the second call request, can input the initiation time of the target transaction: 2021-07-18 15:00.
  • the block chain receives the second call request, it can first query the service time window of the first participant stored in the block chain, and then use the service time window of the first participant according to the initiation time of the input target transaction to expand.
  • the service time window of the first participant is queried as "services can be provided from 9:00-18:00 on weekdays or 12:00-20:00 on every Sunday", since the target transaction initiation time is 2021-07- 18 If this day falls on Sunday, the service time window on weekdays will not take effect.
  • the service time window of the first participant can be expanded to 2012-07-18 12:00-2021-07-18 20:00.
  • the blockchain can automatically judge whether the initiation time of the target transaction is within this period after the service time window of the first participant is expanded, and send a report to the second party based on the judgment result.
  • the second participant returns the query result of the service time window of the first participant. For example, in this example, if 2021-07-18 15:00 is within the period of 2012-07-18 12:00-2021-07-18 20:00, the query result of service availability can be returned to the second participant .
  • the second participant Before the second participant initiates the target transaction, he can first query the service time windows of all the first participants involved in the target transaction, and initiate the target transaction when the initiation time of the target transaction is within the service time windows of all first participants Transactions can avoid transaction congestion caused by the unavailability of the services of the first participant, thereby improving the timeliness of transaction processing on the chain.
  • a second smart contract can also be deployed on the block chain, and the second smart contract can be used to execute the target transaction.
  • the second smart contract may be, for example, a smart contract for a remittance transaction, or may be a smart contract for a rental transaction.
  • the second participant can send a first transaction execution request to the block chain, and the first transaction execution request can be used to request the first participant to execute the target transaction.
  • the second participant can initiate the first transaction execution request by invoking the second smart contract.
  • the second smart contract can be automatically associated with the first smart contract, so the second smart contract can call the first smart contract to query the service time window of the first participant.
  • the second participant initiates the first transaction execution request by calling the second smart contract
  • the second smart contract receives the first transaction execution request, it can analyze the target transaction to confirm the participation of the first participant in the target transaction square.
  • the second smart contract can directly call the first smart contract to check whether the initiation time of the first transaction execution request is within the service time window of the first participant. If the initiation of the first transaction execution request If the time is outside the service time window of the first participant, terminate the target transaction to avoid transaction blocking; if the initiation time of the first transaction execution request is within the service time window of the first participant, continue to advance the target transaction.
  • the second smart contract can directly call the first smart contract to query the service time window of the first participant, so that the service time window and the second smart contract on the chain can be automatically combination to further reduce user interaction costs.
  • Fig. 9 is a schematic structural diagram of a blockchain-based transaction processing device provided by an embodiment of the present disclosure.
  • the transaction processing device 900 in FIG. 9 can be applied to a blockchain (or a node in a blockchain network).
  • a first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction.
  • the service time window of at least one participant is used to indicate the time when the at least one participant can participate in the target transaction.
  • At least one participant includes a first participant, and the transaction processing apparatus 900 may include a first receiving unit 910 and a setting unit 920 . These units are described in detail below.
  • the first receiving unit 910 may be configured to receive a first call request of the first smart contract from the first participant, where the first call request is used to set the service time window of the first participant.
  • the setting unit 920 may be configured to set the service time window of the first participant according to the first call request.
  • the multiple participants include a second participant
  • the transaction processing apparatus 900 may further include a second receiving unit and a sending unit.
  • the second receiving unit may be configured to receive a second call request of the first smart contract from the second participant, and the second call request is used to query the service time window of the first participant.
  • the sending unit may be configured to send the query result of the service time window of the first participant to the second participant.
  • the second call request includes the initiation time of the target transaction
  • the query result is used to indicate whether the initiation time of the target transaction is within the service time window of the first participant.
  • the multiple participants include the second participant
  • the transaction processing apparatus 900 further includes a third receiving unit, a calling unit, and a terminating unit.
  • the third receiving unit may be configured to receive a first transaction execution request from the second participant, where the first transaction execution request is used to request the first participant to execute the target transaction.
  • the calling unit may be configured to call the first smart contract in response to the first transaction execution request to query whether the initiation time of the first transaction execution request is within the service time window of the first participant.
  • the termination unit may be configured to terminate the target transaction if the initiation time of the first transaction execution request is outside the service time window of the first participant.
  • a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  • the transaction processing device 900 further includes a first verification unit and a second verification unit.
  • the first verification unit may be configured to verify the authority of the first participant.
  • the second verification unit may be configured to verify the legality of the rule of the service time window of the first participant.
  • the setting unit 920 may be further configured to set the service time window of the first participant in response to the authority and rule validity check being passed.
  • the first call request includes the digital signature of the first participant
  • the first verification unit may be further configured to verify the digital signature based on the public key of the first participant stored in the first smart contract. verification, wherein the public key is the public key corresponding to the private key used by the first participant to generate the digital signature.
  • Fig. 10 is a schematic structural diagram of a blockchain-based transaction processing device provided by another embodiment of the present disclosure.
  • a first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction.
  • the service time window of at least one participant is used to indicate the time when the at least one participant can participate in the target transaction.
  • At least one participant includes the first participant, and the transaction processing apparatus 1000 in FIG. 10 can be applied to the first participant.
  • the transaction processing device 1000 may include a sending unit 1010 .
  • the sending unit 1010 will be described in detail below.
  • the sending unit 1010 may be configured to send a first call request of the first smart contract to the blockchain, where the first call request is used to set the service time window of the first participant.
  • a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  • the first call request includes a digital signature of the first participant, and the digital signature is generated by the first participant using a private key.
  • Fig. 11 is a schematic structural diagram of a blockchain-based transaction processing device provided by another embodiment of the present disclosure.
  • the transaction processing apparatus 1100 shown in FIG. 11 may be a computing device with computing functions, for example, the transaction processing apparatus 1100 may be a server.
  • the transaction processor 1100 may include a memory 1110 and a processor 1120 .
  • Memory 1110 may be used to store executable code.
  • the processor 1120 can be used to execute the executable code stored in the memory 1110, so as to realize the steps in the various methods described above.
  • the transaction processing apparatus 1100 may further include a network interface 1130 through which data exchange between the processor 1120 and external devices may be realized.
  • all or part may be implemented by software, hardware, firmware or other arbitrary combinations.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present disclosure will be generated.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc. .
  • a magnetic medium such as a floppy disk, a hard disk, a magnetic tape
  • an optical medium such as a digital video disc (Digital Video Disc, DVD)
  • a semiconductor medium such as a solid state disk (Solid State Disk, SSD)
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

Abstract

Disclosed is a blockchain-based transaction processing method. A first smart contract is deployed on a blockchain, the first smart contract being used for managing a service time window of at least one of a plurality of participants of a target transaction, the service time window of the at least one participant being used for indicating the time when the at least one participant can participate in the target transaction, and the at least one participant comprising a first participant. The method comprises: receiving a first invocation request of the first smart contract from the first participant, the first invocation request being used for setting a service time window of the first participant; and setting the service time window of the first participant according to the first invocation request.

Description

基于区块链的交易处理Blockchain-based transaction processing 技术领域technical field
本公开涉及区块链技术领域,具体涉及一种基于区块链的交易处理方法和装置。The present disclosure relates to the technical field of block chains, in particular to a transaction processing method and device based on block chains.
背景技术Background technique
目前,在涉及多方参与的区块链交易的场景中,有些交易的推进过程,需要依赖参与方在链下进行操作。这种情况下,区块链仅在链上确保参与方对交易进行了确认,而每个参与方的确认过程,依赖于参与方在内部系统中完成安全审查流程,并提交到区块链上以推进交易状态。At present, in the scenario of blockchain transactions involving multiple parties, some transactions need to rely on participants to operate off-chain. In this case, the blockchain only ensures that the participants confirm the transaction on the chain, and the confirmation process of each participant depends on the participants completing the security review process in the internal system and submitting it to the blockchain to advance the transaction status.
如果交易的链上状态推进需要参与方进行确认时,参与方的链下服务却不可用,例如,不在参与方可以提供服务的时间窗口内,会导致交易长时间不会受理,进而,大量未完成的交易会导致链上交易阻塞。If the on-chain state of the transaction needs to be confirmed by the participant, the off-chain service of the participant is not available, for example, if it is not within the time window for the participant to provide services, the transaction will not be accepted for a long time, and a large number of unavailable Completed transactions cause on-chain transactions to block.
发明内容Contents of the invention
有鉴于此,本公开提供一种基于区块链的交易处理方法和装置,以避免因不在参与方的服务时间窗口内而导致的链上交易阻塞。In view of this, the present disclosure provides a blockchain-based transaction processing method and device to avoid on-chain transaction blocking caused by not being within the service time window of the participant.
第一方面,提供一种基于区块链的交易处理方法,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述方法包括:从所述第一参与方接收所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口;根据所述第一调用请求,设置所述第一参与方的服务时间窗口。In the first aspect, a transaction processing method based on a block chain is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction The service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, the method includes : Receive the first call request of the first smart contract from the first participant, the first call request is used to set the service time window of the first participant; according to the first call request, set The service time window of the first participant.
第二方面,提供一种基于区块链的交易处理方法,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述方法应用于所述第一参与方,所述方法包括:向所述区块链发送所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口。In the second aspect, a transaction processing method based on a block chain is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction The service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, and the method applies For the first participant, the method includes: sending a first call request of the first smart contract to the block chain, the first call request is used to set the service time of the first participant window.
第三方面,提供一种基于区块链的交易处理装置,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述 目标交易的时间,所述至少一个参与方包括第一参与方,所述装置包括:第一接收单元,被配置为从所述第一参与方接收所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口;设置单元,被配置为根据所述第一调用请求,设置所述第一参与方的服务时间窗口。In a third aspect, a block chain-based transaction processing device is provided, where a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of a plurality of participants in the target transaction The service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, and the device includes : a first receiving unit configured to receive a first call request of the first smart contract from the first participant, the first call request is used to set the service time window of the first participant; set A unit configured to set a service time window of the first participant according to the first call request.
第四方面,提供一种基于区块链的交易处理装置,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述装置应用于所述第一参与方,所述装置包括:发送单元,被配置为向所述区块链发送所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口。In the fourth aspect, a block chain-based transaction processing device is provided, and a first smart contract is deployed on the block chain, and the first smart contract is used to manage the participation of at least one of the multiple participants in the target transaction. The service time window of the party, the service time window of the at least one party is used to indicate the time when the at least one party can participate in the target transaction, the at least one party includes the first party, and the device application For the first participant, the device includes: a sending unit configured to send a first call request of the first smart contract to the blockchain, the first call request is used to set the first A service time window for a party.
第五方面,提供一种基于区块链的交易处理装置,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器被配置为执行所述可执行代码,以实现如第一方面或第二方面所述的方法。In the fifth aspect, there is provided a block chain-based transaction processing device, including a memory and a processor, wherein executable code is stored in the memory, and the processor is configured to execute the executable code, so as to realize the The method described in one aspect or the second aspect.
第六方面,提供一种计算机可读存储介质,其上存储有可执行代码,当所述可执行代码被执行时,能够实现如第一方面或第二方面所述的方法。In a sixth aspect, a computer-readable storage medium is provided, on which executable code is stored, and when the executable code is executed, the method as described in the first aspect or the second aspect can be implemented.
第七方面,提供一种计算机程序产品,包括可执行代码,当所述可执行代码被执行时,能够实现如第一方面或第二方面所述的方法。In a seventh aspect, a computer program product is provided, including executable codes, and when the executable codes are executed, the method as described in the first aspect or the second aspect can be implemented.
本公开实施例提供的技术方案,通过在区块链上部署第一智能合约,以保证能够在区块链上对目标交易的各参与方的服务时间窗口进行管理,从而可以避免因不在参与方的服务时间窗口内而导致的链上交易阻塞。In the technical solution provided by the embodiments of the present disclosure, by deploying the first smart contract on the blockchain, it is ensured that the service time window of each participant of the target transaction can be managed on the blockchain, thereby avoiding The on-chain transaction blocking caused by the service time window.
附图说明Description of drawings
图1为本公开实施例提供的区块链系统的示例图。FIG. 1 is an example diagram of a blockchain system provided by an embodiment of the present disclosure.
图2为本公开实施例提供的涉及多方参与的交易的示意图。FIG. 2 is a schematic diagram of a transaction involving multiple parties provided by an embodiment of the present disclosure.
图3为本公开实施例提供的一系统架构的示例图。FIG. 3 is an example diagram of a system architecture provided by an embodiment of the present disclosure.
图4为本公开实施例提供的第一智能合约的示例图。Fig. 4 is an example diagram of a first smart contract provided by an embodiment of the present disclosure.
图5为本公开实施例提供的基于区块链的交易处理方法的流程示意图。FIG. 5 is a schematic flowchart of a transaction processing method based on blockchain provided by an embodiment of the present disclosure.
图6为本公开实施例提供的设置第一参与方的服务时间窗口的流程示意图。Fig. 6 is a schematic flowchart of setting a service time window of a first participant provided by an embodiment of the present disclosure.
图7为本公开实施例提供的查询第一参与方的服务时间窗口的流程示意图。Fig. 7 is a schematic flowchart of querying the service time window of the first participant provided by an embodiment of the present disclosure.
图8为本公开实施例提供的另一系统架构的示例图。FIG. 8 is an exemplary diagram of another system architecture provided by an embodiment of the present disclosure.
图9为本公开一实施例提供的基于区块链的交易处理装置的结构示意图。Fig. 9 is a schematic structural diagram of a transaction processing device based on blockchain provided by an embodiment of the present disclosure.
图10为本公另一开实施例提供的基于区块链的交易处理装置的结构示意图。FIG. 10 is a schematic structural diagram of a blockchain-based transaction processing device provided by another disclosed embodiment of the present disclosure.
图11为本公开又一实施例提供的基于区块链的交易处理装置的结构示意图。Fig. 11 is a schematic structural diagram of a transaction processing device based on blockchain provided by another embodiment of the present disclosure.
具体实施方式Detailed ways
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some of the embodiments of the present disclosure, not all of them.
区块链是一种以密码学技术为基础的分布式链式存储记账技术。区块链技术可以通过去中心化或多中心化的方式对大量数据进行组织和维护,具有分布式、不可篡改性、可溯源、安全可信等特点,因而在多个领域得到广泛应用。Blockchain is a distributed chain storage accounting technology based on cryptography technology. Blockchain technology can organize and maintain a large amount of data in a decentralized or multi-centralized manner. It has the characteristics of distributed, non-tamperable, traceable, safe and reliable, and has been widely used in many fields.
图1是本公开实施例提供的区块链系统的示例图。如图1所示,区块链系统100可以包括区块链用户端(简称用户端)110和区块链网络120。区块链网络120可以包括多个区块链节点(简称节点),例如,图1中的节点120-A、节点120-B、节点120-C、......、节点120-N。Fig. 1 is an example diagram of a blockchain system provided by an embodiment of the present disclosure. As shown in FIG. 1 , a blockchain system 100 may include a blockchain client (client for short) 110 and a blockchain network 120 . The blockchain network 120 may include multiple blockchain nodes (referred to as nodes), for example, node 120-A, node 120-B, node 120-C, ..., node 120-N in FIG. 1 .
用户端110和/或区块链网络120中的节点可以包括各类计算设备,例如智能电话、台式计算机、或服务器等。在一些实施例中,服务器可以是独立的服务器或者服务器组,该服务器组可以是集中式的,也可以是分布式的。在一些实施例中,服务器可以在云平台上执行。The client 110 and/or the nodes in the blockchain network 120 may include various types of computing devices, such as smart phones, desktop computers, or servers. In some embodiments, the server may be an independent server or a server group, and the server group may be centralized or distributed. In some embodiments, the server may execute on a cloud platform.
用户端110是可以使用区块链服务的终端。用户端110可以链接至区块链网络120中的某一节点以获取区块链服务。在一些实施例中,用户端110可以通过发起区块链交易(简称交易,也可称为请求)的方式获取区块链服务,即用户端110可以生成交易并将生成的交易发送至区块链网络120。The client 110 is a terminal that can use blockchain services. The client 110 can link to a certain node in the blockchain network 120 to obtain blockchain services. In some embodiments, the client 110 can obtain blockchain services by initiating a blockchain transaction (transaction for short, also called a request), that is, the client 110 can generate a transaction and send the generated transaction to the block chain network 120 .
区块链网络120中的节点可以接收区块链网络120中广播的交易。接收到交易之后,区块链节点可以根据交易内容进行相关操作,即执行交易。例如,在账户间转移资金(或资产)以执行汇款交易。又如,对区块链数据进行查询以执行查询数据的交易。或者,调用(或执行)区块链上部署的智能合约以执行调用智能合约的交易。Nodes in the blockchain network 120 may receive transactions broadcast in the blockchain network 120 . After receiving the transaction, the blockchain node can perform related operations according to the transaction content, that is, execute the transaction. For example, transferring funds (or assets) between accounts to perform remittance transactions. Another example is to query blockchain data to execute transactions for querying data. Alternatively, invoke (or execute) a smart contract deployed on the blockchain to execute a transaction that invokes the smart contract.
智能合约是一套以数字形式定义的承诺,包括合约参与方可以在上面执行这些承诺的协议。智能合约本质是一段运行在区块链网络中的代码,用于完成用户所赋予的业务逻辑。A smart contract is a set of promises defined in digital form, including an agreement on which the parties to the contract can enforce those promises. The essence of a smart contract is a piece of code running in the blockchain network to complete the business logic assigned by the user.
智能合约可以包含有关交易的信息,只有在满足要求后才会执行结果操作。智能合约可以执行可追溯、不可逆转和安全的交易。A smart contract can contain information about a transaction, and the resulting action will only be executed if the requirements are met. Smart contracts can execute traceable, irreversible and secure transactions.
如前文所述,区块链具有不可篡改、安全可信等特点,因此,在区块链上进行交易,可以解决交易参与方相互信任的问题。基于此,区块链可以作为涉及多方参与的交易场景中一个重要的发展方向。例如,区块链可以被广泛应用于资金调拨(例如汇款交易)、 贸易金融、设备租赁等涉及多方参与、天然具有不信任的交易场景中。As mentioned above, the blockchain has the characteristics of non-tampering, security and trustworthiness. Therefore, conducting transactions on the blockchain can solve the problem of mutual trust between transaction participants. Based on this, blockchain can be used as an important development direction in transaction scenarios involving multi-party participation. For example, blockchain can be widely used in fund transfer (such as remittance transactions), trade finance, equipment leasing and other transaction scenarios involving multi-party participation and natural distrust.
下面结合图2,对涉及多方参与的区块链交易进行简单介绍。在图2所示的场景中,交易可以具有多个参与方。例如,多个参与方可以包括参与方A,参与方A可以是交易的发起方。多个参与方还可以包括参与方B、参与方C,参与方B、参与方C可以是交易的推进方或执行方。In the following, combined with Figure 2, a brief introduction will be given to blockchain transactions involving multiple parties. In the scenario shown in Figure 2, a transaction can have multiple parties. For example, the plurality of parties may include party A, which may be the initiator of the transaction. The multiple participants may also include participant B and participant C, and participant B and participant C may be the promoter or executor of the transaction.
以涉及资金调拨的汇款交易为例,参与方A可以是指汇款交易的发起方(例如,某企业的财务系统),参与方B可以是指汇款银行,参与方C可以是指收款银行。参与方A可以向区块链发起汇款请求,请求参与方B从其对应的银行账户中向参与方C的某一银行账户支付一定的资金。在一些实施例中,该汇款交易可以是指跨境汇款。在一些实施例中,该汇款交易可以是指跨行汇款。Taking a remittance transaction involving fund transfer as an example, participant A may refer to the initiator of the remittance transaction (for example, the financial system of an enterprise), participant B may refer to the remittance bank, and participant C may refer to the beneficiary bank. Participant A can initiate a remittance request to the blockchain, requesting participant B to pay a certain amount of funds to a certain bank account of participant C from its corresponding bank account. In some embodiments, the remittance transaction may refer to cross-border remittance. In some embodiments, the remittance transaction may refer to inter-bank remittance.
以设备租赁为例,参与方A可以是指承租方(例如,某一工厂),参与方B可以是指出租方(例如,某租赁平台),参与方C可以是指供应商。参与方A可以向区块链发起租赁请求,请求参与方B将某一设备租赁给参与方A,实际参与方B接收到该请求后,需要请求参与方C将该设备寄给参与方A。Taking equipment leasing as an example, participant A may refer to the lessee (for example, a factory), participant B may refer to the lessor (for example, a leasing platform), and participant C may refer to the supplier. Participant A can initiate a lease request to the blockchain, requesting participant B to lease a certain device to participant A. After receiving the request, participant B needs to request participant C to send the device to participant A.
在这种涉及多方参与的交易场景中,作为一个示例,当所有交易的执行都可以在链上完成时,则理论上可以通过智能合约预先规定触发规则,从而在链上自动完成交易。In this transaction scenario involving multi-party participation, as an example, when the execution of all transactions can be completed on the chain, it is theoretically possible to pre-specify the trigger rules through the smart contract, so as to automatically complete the transaction on the chain.
作为另一个示例,当区块链负责在链上对交易进行记录,以及对交易状态进行推进,而真实的交易操作需要参与方在链下配合完成时(例如,汇款交易中参与方B在链下向参与方C进行汇款;或者,设备租赁交易中,供应商C在链下将设备寄给参与方A),实际上该交易是无法在链上自动推进的,而是需要参与方调用相关的智能合约接口来推进交易状态。As another example, when the blockchain is responsible for recording the transaction on the chain and advancing the transaction status, and the real transaction operation requires the cooperation of the participants off the chain (for example, in the remittance transaction, the participant B sends Participant C remits money; or, in the equipment leasing transaction, supplier C sends the equipment to participant A) off the chain. In fact, the transaction cannot be automatically promoted on the chain, but requires the participant to call the relevant smart Contract interface to advance transaction state.
也就是说,在部分涉及多方参与的交易场景中,由于参与方内部的监管等原因,参与方需要链下对区块链交易进行操作,因此,区块链仅在链上完成交易的可靠性认证,即确保参与方确实对交易进行了确认。而每个参与方的确认过程,依赖于参与方在内部系统中完成安全审查流程,并提交到区块链上自动推进交易状态。在这种情况下,参与方需要调用相关的智能合约接口来推进交易状态。That is to say, in some transaction scenarios involving multi-party participation, due to the internal supervision of the participants and other reasons, the participants need to operate the blockchain transactions off-chain. Therefore, the reliability of the blockchain to complete transactions only on the chain Authentication, which is to ensure that the participants actually confirmed the transaction. The confirmation process of each participant relies on the participant to complete the security review process in the internal system and submit it to the blockchain to automatically advance the transaction status. In this case, the participants need to call the relevant smart contract interface to advance the transaction state.
例如,在涉及资金调拨的场景中,区块链上可以进行交易的可靠性认证,真实的资金调拨还依赖于参与方在链下进行操作时,每笔交易的链上状态都需要参与方进行确认。For example, in a scenario involving fund transfers, transaction reliability verification can be performed on the blockchain. The real fund transfer also depends on the participants operating off-chain, and the on-chain status of each transaction needs to be confirmed by the participants.
然而,如果当交易的链上状态推进需要参与方进行确认时,参与方的链下服务却不可用,例如,不在参与方可以提供服务的时间窗口内,这会导致当前区块链上交易状态可能保持为“已创建,待参与方确认”,直到参与方的业务系统调用智能合约接口进行交 易推进后,交易才能正常在链上达到终态。换句话说,一笔交易的完成,需要依赖于每个参与方的服务能力,尤其是可以提供服务的时间窗口。However, if the participant's off-chain service is unavailable when the on-chain state of the transaction needs to be confirmed by the participant, for example, it is not within the time window in which the participant can provide the service, which will cause the transaction state on the current blockchain to be unavailable. It may remain as "created, pending confirmation by the participant", until the participant's business system calls the smart contract interface to advance the transaction, the transaction can normally reach the final state on the chain. In other words, the completion of a transaction depends on the service capabilities of each participant, especially the time window in which services can be provided.
如果交易发起后,参与方不能及时对交易状态进行确认,会导致交易长时间不会受理,进而,大量未完成的交易会导致链上交易阻塞。If the participant fails to confirm the transaction status in time after the transaction is initiated, the transaction will not be accepted for a long time, and in turn, a large number of unfinished transactions will cause transaction blockage on the chain.
在一些实施例中,交易阻塞会影响客户体验感。例如,在涉及资金调拨的汇款交易中,当参与方A发起汇款交易的请求之后,该汇款交易的发起时间不在参与方C可以提供服务的时间窗口内,导致本次汇款交易的资金被占用,而参与方A并不知晓该情况,也无法使用该笔资金,影响客户体验感。In some embodiments, transaction congestion can affect customer experience. For example, in a remittance transaction involving fund transfer, after participant A initiates a request for a remittance transaction, the initiation time of the remittance transaction is not within the time window during which participant C can provide services, resulting in the occupation of funds for this remittance transaction. However, participant A is not aware of the situation, and cannot use the funds, which affects the customer experience.
以涉及资金调拨的场景为例,相关技术中,为了避免交易过程中需要多方确认的情况,可以通过速汇公司来进行交易。速汇公司可以先在对应的收款银行进行账户预存,从而可以将涉及多方参与的交易转变成2笔独立的行内汇款(汇款银行直接进行行内调拨收款,收款银行也直接进行行内调拨汇款)。Taking the scenario involving fund transfer as an example, in related technologies, in order to avoid the need for multi-party confirmation during the transaction process, the transaction can be carried out through the money transfer company. Quick Remittance Company can pre-deposit the account in the corresponding beneficiary bank first, so that the transaction involving multiple parties can be transformed into two independent intra-bank remittances (the remittance bank directly conducts intra-bank transfer and collection, and the beneficiary bank also directly conducts intra-bank transfer and remittance ).
采用这种方案,虽然可以通过垫资的方式避免涉及多方的交易,从而可以避免多方确认的问题。但是,采用这种方案时,速汇公司需要提前垫资,对于一些大额的调拨场景而言,速汇公司的垫资成本极高,不具有可行性。With this scheme, although transactions involving multiple parties can be avoided by means of advance funds, the problem of multi-party confirmation can be avoided. However, when adopting this solution, Money Transfer needs to advance capital in advance. For some large-amount transfer scenarios, Money Transfer's advance capital cost is extremely high, which is not feasible.
为了解决上述问题,本公开实施例提供一种基于区块链的交易处理方法和装置,以避免因不在参与方的服务时间窗口内而导致的链上交易阻塞。In order to solve the above problems, the embodiments of the present disclosure provide a blockchain-based transaction processing method and device, so as to avoid on-chain transaction blocking caused by not being within the service time window of the participant.
图3是本公开实施例提供的一系统架构的示例图。如图3所示,系统300可以包括第一参与方310、第二参与方320和区块链330。第一参与方310和第二参与方320都属于目标交易的多个参与方中的一个。Fig. 3 is an example diagram of a system architecture provided by an embodiment of the present disclosure. As shown in FIG. 3 , the system 300 may include a first participant 310 , a second participant 320 and a blockchain 330 . Both the first party 310 and the second party 320 belong to one of a plurality of parties to the target transaction.
第一参与方310可以是目标交易的推进方或执行方。在一笔目标交易的完成过程中,可以有多个第一参与方310推进或执行该目标交易。The first participant 310 may be a promoter or an execution party of the target transaction. During the completion of a target transaction, multiple first participants 310 may promote or execute the target transaction.
在完成目标交易的过程中,第一参与方310可以在链下对该目标交易进行操作。此外,第一参与方310还可以对该目标交易进行确认,然后将确认结果提交到区块链上以自动推进目标交易的状态。During the process of completing the target transaction, the first participant 310 can operate the target transaction off-chain. In addition, the first participant 310 can also confirm the target transaction, and then submit the confirmation result to the blockchain to automatically advance the status of the target transaction.
第二参与方320可以是目标交易的发起方。例如,第二参与方320可以在区块链上发起一笔汇款交易。The second party 320 may be the initiator of the targeted transaction. For example, the second participant 320 may initiate a remittance transaction on the blockchain.
第一参与方310和第二参与方320可以是区块链上的用户端。第一参与方310和第二参与方320可以以交易的形式向区块链330(或称区块链网络)发送智能合约的调用请求,通过区块链330中的所有节点调用并执行相应的智能合约。The first participant 310 and the second participant 320 may be clients on the blockchain. The first participant 310 and the second participant 320 can send a smart contract call request to the block chain 330 (or block chain network) in the form of a transaction, and all nodes in the block chain 330 call and execute the corresponding smart contract.
第一参与方310和第二参与方320可以和区块链330进行通信。在一些实施例中, 第一参与方310和第二参与方320之间不用直接通信。The first participant 310 and the second participant 320 can communicate with the blockchain 330 . In some embodiments, there is no direct communication between the first party 310 and the second party 320 .
区块链330中可以部署有第一智能合约,第一智能合约可以用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,其中,至少一个参与方的服务时间窗口可以用于指示该至少一个参与方能够参与目标交易的时间。例如,第一智能合约可以用于管理第一参与方310的服务时间窗口。A first smart contract can be deployed in the block chain 330, and the first smart contract can be used to manage the service time window of at least one of the multiple participants in the target transaction, wherein the service time window of at least one participant can be Used to indicate the time when the at least one participant can participate in the target transaction. For example, the first smart contract can be used to manage the service time window of the first party 310 .
在一些实施例中,第一智能合约可以包含2个主要接口。其中调用第一接口可以设置自己的服务时间窗口,例如,第一参与方310可以通过第一接口设置自己的服务时间窗口。调用第二接口可以查询第一参与方的服务时间窗口,例如,第二参与方320可以通过第二接口查询第一参与方310的服务时间窗口。In some embodiments, the first smart contract may contain 2 main interfaces. Calling the first interface may set its own service time window, for example, the first participant 310 may set its own service time window through the first interface. Calling the second interface can query the service time window of the first participant, for example, the second participant 320 can query the service time window of the first participant 310 through the second interface.
下面结合图4,给出第一智能合约的一个示例。第一智能合约可以包括第一接口(或称为,设置服务时间窗口的接口,setupServiceTimeWindow)和第二接口(或称为,查询服务时间窗口的接口,queryServiceTimeWindow)。第一智能合约还可以包括存储的链上持久化数据。An example of the first smart contract is given below with reference to FIG. 4 . The first smart contract may include a first interface (or called, an interface for setting a service time window, setupServiceTimeWindow) and a second interface (or called, an interface for querying a service time window, queryServiceTimeWindow). The first smart contract may also include stored on-chain persistent data.
第一参与方可以调用第一接口以创建或更新自己的服务时间窗口的信息。第一智能合约接收到第一接口的调用请求时,可以根据该调用请求对应创建或更新链上持久化数据的内容。The first participant can call the first interface to create or update its own service time window information. When the first smart contract receives the calling request of the first interface, it can correspondingly create or update the content of the persistent data on the chain according to the calling request.
本公开对第一智能合约中存储的链上持久化数据的内容不做具体限定。作为一个示例,第一智能合约中核心的链上持久化数据可以包括每个第一参与方的服务时间窗口的信息以及服务时间窗口内的循环规则(loop_order)。The present disclosure does not specifically limit the content of the on-chain persistent data stored in the first smart contract. As an example, the core on-chain persistent data in the first smart contract may include the information of the service time window of each first participant and the loop rule (loop_order) within the service time window.
第一参与方的服务时间窗口的信息可以参见图4所示的“链上持久化数据关联关系”部分。第一参与方的服务时间窗口的信息可以包含一系列时间片信息(TimeSlice),以及这些时间片的组合信息组成的服务时间窗口(ServiceTimeWindow)。For information about the service time window of the first participant, please refer to the part of "Persistent data association on the chain" shown in Fig. 4 . The information of the service time window of the first participant may include a series of time slice information (TimeSlice), and a service time window (ServiceTimeWindow) composed of combined information of these time slices.
如图4所示,每个时间片可以包含一对起止时间和对应时区,该起止时间即为对应的第一参与方的服务时间窗口。例如,在图4中表示时间片的表格中,id为1的这一行可以表示第一参与方的服务时间窗口为时区GMT+8(东八区)对应的9:00-16:00。As shown in FIG. 4 , each time slice may include a pair of start and end times and a corresponding time zone, and the start and end times are the corresponding service time windows of the first participant. For example, in the table representing time slices in FIG. 4 , the row with an id of 1 may indicate that the service time window of the first participant is 9:00-16:00 corresponding to the time zone GMT+8 (Eastern Eighth District).
第一参与方或第二参与方可以调用第二接口以查询某第一参与方的服务时间窗口,以确认该第一参与方在某个时间点是否可以提供服务。The first participant or the second participant may call the second interface to query the service time window of a certain first participant, so as to confirm whether the first participant can provide services at a certain time point.
当调用第一智能合约的第二接口时,第一智能合约可以动态解析每条服务时间窗口对应的规则。解析结束后,可以先判断待匹配的时间点(例如,目标交易的发起时间、当前时间点等)中的当前天和时间片中的日期匹配(day_match)规则是否匹配。如果匹配之后,进一步将待匹配的时间点和时间片中的起止时间进行匹配。如果均匹配,则 可以认为待匹配的时间点和时间片相匹配,进而可以知道每条服务时间窗口是否匹配。When calling the second interface of the first smart contract, the first smart contract can dynamically analyze the rules corresponding to each service time window. After the parsing is completed, it can be judged whether the current day in the time point to be matched (for example, the initiation time of the target transaction, the current time point, etc.) matches the date matching (day_match) rule in the time slice. After matching, further match the time point to be matched with the start and end time in the time slice. If they all match, it can be considered that the time point to be matched matches the time slice, and then it can be known whether each service time window matches.
在一些实施例中,可以在创建第一智能合约时,直接将日期匹配的规则写入第一智能合约中。在一些实施例中,可以在第二接口添加入参,让第一参与方自己规定自己对应的日期匹配规则。例如周末(weekend)和工作日(weekday)的判断规则是通用的,可以直接写在第一智能合约的逻辑中,而各种节假日会动态变化,可以让第一参与方自定义设置。In some embodiments, when creating the first smart contract, the date matching rules can be directly written into the first smart contract. In some embodiments, an input parameter can be added to the second interface, allowing the first participant to define its own corresponding date matching rules. For example, the judgment rules for weekends and weekdays are universal and can be directly written in the logic of the first smart contract, while various holidays will change dynamically, allowing the first participant to customize the settings.
下面结合图5,对本公开实施例提供的基于区块链的交易处理方法进行详细描述。本公开实施例提供的基于区块链的交易处理方法可以应用于图3所示的系统架构中。图5所示的方法是站在第一参与方和区块链交互的角度进行描述的。The block chain-based transaction processing method provided by the embodiment of the present disclosure will be described in detail below with reference to FIG. 5 . The blockchain-based transaction processing method provided by the embodiments of the present disclosure can be applied to the system architecture shown in FIG. 3 . The method shown in Fig. 5 is described from the perspective of interaction between the first participant and the blockchain.
在步骤510,第一参与方向区块链发送第一智能合约的第一调用请求。In step 510, the first participant sends a first invocation request of the first smart contract to the block chain.
第一调用请求可以用于设置第一参与方的服务时间窗口。在一些实施例中,第一调用请求中可以包括第一参与方的服务时间规则。服务时间规则可以用于表示第一参与方能够提供服务的时间,作为一个示例,服务时间规则可以表示某一时间段服务可用或服务不可用,例如,服务时间规则可以采用下面任意一种形式或其组合:“每周六12:00至每周日18:00不可用”,“美国节假日不可用”,或者“各工作日9:00-18:00可用”。The first call request may be used to set the service time window of the first participant. In some embodiments, the first call request may include the service time rules of the first participant. The service time rule can be used to indicate the time when the first participant can provide the service. As an example, the service time rule can indicate that the service is available or unavailable in a certain period of time. For example, the service time rule can take any of the following forms or Its combination: "Not available every Saturday 12:00 to every Sunday 18:00", "Not available on US holidays", or "Available every weekday 9:00-18:00".
在一些实施例中,第一参与方可以通过调用第一智能合约中的接口来发送第一调用请求。例如,第一参与方可以调用第一智能合约中的第一接口,以设置自己的服务时间窗口。In some embodiments, the first participant may send the first call request by calling an interface in the first smart contract. For example, the first participant can call the first interface in the first smart contract to set its own service time window.
在步骤520,区块链根据第一调用请求,设置第一参与方的服务时间窗口。In step 520, the blockchain sets the service time window of the first participant according to the first call request.
接收到第一参与方发送的第一调用请求之后,区块链可以根据第一调用请求,设置该第一参与方的服务时间窗口。例如,当区块链中未存储该第一参与方的服务时间窗口时,区块链可以根据第一调用请求在区块链中创建该第一参与方的服务时间窗口;或者,当区块链中已存储有该第一参与方的服务时间窗口时,区块链可以根据第一调用请求,更新区块链中已存储的该第一参与方的服务时间窗口。After receiving the first call request sent by the first participant, the blockchain can set the service time window of the first participant according to the first call request. For example, when the service time window of the first participant is not stored in the blockchain, the blockchain can create the service time window of the first participant in the blockchain according to the first call request; or, when the block chain When the service time window of the first participant has been stored in the chain, the block chain can update the service time window of the first participant stored in the block chain according to the first call request.
参见图6,在一些实施例中,区块链接收到第一参与方发送的第一调用请求之后,可以对第一参与方的权限进行校验,确认该第一调用请求是否是对应的第一参与方发送的,从而确保每个第一参与方只能调用接口来设置自己在区块链上的服务时间窗口。Referring to Fig. 6, in some embodiments, after the block chain receives the first call request sent by the first participant, it can check the authority of the first participant to confirm whether the first call request is the corresponding first call request. It is sent by one participant, so as to ensure that each first participant can only call the interface to set its own service time window on the blockchain.
作为一种实现方式,第一调用请求中可以包括第一参与方的数字签名,即第一参与方在发送第一调用请求时可以使用自己在区块链上的账户的私钥进行数字签名,区块链接收到该第一调用请求之后,可以基于第一智能合约中存证的该第一参与方的公钥,对第一调用请求中的数字签名进行校验,其中,该公钥为第一参与方生成该数字签名时使 用的私钥所对应的公钥。如果第一调用请求中的数字签名校验通过,则可以确认该第一调用请求是对应的第一参与方发送的,该第一参与方可以设置自己在区块链上的服务时间窗口。As an implementation, the first call request can include the digital signature of the first participant, that is, the first participant can use the private key of its own account on the blockchain to perform a digital signature when sending the first call request, After the block chain receives the first call request, it can verify the digital signature in the first call request based on the public key of the first participant stored in the first smart contract, where the public key is The public key corresponding to the private key used by the first participant to generate the digital signature. If the digital signature in the first call request passes the verification, it can be confirmed that the first call request is sent by the corresponding first participant, and the first participant can set its own service time window on the blockchain.
在一些实施例中,对第一参与方的权限校验通过后,区块链还可以对第一参与方提交的服务时间窗口的规则合法性进行校验。例如,可以校验第一参与方的服务时间窗口的规则是否在自己的支持范围;或者,可以校验第一参与方的服务时间窗口的时间点是否合法;又如,可以校验第一参与方的服务时间窗口中对应的节假日是否已在第一智能合约中维护(比如,第一智能合约中需要预先录入例如美国节假日对应的具体时间)。In some embodiments, after the authority verification of the first participant is passed, the blockchain can also verify the legality of the rules of the service time window submitted by the first participant. For example, you can check whether the rules of the first participant’s service time window are within your own support range; or, you can check whether the time point of the first participant’s service time window is legal; for another example, you can check whether the first participant Whether the corresponding holidays in the party’s service time window have been maintained in the first smart contract (for example, the first smart contract needs to pre-enter, for example, the specific time corresponding to American holidays).
当第一参与方的权限和第一参与方的服务时间窗口的规则合法性均通过校验时,区块链可以基于第一参与方发送的第一调用请求,设置第一参与方的服务时间窗口;当第一参与方的权限或第一参与方的服务时间窗口的规则合法性没有通过校验时,区块链可以拒绝设置第一参与方的服务时间窗口,同时向第一参与方返回调用失败的结果。When the authority of the first participant and the legality of the rules of the service time window of the first participant pass the verification, the blockchain can set the service time of the first participant based on the first call request sent by the first participant window; when the authority of the first participant or the legality of the rules of the service time window of the first participant fail to pass the verification, the blockchain can refuse to set the service time window of the first participant, and at the same time return to the first participant The result of a failed call.
本公开实施例通过在区块链上部署第一智能合约,保证能够在区块链上对目标交易的各参与方的服务时间窗口进行管理,从而可以避免因不在参与方的服务时间窗口内而导致的链上交易阻塞。The embodiment of the present disclosure ensures that the service time window of each participant of the target transaction can be managed on the blockchain by deploying the first smart contract on the blockchain, thereby avoiding failures due to not being within the service time window of the participant The resulting blockage of on-chain transactions.
在一些实施例中,多个参与方还包括第二参与方,第二参与方可以向区块链发送第一智能合约的第二调用请求。该第二调用请求可以用于查询第一参与方的服务时间窗口。In some embodiments, the multiple participants further include a second participant, and the second participant may send a second invocation request of the first smart contract to the blockchain. The second call request can be used to query the service time window of the first participant.
图7为本公开实施例提供的查询第一参与方的服务时间窗口的流程示意图。如图7所示,当第二参与方需要在区块链上查询第一参与方的服务时间窗口时,第二参与方可以通过调用第一智能合约的第二接口进行查询。区块链接收到第二参与方的第二调用请求后,可以向第二参与方返回第一参与方的服务时间窗口的查询结果。在一些实施例中,如果目标交易涉及多个第一参与方,第二参与方可以通过调用第一智能合约的第二接口,统一查询该多个第一参与方的服务时间窗口。Fig. 7 is a schematic flowchart of querying the service time window of the first participant provided by an embodiment of the present disclosure. As shown in Figure 7, when the second participant needs to query the service time window of the first participant on the blockchain, the second participant can query by calling the second interface of the first smart contract. After the block chain receives the second call request from the second participant, it can return the query result of the service time window of the first participant to the second participant. In some embodiments, if the target transaction involves multiple first participants, the second participant can uniformly query the service time windows of the multiple first participants by calling the second interface of the first smart contract.
作为一个示例,向第二参与方发送的第一参与方的服务时间窗口的查询结果可以是该第一参与方的服务时间窗口。区块链可以直接向第二参与方返回第一参与方的服务时间窗口,使得第二参与方可以根据该服务时间窗口确定何时在区块链上发起交易。As an example, the query result of the service time window of the first participant sent to the second participant may be the service time window of the first participant. The blockchain can directly return the service time window of the first participant to the second participant, so that the second participant can determine when to initiate a transaction on the blockchain according to the service time window.
作为另一个示例,第二调用请求中可以包括目标交易的发起时间,例如可以是当前时间点,或者也可以是某个计划发起交易的时间点。在这种情况下,向第二参与方发送的第一参与方的服务时间窗口的查询结果可以用于指示目标交易的发起时间是否位于该第一参与方的服务时间窗口。作为一种实现方式,区块链基于该第二调用请求查询第一参与方的服务时间窗口后,还可以判断该目标交易的发起时间是否位于该第一参与方 的服务时间窗口。当该目标交易的发起时间位于该第一参与方的服务时间窗口内时,区块链向第二参与方返回的查询结果例如可以是服务可用;当该目标交易的发起时间位于该第一参与方的服务时间窗口之外时,区块链向第二参与方返回的查询结果例如可以是服务不可用。As another example, the second call request may include the initiation time of the target transaction, for example, it may be the current time point, or it may also be a time point at which a transaction is planned to be initiated. In this case, the query result of the first participant's service time window sent to the second participant may be used to indicate whether the initiation time of the target transaction is within the first participant's service time window. As an implementation, after the blockchain queries the service time window of the first participant based on the second call request, it can also determine whether the initiation time of the target transaction is within the service time window of the first participant. When the initiation time of the target transaction is within the service time window of the first participant, the query result returned by the blockchain to the second participant may be that the service is available; when the initiation time of the target transaction is within the service time window of the first participant When the party's service time window is outside, the query result returned by the blockchain to the second party may be, for example, that the service is unavailable.
作为一种实现方式,可以将智能合约和时间计算相结合,利用智能合约动态计算的特性,对服务时间窗口进行动态展开和动态计算,以判断目标交易的发起时间是否位于第一参与方的服务之间窗口。具体地,区块链从第二参与方接收到第一智能合约的第二调用请求之后,可以按照目标交易的发起时间,将第一参与方的服务时间窗口动态展开为时段,并判断该目标交易的发起时间是否位于所述时段内,然后根据判断结果向第二参与方返回第一参与方的服务时间窗口的查询结果。As an implementation method, the smart contract and time calculation can be combined, and the dynamic calculation of the service time window can be dynamically expanded and calculated by using the characteristics of the dynamic calculation of the smart contract to determine whether the initiation time of the target transaction is within the first participant's service between windows. Specifically, after the blockchain receives the second invocation request of the first smart contract from the second participant, it can dynamically expand the service time window of the first participant into time periods according to the initiation time of the target transaction, and judge the target Whether the initiation time of the transaction is within the time period, and then return the query result of the service time window of the first participant to the second participant according to the judgment result.
下面给出区块链判断目标交易的发起时间是否位于第一参与方的服务时间窗口的一个示例。An example of the block chain judging whether the initiation time of the target transaction is within the service time window of the first participant is given below.
例如,第二参与方在发送第二调用请求时,可以输入目标交易的发起时间:2021-07-18 15:00。区块链接收到该第二调用请求后,首先可以查询区块链中存储的第一参与方的服务时间窗口,然后将该第一参与方的服务时间窗口按照该输入的目标交易的发起时间进行展开。例如,查询到第一参与方的服务时间窗口为“各工作日9:00-18:00或者每周日12:00-20:00可以提供服务”,由于目标交易的发起时间2021-07-18这一天为周日,则工作日的服务时间窗口不生效。那么按照目标交易的发起时间将该第一参与方的服务时间窗口可以展开为2012-07-18 12:00-2021-07-18 20:00。将第一参与方的服务时间窗口展开为时段后,区块链可以自动判断该目标交易的发起时间是否在第一参与方的服务时间窗口展开后的这一时段内,并根据判断结果向第二参与方返回第一参与方的服务时间窗口的查询结果。例如,在该示例中,2021-07-18 15:00在2012-07-18 12:00-2021-07-18 20:00这个时段内,则可以向第二参与方返回服务可用的查询结果。For example, when sending the second call request, the second participant can input the initiation time of the target transaction: 2021-07-18 15:00. After the block chain receives the second call request, it can first query the service time window of the first participant stored in the block chain, and then use the service time window of the first participant according to the initiation time of the input target transaction to expand. For example, the service time window of the first participant is queried as "services can be provided from 9:00-18:00 on weekdays or 12:00-20:00 on every Sunday", since the target transaction initiation time is 2021-07- 18 If this day falls on Sunday, the service time window on weekdays will not take effect. Then, according to the initiation time of the target transaction, the service time window of the first participant can be expanded to 2012-07-18 12:00-2021-07-18 20:00. After expanding the service time window of the first participant into a time period, the blockchain can automatically judge whether the initiation time of the target transaction is within this period after the service time window of the first participant is expanded, and send a report to the second party based on the judgment result. The second participant returns the query result of the service time window of the first participant. For example, in this example, if 2021-07-18 15:00 is within the period of 2012-07-18 12:00-2021-07-18 20:00, the query result of service availability can be returned to the second participant .
第二参与方在发起目标交易前,可以先查询该目标交易涉及的所有第一参与方的服务时间窗口,当该目标交易的发起时间在所有第一参与方的服务时间窗口内时再发起目标交易,可以避免因第一参与方的服务不可用导致的交易阻塞,进而提高链上交易处理的时效。Before the second participant initiates the target transaction, he can first query the service time windows of all the first participants involved in the target transaction, and initiate the target transaction when the initiation time of the target transaction is within the service time windows of all first participants Transactions can avoid transaction congestion caused by the unavailability of the services of the first participant, thereby improving the timeliness of transaction processing on the chain.
在一些实施例中,区块链上还可以部署有第二智能合约,该第二智能合约可以用于执行目标交易。第二智能合约例如可以是汇款交易的智能合约,或者可以是租赁交易的智能合约。In some embodiments, a second smart contract can also be deployed on the block chain, and the second smart contract can be used to execute the target transaction. The second smart contract may be, for example, a smart contract for a remittance transaction, or may be a smart contract for a rental transaction.
第二参与方可以向区块链发送第一交易执行请求,该第一交易执行请求可以用于请 求第一参与方执行目标交易。第二参与方可以通过调用第二智能合约发起第一交易执行请求。The second participant can send a first transaction execution request to the block chain, and the first transaction execution request can be used to request the first participant to execute the target transaction. The second participant can initiate the first transaction execution request by invoking the second smart contract.
例如,在图8所示的系统架构中,第二智能合约可以与第一智能合约自动关联,因此,第二智能合约可以调用第一智能合约以查询第一参与方的服务时间窗口。当第二参与方通过调用第二智能合约发起第一交易执行请求时,第二智能合约接收到该第一交易执行请求后,可以对该目标交易进行解析以确认参与该目标交易的第一参与方。解析完成第一参与方后,第二智能合约可以直接调用第一智能合约,以查询该第一交易执行请求的发起时间是否位于第一参与方的服务时间窗口,如果第一交易执行请求的发起时间位于第一参与方的服务时间窗口之外,终止该目标交易,以避免交易阻塞;如果第一交易执行请求的发起时间位于第一参与方的服务时间窗口内,则继续推进该目标交易。For example, in the system architecture shown in FIG. 8, the second smart contract can be automatically associated with the first smart contract, so the second smart contract can call the first smart contract to query the service time window of the first participant. When the second participant initiates the first transaction execution request by calling the second smart contract, after the second smart contract receives the first transaction execution request, it can analyze the target transaction to confirm the participation of the first participant in the target transaction square. After the analysis of the first participant is completed, the second smart contract can directly call the first smart contract to check whether the initiation time of the first transaction execution request is within the service time window of the first participant. If the initiation of the first transaction execution request If the time is outside the service time window of the first participant, terminate the target transaction to avoid transaction blocking; if the initiation time of the first transaction execution request is within the service time window of the first participant, continue to advance the target transaction.
通过将第二智能合约自动关联第一智能合约,第二智能合约可以直接调用第一智能合约以查询第一参与方的服务时间窗口,从而可以将服务时间窗口和链上的第二智能合约自动组合,进一步减少用户的交互成本。By automatically associating the second smart contract with the first smart contract, the second smart contract can directly call the first smart contract to query the service time window of the first participant, so that the service time window and the second smart contract on the chain can be automatically combination to further reduce user interaction costs.
上文结合图1至图8,详细描述了本公开的方法实施例,下面结合图9至图11,详细描述本公开的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。The method embodiment of the present disclosure is described in detail above with reference to FIG. 1 to FIG. 8 , and the device embodiment of the present disclosure is described in detail below in conjunction with FIG. 9 to FIG. 11 . It should be understood that the descriptions of the method embodiments correspond to the descriptions of the device embodiments, therefore, for parts not described in detail, reference may be made to the foregoing method embodiments.
图9是本公开一实施例提供的基于区块链的交易处理装置的示意性结构图。图9的交易处理装置900可以应用于区块链(或区块链网络中的节点)。其中,该区块链上部署有第一智能合约,该第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口。至少一个参与方的服务时间窗口用于指示该至少一个参与方能够参与目标交易的时间。至少一个参与方包括第一参与方,该交易处理装置900可以包括第一接收单元910和设置单元920。下面对这些单元进行详细介绍。Fig. 9 is a schematic structural diagram of a blockchain-based transaction processing device provided by an embodiment of the present disclosure. The transaction processing device 900 in FIG. 9 can be applied to a blockchain (or a node in a blockchain network). Wherein, a first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction. The service time window of at least one participant is used to indicate the time when the at least one participant can participate in the target transaction. At least one participant includes a first participant, and the transaction processing apparatus 900 may include a first receiving unit 910 and a setting unit 920 . These units are described in detail below.
第一接收单元910可以被配置为从第一参与方接收第一智能合约的第一调用请求,该第一调用请求用于设置第一参与方的服务时间窗口。The first receiving unit 910 may be configured to receive a first call request of the first smart contract from the first participant, where the first call request is used to set the service time window of the first participant.
设置单元920可以被配置为根据第一调用请求,设置第一参与方的服务时间窗口。The setting unit 920 may be configured to set the service time window of the first participant according to the first call request.
可选地,多个参与方包括第二参与方,交易处理装置900还可以包括第二接收单元和发送单元。第二接收单元可以被配置为从第二参与方接收第一智能合约的第二调用请求,该第二调用请求用于查询第一参与方的服务时间窗口。发送单元可以被配置为向第二参与方发送第一参与方的服务时间窗口的查询结果。Optionally, the multiple participants include a second participant, and the transaction processing apparatus 900 may further include a second receiving unit and a sending unit. The second receiving unit may be configured to receive a second call request of the first smart contract from the second participant, and the second call request is used to query the service time window of the first participant. The sending unit may be configured to send the query result of the service time window of the first participant to the second participant.
可选地,第二调用请求中包括目标交易的发起时间,查询结果用于指示目标交易的发起时间是否位于第一参与方的服务时间窗口。Optionally, the second call request includes the initiation time of the target transaction, and the query result is used to indicate whether the initiation time of the target transaction is within the service time window of the first participant.
可选地,多个参与方包括第二参与方,交易处理装置900还包括第三接收单元、调用单元和终止单元。第三接收单元可以被配置为从第二参与方接收第一交易执行请求,该第一交易执行请求用于请求第一参与方执行目标交易。调用单元可以被配置为响应于第一交易执行请求,调用第一智能合约,以查询该第一交易执行请求的发起时间是否位于第一参与方的服务时间窗口。终止单元可以被配置为如果第一交易执行请求的发起时间位于第一参与方的服务时间窗口之外,终止目标交易。Optionally, the multiple participants include the second participant, and the transaction processing apparatus 900 further includes a third receiving unit, a calling unit, and a terminating unit. The third receiving unit may be configured to receive a first transaction execution request from the second participant, where the first transaction execution request is used to request the first participant to execute the target transaction. The calling unit may be configured to call the first smart contract in response to the first transaction execution request to query whether the initiation time of the first transaction execution request is within the service time window of the first participant. The termination unit may be configured to terminate the target transaction if the initiation time of the first transaction execution request is outside the service time window of the first participant.
可选地,区块链上部署有第二智能合约,该第二智能合约用于执行目标交易。Optionally, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
可选地,交易处理装置900还包括第一校验单元和第二校验单元。第一校验单元可以被配置为对第一参与方的权限进行校验。第二校验单元可以被配置为对第一参与方的服务时间窗口的规则合法性进行校验。设置单元920可以进一步被配置为响应于该权限和规则合法性校验通过,设置第一参与方的服务时间窗口。Optionally, the transaction processing device 900 further includes a first verification unit and a second verification unit. The first verification unit may be configured to verify the authority of the first participant. The second verification unit may be configured to verify the legality of the rule of the service time window of the first participant. The setting unit 920 may be further configured to set the service time window of the first participant in response to the authority and rule validity check being passed.
可选地,第一调用请求中包括第一参与方的数字签名,第一校验单元可以进一步被配置为基于第一智能合约中存证的第一参与方的公钥,对该数字签名进行校验,其中,该公钥为第一参与方生成数字签名时使用的私钥对应的公钥。Optionally, the first call request includes the digital signature of the first participant, and the first verification unit may be further configured to verify the digital signature based on the public key of the first participant stored in the first smart contract. verification, wherein the public key is the public key corresponding to the private key used by the first participant to generate the digital signature.
图10是本公开另一实施例提供的基于区块链的交易处理装置的示意性结构图。该区块链上部署有第一智能合约,该第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口。其中,至少一个参与方的服务时间窗口用于指示该至少一个参与方能够参与目标交易的时间。至少一个参与方包括第一参与方,图10的交易处理装置1000可以应用于第一参与方。交易处理装置1000可以包括发送单元1010。下面对发送单元1010进行详细描述。Fig. 10 is a schematic structural diagram of a blockchain-based transaction processing device provided by another embodiment of the present disclosure. A first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction. Wherein, the service time window of at least one participant is used to indicate the time when the at least one participant can participate in the target transaction. At least one participant includes the first participant, and the transaction processing apparatus 1000 in FIG. 10 can be applied to the first participant. The transaction processing device 1000 may include a sending unit 1010 . The sending unit 1010 will be described in detail below.
发送单元1010可以被配置为向区块链发送第一智能合约的第一调用请求,该第一调用请求用于设置第一参与方的服务时间窗口。The sending unit 1010 may be configured to send a first call request of the first smart contract to the blockchain, where the first call request is used to set the service time window of the first participant.
可选地,区块链上部署有第二智能合约,该第二智能合约用于执行目标交易。Optionally, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
可选地,第一调用请求中包括第一参与方的数字签名,该数字签名是第一参与方使用私钥生成的。Optionally, the first call request includes a digital signature of the first participant, and the digital signature is generated by the first participant using a private key.
图11是本公开又一实施例提供的基于区块链的交易处理装置的示意性结构图。图11所示的交易处理装置1100可以是具有计算功能的计算设备,例如,交易处理装置1100可以是服务器。交易处理装置1100可以包括存储器1110和处理器1120。存储器1110可用于存储可执行代码。处理器1120可用于执行所述存储器1110中存储的可执行代码,以实现前文描述的各个方法中的步骤。在一些实施例中,该交易处理装置1100还可以包括网络接口1130,处理器1120与外部设备的数据交换可以通过该网络接口1130实现。Fig. 11 is a schematic structural diagram of a blockchain-based transaction processing device provided by another embodiment of the present disclosure. The transaction processing apparatus 1100 shown in FIG. 11 may be a computing device with computing functions, for example, the transaction processing apparatus 1100 may be a server. The transaction processor 1100 may include a memory 1110 and a processor 1120 . Memory 1110 may be used to store executable code. The processor 1120 can be used to execute the executable code stored in the memory 1110, so as to realize the steps in the various methods described above. In some embodiments, the transaction processing apparatus 1100 may further include a network interface 1130 through which data exchange between the processor 1120 and external devices may be realized.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本公开实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(Digital Video Disc,DVD))、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。In the foregoing embodiments, all or part may be implemented by software, hardware, firmware or other arbitrary combinations. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present disclosure will be generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc. .
本领域普通技术人员可以意识到,结合本公开实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments of the present disclosure can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementation should not be considered beyond the scope of the present disclosure.
在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何 熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope of the present disclosure. should fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be determined by the protection scope of the claims.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope of the present disclosure. should fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be determined by the protection scope of the claims.

Claims (23)

  1. 一种基于区块链的交易处理方法,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,A transaction processing method based on a block chain, where a first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction , the service time window of the at least one participant is used to indicate the time when the at least one participant can participate in the target transaction, the at least one participant includes the first participant,
    所述方法包括:The methods include:
    从所述第一参与方接收所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口;receiving a first invocation request of the first smart contract from the first participant, the first invocation request being used to set a service time window of the first participant;
    根据所述第一调用请求,设置所述第一参与方的服务时间窗口。Set the service time window of the first participant according to the first call request.
  2. 根据权利要求1所述的方法,所述多个参与方包括第二参与方,The method of claim 1, the plurality of parties comprising a second party,
    所述方法还包括:The method also includes:
    从所述第二参与方接收所述第一智能合约的第二调用请求,所述第二调用请求用于查询所述第一参与方的服务时间窗口;receiving a second call request of the first smart contract from the second participant, where the second call request is used to query the service time window of the first participant;
    向所述第二参与方发送所述第一参与方的服务时间窗口的查询结果。sending the query result of the service time window of the first participant to the second participant.
  3. 根据权利要求1所述的方法,所述多个参与方包括第二参与方,The method of claim 1, the plurality of parties comprising a second party,
    所述方法还包括:The method also includes:
    从所述第二参与方接收第一交易执行请求,所述第一交易执行请求用于请求所述第一参与方执行所述目标交易;receiving a first transaction execution request from the second party, the first transaction execution request requesting the first party to execute the target transaction;
    响应于所述第一交易执行请求,调用所述第一智能合约,以查询所述第一交易执行请求的发起时间是否位于所述第一参与方的服务时间窗口;In response to the first transaction execution request, calling the first smart contract to query whether the initiation time of the first transaction execution request is within the service time window of the first participant;
    如果所述第一交易执行请求的发起时间位于所述第一参与方的服务时间窗口之外,终止所述目标交易。If the initiation time of the first transaction execution request is outside the service time window of the first participant, the target transaction is terminated.
  4. 根据权利要求2所述的方法,所述第二调用请求中包括所述目标交易的发起时间,所述查询结果用于指示所述目标交易的发起时间是否位于所述第一参与方的服务时间窗口。The method according to claim 2, wherein the second call request includes the initiation time of the target transaction, and the query result is used to indicate whether the initiation time of the target transaction is within the service time of the first participant window.
  5. 根据权利要求4所述的方法,在所述从所述第二参与方接收所述第一智能合约的第二调用请求之后,所述方法还包括:The method according to claim 4, after receiving the second invocation request of the first smart contract from the second participant, the method further comprises:
    按照所述目标交易的发起时间,将所述第一参与方的服务时间窗口动态展开为时段;dynamically expand the service time window of the first participant into time periods according to the initiation time of the target transaction;
    判断所述目标交易的发起时间是否位于所述时段内。It is judged whether the initiation time of the target transaction is within the time period.
  6. 根据权利要求1所述的方法,所述区块链上部署有第二智能合约,所述第二智能合约用于执行所述目标交易。According to the method of claim 1, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  7. 根据权利要求1所述的方法,在所述从所述第一参与方接收所述第一智能合约的第一调用请求之后,所述方法还包括:The method according to claim 1, after receiving the first invocation request of the first smart contract from the first participant, the method further comprises:
    对所述第一参与方的权限进行校验;Verifying the authority of the first participant;
    对所述第一参与方的服务时间窗口的规则合法性进行校验;Verifying the legitimacy of the rule of the service time window of the first participant;
    所述根据所述第一调用请求,设置所述第一参与方的服务时间窗口,包括:The setting the service time window of the first participant according to the first call request includes:
    响应于所述权限和所述规则合法性校验通过,设置所述第一参与方的服务时间窗口。In response to passing the validity check of the authority and the rule, setting a service time window of the first participant.
  8. 根据权利要求7所述的方法,所述第一调用请求中包括所述第一参与方的数字签名,The method according to claim 7, wherein the first call request includes the digital signature of the first participant,
    所述对所述第一参与方的权限进行校验,包括:The verifying the authority of the first participant includes:
    基于所述第一智能合约中存证的所述第一参与方的公钥,对所述数字签名进行校验,其中,所述公钥为所述第一参与方生成所述数字签名时使用的私钥对应的公钥。The digital signature is verified based on the public key of the first participant stored in the first smart contract, wherein the public key is used by the first participant to generate the digital signature The public key corresponding to the private key.
  9. 一种基于区块链的交易处理方法,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述方法应用于所述第一参与方,A transaction processing method based on a block chain, where a first smart contract is deployed on the block chain, and the first smart contract is used to manage the service time window of at least one of the multiple participants of the target transaction , the service time window of the at least one participant is used to indicate the time when the at least one participant can participate in the target transaction, the at least one participant includes the first participant, the method is applied to the first participants,
    所述方法包括:The methods include:
    向所述区块链发送所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口。Sending a first call request of the first smart contract to the block chain, where the first call request is used to set a service time window of the first participant.
  10. 根据权利要求9所述的方法,所述区块链上部署有第二智能合约,所述第二智能合约用于执行所述目标交易。According to the method according to claim 9, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  11. 根据权利要求9所述的方法,所述第一调用请求中包括所述第一参与方的数字签名,所述数字签名是所述第一参与方使用私钥生成的。According to the method according to claim 9, the first call request includes the digital signature of the first participant, and the digital signature is generated by the first participant using a private key.
  12. 一种基于区块链的交易处理装置,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,A block chain-based transaction processing device, the block chain is deployed with a first smart contract, the first smart contract is used to manage the service time window of at least one of the multiple participants in the target transaction , the service time window of the at least one participant is used to indicate the time when the at least one participant can participate in the target transaction, the at least one participant includes the first participant,
    所述装置包括:The devices include:
    第一接收单元,被配置为从所述第一参与方接收所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口;The first receiving unit is configured to receive a first call request of the first smart contract from the first participant, the first call request is used to set a service time window of the first participant;
    设置单元,被配置为根据所述第一调用请求,设置所述第一参与方的服务时间窗口。A setting unit configured to set the service time window of the first participant according to the first call request.
  13. 根据权利要求12所述的装置,所述多个参与方包括第二参与方,The apparatus of claim 12, the plurality of participants comprising a second participant,
    所述装置还包括:The device also includes:
    第二接收单元,被配置为从所述第二参与方接收所述第一智能合约的第二调用请求,所述第二调用请求用于查询所述第一参与方的服务时间窗口;The second receiving unit is configured to receive a second call request of the first smart contract from the second participant, the second call request is used to query the service time window of the first participant;
    发送单元,被配置为向所述第二参与方发送所述第一参与方的服务时间窗口的查询结果。A sending unit configured to send the query result of the service time window of the first participant to the second participant.
  14. 根据权利要求12所述的装置,所述多个参与方包括第二参与方,The apparatus of claim 12, the plurality of participants comprising a second participant,
    所述装置还包括:The device also includes:
    第三接收单元,被配置为从所述第二参与方接收第一交易执行请求,所述第一交易执行请求用于请求所述第一参与方执行所述目标交易;A third receiving unit configured to receive a first transaction execution request from the second participant, the first transaction execution request being used to request the first participant to execute the target transaction;
    调用单元,被配置为响应于所述第一交易执行请求,调用所述第一智能合约,以查询所述第一交易执行请求的发起时间是否位于所述第一参与方的服务时间窗口;The calling unit is configured to call the first smart contract in response to the first transaction execution request to query whether the initiation time of the first transaction execution request is within the service time window of the first participant;
    终止单元,被配置为如果所述第一交易执行请求的发起时间位于所述第一参与方的服务时间窗口之外,终止所述目标交易。A termination unit configured to terminate the target transaction if the initiation time of the first transaction execution request is outside the service time window of the first participant.
  15. 根据权利要求13所述的装置,所述第二调用请求中包括所述目标交易的发起时间,所述查询结果用于指示所述目标交易的发起时间是否位于所述第一参与方的服务时间窗口。The device according to claim 13, wherein the second call request includes the initiation time of the target transaction, and the query result is used to indicate whether the initiation time of the target transaction is within the service time of the first participant window.
  16. 根据权利要求15所述的装置,所述装置还包括:The apparatus of claim 15, further comprising:
    展开单元,被配置为按照所述目标交易的发起时间,将所述第一参与方的服务时间窗口动态展开为时段;The expansion unit is configured to dynamically expand the service time window of the first participant into time periods according to the initiation time of the target transaction;
    判断单元,被配置为判断所述目标交易的发起时间是否位于所述时段内。A judging unit configured to judge whether the initiation time of the target transaction is within the time period.
  17. 根据权利要求12所述的装置,所述区块链上部署有第二智能合约,所述第二智能合约用于执行所述目标交易。The device according to claim 12, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  18. 根据权利要求12所述的装置,所述装置还包括:The apparatus of claim 12, further comprising:
    第一校验单元,被配置为对所述第一参与方的权限进行校验;a first verification unit configured to verify the authority of the first participant;
    第二校验单元,被配置为对所述第一参与方的服务时间窗口的规则合法性进行校验;The second verification unit is configured to verify the legality of the rules of the service time window of the first participant;
    所述设置单元进一步被配置为响应于所述权限和所述规则合法性校验通过,设置所述第一参与方的服务时间窗口。The setting unit is further configured to set the service time window of the first participant in response to passing the validity check of the authority and the rule.
  19. 根据权利要求18所述的装置,所述第一调用请求中包括所述第一参与方的数字签名,The device according to claim 18, the first call request includes the digital signature of the first participant,
    所述第一校验单元进一步被配置为基于所述第一智能合约中存证的所述第一参与方的公钥,对所述数字签名进行校验,其中,所述公钥为所述第一参与方生成所述数字 签名时使用的私钥对应的公钥。The first verification unit is further configured to verify the digital signature based on the public key of the first participant stored in the first smart contract, wherein the public key is the The public key corresponding to the private key used by the first participant to generate the digital signature.
  20. 一种基于区块链的交易处理装置,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述装置应用于所述第一参与方,A block chain-based transaction processing device, the block chain is deployed with a first smart contract, the first smart contract is used to manage the service time window of at least one of the multiple participants in the target transaction , the service time window of the at least one participant is used to indicate the time when the at least one participant can participate in the target transaction, the at least one participant includes the first participant, the device is applied to the first participants,
    所述装置包括:The devices include:
    发送单元,被配置为向所述区块链发送所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口。A sending unit configured to send a first call request of the first smart contract to the block chain, where the first call request is used to set a service time window of the first participant.
  21. 根据权利要求20所述的交易处理装置,所述区块链上部署有第二智能合约,所述第二智能合约用于执行所述目标交易。According to the transaction processing device according to claim 20, a second smart contract is deployed on the block chain, and the second smart contract is used to execute the target transaction.
  22. 根据权利要求20所述的装置,所述第一调用请求中包括所述第一参与方的数字签名,所述数字签名是所述第一参与方使用私钥生成的。The apparatus according to claim 20, wherein the first call request includes the digital signature of the first participant, and the digital signature is generated by the first participant using a private key.
  23. 一种基于区块链的交易处理装置,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器被配置为执行所述可执行代码,以实现权利要求1-11中任一项所述的方法。A block chain-based transaction processing device, comprising a memory and a processor, wherein executable code is stored in the memory, and the processor is configured to execute the executable code, so as to realize any of claims 1-11 one of the methods described.
PCT/CN2022/107785 2021-09-24 2022-07-26 Blockchain-based transaction processing WO2023045532A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111122529.7A CN113781230A (en) 2021-09-24 2021-09-24 Transaction processing method and device based on block chain
CN202111122529.7 2021-09-24

Publications (1)

Publication Number Publication Date
WO2023045532A1 true WO2023045532A1 (en) 2023-03-30

Family

ID=78853241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/107785 WO2023045532A1 (en) 2021-09-24 2022-07-26 Blockchain-based transaction processing

Country Status (2)

Country Link
CN (1) CN113781230A (en)
WO (1) WO2023045532A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781230A (en) * 2021-09-24 2021-12-10 支付宝(杭州)信息技术有限公司 Transaction processing method and device based on block chain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109727131A (en) * 2018-12-28 2019-05-07 苏州鸿链信息科技有限公司 Method of commerce and system are executed under a kind of chain based on block chain contract layer
WO2020224249A1 (en) * 2019-05-07 2020-11-12 深圳壹账通智能科技有限公司 Blockchain-based transaction processing method, device and apparatus, and storage medium
CN113781230A (en) * 2021-09-24 2021-12-10 支付宝(杭州)信息技术有限公司 Transaction processing method and device based on block chain

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6944604B1 (en) * 2001-07-03 2005-09-13 Fair Isaac Corporation Mechanism and method for specified temporal deployment of rules within a rule server
GB0525741D0 (en) * 2005-12-19 2006-01-25 Misys Plc Method for running a batch process in a 24-7 operational environment
CN107450979B (en) * 2017-03-28 2020-06-02 创新先进技术有限公司 Block chain consensus method and device
CN108921534A (en) * 2018-07-06 2018-11-30 中国电力财务有限公司 A kind of inter-bank method of payment and device
CN109523385A (en) * 2018-12-07 2019-03-26 深圳市智税链科技有限公司 Method, accounting nodes and the medium of Transaction Information are inquired in block chain network
CN110246015A (en) * 2019-05-20 2019-09-17 平安银行股份有限公司 Resource transfers method, apparatus, computer equipment and storage medium
CN110648138B (en) * 2019-09-30 2021-04-30 支付宝(杭州)信息技术有限公司 Transaction query and transaction data processing method, device and equipment based on block chain
CN110675153A (en) * 2019-10-10 2020-01-10 北京京东振世信息技术有限公司 Block chain-based data verification method and device, storage medium and electronic equipment
CN111563786B (en) * 2020-03-17 2023-11-03 中国科学院电工研究所 Virtual power plant regulation and control platform based on block chain and operation method
CN112102079A (en) * 2020-08-07 2020-12-18 柳州市蓝海数链科技有限公司 Service data processing method and device, computer equipment and storage medium
CN112199204B (en) * 2020-12-04 2021-03-12 支付宝(杭州)信息技术有限公司 Method and device for processing transaction in block chain
CN112308689B (en) * 2020-12-28 2021-06-18 支付宝(杭州)信息技术有限公司 Leasing method and device based on block chain and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109727131A (en) * 2018-12-28 2019-05-07 苏州鸿链信息科技有限公司 Method of commerce and system are executed under a kind of chain based on block chain contract layer
WO2020224249A1 (en) * 2019-05-07 2020-11-12 深圳壹账通智能科技有限公司 Blockchain-based transaction processing method, device and apparatus, and storage medium
CN113781230A (en) * 2021-09-24 2021-12-10 支付宝(杭州)信息技术有限公司 Transaction processing method and device based on block chain

Also Published As

Publication number Publication date
CN113781230A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN110688425B (en) Method and system for conditionally deferring transactions for blockchains
AU2022200068B2 (en) Telecommunication system and method for settling session transactions
CN110620810B (en) Non-linked ownership of continuous asset transfer over blockchain
TWI716140B (en) Data processing method and device based on blockchain
US20220084027A1 (en) Blockchain based account funding and distribution
WO2020029631A1 (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
US10985907B2 (en) Identifying faults in a blockchain ordering service
CN109214818B (en) Cross-chain transaction method and device
CN112840617B (en) Method and computing node for managing blockchain resources, computer readable medium
US11296864B2 (en) Identifying faults in a blockchain ordering service
US10997159B2 (en) Blockchain notification board storing blockchain resources
JP7228322B2 (en) Auto-commit transaction management in blockchain networks
US11520773B2 (en) Blockchain notification board storing blockchain resources
WO2019032089A1 (en) Blockchain architecture with record security
US10643208B2 (en) Digital payment system
JP2022553946A (en) Conducting transactions using private and public blockchains
WO2021004058A1 (en) Blockchain-based data processing method and device
CN112087502A (en) Method, device and equipment for processing request and storage medium
WO2023045532A1 (en) Blockchain-based transaction processing
CN112037055B (en) Transaction processing method, device, electronic equipment and readable storage medium
CN112837023A (en) Business collaboration platform, method and device of organization and electronic equipment
CN114066451A (en) Method and system for managing fund transaction and electronic equipment
CN111626735B (en) Data interaction system, method and module
US11934388B2 (en) Transaction processing failover
US20240144280A1 (en) Blockchain architecture with record security

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22871591

Country of ref document: EP

Kind code of ref document: A1