Transaction processing method and device based on block chain

文档序号:1954505 发布日期:2021-12-10 浏览:26次 中文

阅读说明:本技术 基于区块链的交易处理方法和装置 (Transaction processing method and device based on block chain ) 是由 韩喆 陈聪明 于 2021-09-24 设计创作,主要内容包括:本公开披露了一种基于区块链的交易处理方法,所述区块链上部署有第一智能合约,所述第一智能合约用于管理目标交易的多个参与方中的至少一个参与方的服务时间窗口,所述至少一个参与方的服务时间窗口用于指示所述至少一个参与方能够参与所述目标交易的时间,所述至少一个参与方包括第一参与方,所述方法包括:从所述第一参与方接收所述第一智能合约的第一调用请求,所述第一调用请求用于设置所述第一参与方的服务时间窗口;根据所述第一调用请求,设置所述第一参与方的服务时间窗口。(The present disclosure discloses a transaction processing method based on a blockchain, on which a first intelligent contract is deployed, the first intelligent contract being used for managing a service time window of at least one participant of a plurality of participants of a target transaction, the service time window of the at least one participant being used for indicating a time at which the at least one participant can participate in the target transaction, the at least one participant including a first participant, the method comprising: receiving a first invocation request of the first intelligent contract from the first participant, the first invocation request being used for setting a service time window of the first participant; and setting a service time window of the first participant according to the first calling request.)

1. A blockchain-based transaction processing method, the blockchain having deployed thereon a first intelligent contract for managing a service time window of at least one of a plurality of parties to a target transaction, the service time window of the at least one party being for indicating a time at which the at least one party is capable of participating in the target transaction, the at least one party including a first party,

the method comprises the following steps:

receiving a first invocation request of the first intelligent contract from the first participant, the first invocation request being used for setting a service time window of the first participant;

and setting a service time window of the first participant according to the first calling request.

2. The method of claim 1, the plurality of parties including a second party,

the method further comprises the following steps:

receiving a second invocation request of the first intelligent contract from the second participant, the second invocation request being used for querying a service time window of the first participant;

and sending the query result of the service time window of the first party to the second party.

3. The method of claim 1, the plurality of parties including a second party,

the method further comprises the following steps:

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, invoking the first smart contract to query whether an initiation time of the first transaction execution request is within a service time window of the first party;

terminating the target transaction if the initiation time of the first transaction execution request is outside the first party's service time window.

4. The method of claim 2, wherein the second invocation request includes an initiation time of the target transaction, and wherein the query result is used to indicate whether the initiation time of the target transaction is within a service time window of the first party.

5. The method of claim 4, after the receiving a second invocation request for the first smart contract from the second participant, the method further comprising:

dynamically expanding a service time window of the first party into a time period according to the initiation time of the target transaction;

and judging whether the initiation time of the target transaction is within the time period.

6. The method of claim 1, the blockchain having a second intelligent contract deployed thereon, the second intelligent contract for performing the target transaction.

7. The method of claim 1, after the receiving the first invocation request for the first smart contract from the first participant, the method further comprising:

verifying the authority of the first participant;

checking the validity of the rules of the service time window of the first party;

the setting a service time window of the first participant according to the first invocation request includes:

and responding to the passing of the authority and the validity check of the rule, and setting a service time window of the first participant.

8. The method of claim 7, the first invocation request including a digital signature of the first party,

the verifying the authority of the first party comprises:

and verifying the digital signature based on a public key of the first party stored in the first intelligent contract, wherein the public key is a public key corresponding to a private key used by the first party for generating the digital signature.

9. A blockchain-based transaction processing method, the blockchain having deployed thereon a first intelligent contract for managing a service time window of at least one of a plurality of parties to a target transaction, the service time window of the at least one party being for indicating a time at which the at least one party is able to participate in the target transaction, the at least one party including a first party, the method being applied to the first party,

the method comprises the following steps:

and sending a first calling request of the first intelligent contract to the blockchain, wherein the first calling request is used for setting a service time window of the first participant.

10. The method of claim 9, the blockchain having a second intelligent contract deployed thereon, the second intelligent contract for performing the target transaction.

11. The method of claim 9, the first invocation request including a digital signature of the first party, the digital signature being generated by the first party using a private key.

12. A blockchain-based transaction processing apparatus, the blockchain having deployed thereon a first intelligent contract for managing a service time window of at least one of a plurality of parties to a target transaction, the service time window of the at least one party for indicating a time at which the at least one party is capable of participating in the target transaction, the at least one party including a first party,

the device comprises:

a first receiving unit configured to receive a first invocation request of the first intelligent contract from the first participant, the first invocation request being used for setting a service time window of the first participant;

a setting unit configured to set a service time window of the first participant according to the first invocation request.

13. The apparatus of claim 12, the plurality of parties comprising a second party,

the device further comprises:

a second receiving unit configured to receive a second invocation request of the first intelligent contract from the second participant, the second invocation request being used for querying a service time window of the first participant;

a sending unit configured to send a query result of the service time window of the first party to the second party.

14. The apparatus of claim 12, the plurality of parties comprising a second party,

the device further comprises:

a third receiving unit configured to receive a first transaction execution request from the second party, the first transaction execution request being for requesting the first party to execute the target transaction;

a calling unit configured to call the first intelligent contract in response to the first transaction execution request to inquire 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 a service time window of the first party.

15. The apparatus of claim 13, the second invocation request including an initiation time of the target transaction, the query result indicating whether the initiation time of the target transaction is within a service time window of the first party.

16. The apparatus of claim 15, the apparatus further comprising:

an expansion unit configured to dynamically expand a service time window of the first party into a time period according to an 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. The apparatus of claim 12, a second intelligent contract disposed on the blockchain, the second intelligent contract for performing the target transaction.

18. The apparatus of claim 12, the apparatus further comprising:

a first checking unit configured to check a right of the first party;

a second checking unit configured to check the validity of the rule of the service time window of the first participant;

the setting unit is further configured to set a service time window of the first participant in response to the authority and the rule validity check passing.

19. The apparatus of claim 18, the first invocation request including a digital signature of the first party,

the first verification unit is further configured to verify the digital signature based on a public key of the first participant stored in the first intelligent contract, wherein the public key is a public key corresponding to a private key used by the first participant to generate the digital signature.

20. A blockchain-based transaction processing apparatus, the blockchain having deployed thereon a first intelligent contract for managing a service time window of at least one of a plurality of parties to a target transaction, the service time window of the at least one party being for indicating a time at which the at least one party is able to participate in the target transaction, the at least one party including a first party, the apparatus being applied to the first party,

the device comprises:

a sending unit configured to send a first invocation request of the first intelligent contract to the blockchain, where the first invocation request is used to set a service time window of the first participant.

21. The transaction processing arrangement of claim 20, the blockchain having disposed thereon a second intelligent contract for executing the target transaction.

22. The apparatus of claim 20, the first invocation request including a digital signature of the first party, the digital signature being generated by the first party using a private key.

23. A blockchain based transaction processing apparatus comprising a memory having executable code stored therein and a processor configured to execute the executable code to implement the method of any of claims 1-11.

Technical Field

The disclosure relates to the technical field of blockchain, in particular to a transaction processing method and device based on blockchain.

Background

Currently, in a scenario involving a blockchain transaction involving multiple parties, some of the transaction progress needs to rely on the parties to operate under the chain. In this case, the blockchain only ensures that the participants confirm the transaction on the chain, and the confirmation process of each participant relies on the participants completing the security audit process in the internal system and submitting to the blockchain to advance the transaction status.

If the on-chain state of the transaction advances and requires the participant to confirm, the off-chain services of the participant are not available, e.g., not within the time window in which the participant can provide services, resulting in a long transaction not being accepted, and further, a large number of outstanding transactions resulting in a blocked on-chain transaction.

Disclosure of Invention

In view of the above, the present disclosure provides a method and an apparatus for processing transactions based on a blockchain, so as to avoid blocking of transactions on the chain due to non-existence within a service time window of a participant.

In a first aspect, a blockchain-based transaction processing method is provided, where a blockchain has a first intelligent contract deployed thereon, the first intelligent contract being used to manage a service time window of at least one participant of a plurality of participants of a target transaction, the service time window of the at least one participant being used to indicate a time at which the at least one participant can participate in the target transaction, the at least one participant including a first participant, and the method includes: receiving a first invocation request of the first intelligent contract from the first participant, the first invocation request being used for setting a service time window of the first participant; and setting a service time window of the first participant according to the first calling request.

In a second aspect, a blockchain-based transaction processing method is provided, where a blockchain has a first intelligent contract deployed thereon, the first intelligent contract being used to manage a service time window of at least one participant of a plurality of participants of a target transaction, the service time window of the at least one participant being used to indicate a time at which the at least one participant can participate in the target transaction, the at least one participant including a first participant, and the method is applied to the first participant, and the method includes: and sending a first calling request of the first intelligent contract to the blockchain, wherein the first calling request is used for setting a service time window of the first participant.

In a third aspect, there is provided a blockchain-based transaction processing apparatus, the blockchain having a first intelligent contract deployed thereon, the first intelligent contract being configured to manage a service time window of at least one participant of a plurality of participants of a target transaction, the service time window of the at least one participant being configured to indicate a time at which the at least one participant can participate in the target transaction, the at least one participant including a first participant, the apparatus comprising: a first receiving unit configured to receive a first invocation request of the first intelligent contract from the first participant, the first invocation request being used for setting a service time window of the first participant; a setting unit configured to set a service time window of the first participant according to the first invocation request.

In a fourth aspect, there is provided a blockchain-based transaction processing apparatus, the blockchain having a first intelligent contract deployed thereon, the first intelligent contract being for managing a service time window of at least one participant of a plurality of participants of a target transaction, the service time window of the at least one participant being for indicating a time at which the at least one participant can participate in the target transaction, the at least one participant including a first participant, the apparatus being applied to the first participant, the apparatus comprising: a sending unit configured to send a first invocation request of the first intelligent contract to the blockchain, where the first invocation request is used to set a service time window of the first participant.

In a fifth aspect, there is provided a blockchain based transaction processing apparatus comprising a memory having stored therein executable code and a processor configured to execute the executable code to implement the method of the first or second aspect.

A sixth aspect provides a computer readable storage medium having stored thereon executable code which, when executed, is capable of implementing a method as described in the first or second aspect.

In a seventh aspect, there is provided a computer program product comprising executable code which, when executed, is capable of implementing a method as described in the first or second aspect.

According to the technical scheme provided by the embodiment of the disclosure, the service time windows of all the participants of the target transaction can be managed on the blockchain by deploying the first intelligent contract on the blockchain, so that the online transaction blockage caused by the fact that the intelligent contract is not in the service time windows of the participants can be avoided.

Drawings

Fig. 1 is an exemplary diagram of a block chain system according to an embodiment of the disclosure.

FIG. 2 is a schematic diagram of a transaction involving multi-party participation provided by an embodiment of the present disclosure.

Fig. 3 is an exemplary diagram of a system architecture provided by an embodiment of the present disclosure.

Fig. 4 is an exemplary diagram of a first intelligent contract provided by an embodiment of the present disclosure.

Fig. 5 is a flowchart illustrating a transaction processing method based on a blockchain according to an embodiment of the present disclosure.

Fig. 6 is a schematic flowchart of setting a service time window of a first participant according to an embodiment of the present disclosure.

Fig. 7 is a flowchart illustrating a process of querying a service time window of a first participant according to an embodiment of the disclosure.

Fig. 8 is an exemplary diagram of another system architecture provided by embodiments of the present disclosure.

Fig. 9 is a schematic structural diagram of a transaction processing apparatus based on a blockchain according to an embodiment of the present disclosure.

Fig. 10 is a schematic structural diagram of a transaction processing apparatus based on a blockchain according to another embodiment of the disclosure.

Fig. 11 is a schematic structural diagram of a transaction processing device based on a blockchain according to another embodiment of the present disclosure.

Detailed Description

The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments.

The blockchain is a distributed chain storage accounting technology based on cryptography. The block chain technology can organize and maintain a large amount of data in a decentralized or multi-centric mode, has the characteristics of distribution, non-tamper property, traceability, safety, credibility and the like, and is widely applied to multiple fields.

Fig. 1 is an exemplary diagram of a block chain system provided in an embodiment of the present disclosure. As shown in fig. 1, the block chain system 100 may include a block chain user terminal (ue) 110 and a block chain network 120. Blockchain network 120 may include a plurality of blockchain nodes (simply nodes), such as node 120-a, node 120-B, node 120-C, and node 120-N of fig. 1.

The user end 110 and/or 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 servers may be independent servers or groups of servers, which may be centralized or distributed. In some embodiments, the server may execute on a cloud platform.

The user terminal 110 is a terminal that can use the blockchain service. The user terminal 110 can link to a node in the blockchain network 120 to obtain blockchain services. In some embodiments, the ue 110 may obtain the blockchain service by initiating a blockchain transaction (abbreviated as transaction, which may also be referred to as a request), that is, the ue 110 may generate a transaction and send the generated transaction to the blockchain network 120.

A node in blockchain network 120 may receive a transaction broadcast in blockchain network 120. After receiving the transaction, the block nodes can perform related operations according to the transaction content, i.e. execute the transaction. For example, funds (or assets) are transferred between accounts to perform money transfer transactions. As another example, the blockchain data is queried to perform transactions of the queried data. Alternatively, the intelligent contracts deployed on the blockchain are invoked (or executed) to perform transactions that invoke the intelligent contracts.

An intelligent contract is a set of commitments defined in digital form, including agreements on which contract participants can execute the commitments. An intelligent contract is essentially a piece of code running in a blockchain network to complete the business logic assigned by a user.

The smart contract may contain information about the transaction and perform the resulting operation only after the requirements are met. The smart contracts may perform transactions that are traceable, irreversible, and secure.

As described above, the blockchain has the characteristics of non-tamper-ability, safety, reliability and the like, so that the problem of mutual trust of transaction participants can be solved when transactions are performed on the blockchain. Based on this, the blockchain can be used as an important development direction in a transaction scene involving multi-party participation. For example, blockchains may be widely used in fund transfers (e.g., remittance transactions), trade finances, equipment leases, etc. in transaction scenarios involving multiple parties, naturally with distrust.

A brief description of a blockchain transaction involving multi-party participation is provided below in conjunction with fig. 2. In the scenario shown in fig. 2, a transaction may have multiple parties. For example, the plurality of parties may include party a, which may be the initiator of the transaction. The plurality of parties may also include party B, party C, which may be a facilitator or an executor of the transaction.

Taking a money transfer transaction involving a transfer of funds as an example, party a may refer to the originator of the money transfer transaction (e.g., a financial system of a business), party B may refer to a money transfer bank, and party C may refer to a collection bank. Party a may initiate a request for transfer of money to the blockchain requesting party B to pay certain funds from its corresponding bank account to a certain bank account of party C. In some embodiments, the money transfer transaction may be a cross-border money transfer. In some embodiments, the money transfer transaction may be a cross-bank money transfer.

For example, a device rental, party a may be a lessee (e.g., a factory), party B may be a lessor (e.g., a rental platform), and party C may be a vendor. Participant a may initiate a lease request to the blockchain, requesting participant B to lease a device to participant a, and after receiving the request, actual participant B needs to request participant C to send the device to participant a.

In such a transaction scenario involving multi-party participation, as an example, when execution of all transactions can be completed on the chain, then the trigger rules can be predefined theoretically by the smart contract so that the transactions are automatically completed on the chain.

As another example, when the blockchain is responsible for logging transactions on the chain and advancing transaction status, while a real transaction operation requires that the participants complete down the chain (e.g., in a money transfer transaction, participant B transfers money down the chain to participant C, or, in a device rental transaction, supplier C sends the device down the chain to participant a), the transaction is not actually automatically advanced on the chain, but rather requires that the participants invoke the associated intelligent contract interface to advance transaction status.

That is, in some transaction scenarios involving multi-party participation, the participants need to operate on the blockchain transaction under the chain due to internal supervision of the participants, and so on, and therefore the blockchain only completes the authenticity certification of the transaction on the chain, i.e., ensures that the participants indeed confirm the transaction. And the confirmation process of each participant depends on the completion of the security examination process in the internal system by the participant and the submission to the block chain to automatically advance the transaction state. In this case, the participant needs to invoke the relevant intelligent contract interface to advance the transaction state.

For example, in scenarios involving fund transfers, the authenticity of transactions may be certified on the block chain, and the actual fund transfers may also depend on the participants operating down the chain, with the on-chain status of each transaction requiring confirmation by the participants.

However, if the offline service of the participant is not available when the online state advancement of the transaction requires confirmation by the participant, e.g., not within a time window in which the participant can provide the service, this may result in the current blockchain transaction state possibly remaining "created, pending confirmation by the participant" until the transaction normally reaches the end state on the chain after the business system of the participant invokes the intelligent contract interface to perform the transaction advancement. In other words, the completion of a transaction is dependent on the service capabilities of each participant, and in particular the time window in which the service can be provided.

If the transaction is initiated, the participant can not confirm the transaction state in time, the transaction can not be accepted for a long time, and further, a large number of unfinished transactions can cause the transaction on the chain to be blocked.

In some embodiments, transaction blocking may affect the customer experience. For example, in a money transfer transaction involving money transfer, after party a initiates a request for the money transfer transaction, the initiation time of the money transfer transaction is not within the time window in which party C can provide services, resulting in the money transfer transaction being occupied, and party a is unaware of the situation and cannot use the money, which affects the customer experience.

Taking a scenario involving fund transfer as an example, in the related art, in order to avoid a situation that a plurality of parties need to confirm in a transaction process, a transaction can be performed through a fast forward company. The fast remittance company can pre-store accounts in the corresponding collection banks, so that the transaction involving participation of multiple parties can be converted into 2 independent inline remittance (the remittance bank directly conducts inline call for collection, and the collection banks also directly conduct inline call for remittance).

By adopting the scheme, the transaction involving multiple parties can be avoided by bedding, so that the problem of multi-party confirmation can be avoided. However, when the scheme is adopted, the fast forward company needs to pay in advance, and for some large-volume call scenes, the paying cost of the fast forward company is extremely high and is not feasible.

In order to solve the above problem, embodiments of the present disclosure provide a method and an apparatus for processing a transaction based on a blockchain, so as to avoid blocking of the transaction on the chain due to being not within a service time window of a participant.

Fig. 3 is an exemplary 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 party 310, a second party 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 targeted transaction.

The first party 310 may be a facilitator or an executor of the targeted transaction. During the completion of a target transaction, there may be multiple first parties 310 advancing or executing the target transaction.

In completing the target transaction, the first party 310 may operate on the target transaction down the chain. In addition, the first party 310 may 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 target transaction. For example, second party 320 may initiate a money transfer transaction over 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 may send requests for invoking intelligent contracts to the blockchain 330 (or blockchain network) in the form of transactions, and invoke and execute the corresponding intelligent contracts through all nodes in the blockchain 330.

The first participant 310 and the second participant 320 may communicate with a blockchain 330. In some embodiments, there is no direct communication between the first party 310 and the second party 320.

A first intelligent contract may be deployed in blockchain 330, and the first intelligent contract may be used to manage a service time window of at least one of the plurality of participants of the target transaction, where the service time window of the at least one participant may be used to indicate a time at which the at least one participant is able to participate in the target transaction. For example, a first intelligent contract may be used to manage a service time window for the first participant 310.

In some embodiments, the first smart contract may contain 2 primary interfaces. Where invoking the first interface may set its own service time window, for example, the first party 310 may set its own service time window via the first interface. Invoking the second interface may query the first participant's service time window, e.g., second participant 320 may query the first participant 310's service time window through the second interface.

An example of a first intelligent contract is given below in conjunction with FIG. 4. The first smart contract may include a first interface (or referred to as an interface to set a service time window, setupervicetimewindow) and a second interface (or referred to as an interface to query a service time window, queryServiceTimeWindow). The first intelligent contract may also include stored on-chain persistent data.

The first party may invoke the first interface to create or update information for its own service time window. When the first intelligent contract receives the call request of the first interface, the content of the persistent data on the chain can be correspondingly created or updated according to the call request.

The present disclosure does not specifically limit the content of the on-chain persistent data stored in the first smart contract. As one example, the on-chain persisted data for the core in the first smart contract may include information for a service time window for each first participant and a rotation rule (loop _ order) within the service time window.

The information of the service time window of the first participant can be seen in the "persistent data association on chain" section shown in fig. 4. The information of the service time window of the first participant may comprise a series of time slice information (TimeSlice), and a service time window (ServiceTimeWindow) consisting of combination information of the time slices.

As shown in fig. 4, each time slice may include a pair of start and end times, i.e., a service time window for the corresponding first participant, and a corresponding time zone. For example, in the table representing time slices in FIG. 4, the row with id 1 may indicate that the first party's service time window is 9:00-16:00 for time zone GMT +8 (the eight east zone).

The first or second party may invoke the second interface to query a first party's service time window to confirm whether the first party may provide service at a certain point in time.

When the second interface of the first intelligent contract is called, the first intelligent contract can dynamically analyze the rule corresponding to each service time window. After the parsing is finished, it may be determined whether a current day in a time point to be matched (e.g., an initiation time of the target transaction, a current time point, etc.) and a date matching (day _ match) rule in a time slice match. And if so, further matching the time point to be matched with the starting and ending time in the time slice. If the time points are matched with the time slices, the time points to be matched are considered to be matched with the time slices, and whether each service time window is matched or not can be further known.

In some embodiments, the date-matching rule may be written directly into the first intelligent contract when the first intelligent contract is created. In some embodiments, a parameter may be added at the second interface, allowing the first participant to specify its corresponding date matching rule. Judgment rules such as weekend (weekend) and weekday (weekday) are common and can be directly written in the logic of the first intelligent contract, and various festivals and holidays can be dynamically changed and can be set by the first participant in a self-defining way.

The following describes in detail a transaction processing method based on a blockchain according to an embodiment of the present disclosure with reference to fig. 5. The transaction processing method based on the blockchain provided by the embodiment of the disclosure can be applied to the system architecture shown in fig. 3. The method shown in fig. 5 is described from the perspective of the first party interacting with the blockchain.

At step 510, a first participant sends a first invocation request for a first intelligent contract to the blockchain.

The first invocation request may be for setting a service time window for the first participant. In some embodiments, the first invocation request may include a service time rule for the first party. The service time rule may be used to indicate a time at which the first party is able to provide the service, and as an example, the service time rule may indicate that the service is available or unavailable for a certain period of time, for example, the service time rule may take any one or a combination of the following forms: "six 12 per week: 00 to 18 per weekday: 00 unavailable "," U.S. holiday unavailable ", or" workdays 9: 00-18: 00 available ".

In some embodiments, the first participant may send the first invocation request by invoking an interface in the first intelligent contract. For example, a first participant may invoke a first interface in a first smart contract to set its own service time window.

In step 520, the blockchain sets a service time window for the first participant according to the first invocation request.

After receiving the first invocation request sent by the first party, the blockchain may set a service time window of the first party according to the first invocation request. For example, when the service time window of the first participant is not stored in the blockchain, the blockchain may create the service time window of the first participant in the blockchain according to the first invocation request; or, when the service time window of the first participant is already stored in the blockchain, the blockchain may update the service time window of the first participant, which is already stored in the blockchain, according to the first call request.

Referring to fig. 6, in some embodiments, after the blockchain receives the first invocation request sent by the first participant, the permission of the first participant may be checked to determine whether the first invocation request is sent by the corresponding first participant, so as to ensure that each first participant can only invoke the interface to set its service time window on the blockchain.

As an implementation manner, the first invocation request may include a digital signature of the first participant, that is, the first participant may use a private key of an account of the first participant on the blockchain to perform the digital signature when sending the first invocation request, and after the blockchain receives the first invocation request, the block link may verify the digital signature in the first invocation request based on a public key of the first participant certified in the first intelligent contract, where the public key is a public key corresponding to a private key used when the first participant generates the digital signature. If the digital signature in the first invocation request is verified, it can be confirmed that the first invocation request is sent by the corresponding first party, and the first party can set the service time window of the first party on the blockchain.

In some embodiments, after the permission check of the first participant passes, the blockchain may also check the validity of the rules of the service time window submitted by the first participant. For example, it may be checked whether the rules of the service time window of the first party are within their own support scope; alternatively, it may be checked whether the point in time of the service time window of the first party is legitimate; as another example, it may be verified whether the corresponding holiday in the first participant's service time window has been maintained in the first intelligent contract (e.g., a specific time corresponding to a U.S. holiday needs to be pre-entered in the first intelligent contract).

When the authority of the first participant and the rule validity of the service time window of the first participant pass the verification, the blockchain may set the service time window of the first participant based on a first call request sent by the first participant; when the authority of the first participant or the validity of the rule of the service time window of the first participant does not pass the check, the blockchain may refuse to set the service time window of the first participant, and return a result of the call failure to the first participant.

The embodiment of the disclosure ensures that the service time windows of each participant of the target transaction can be managed on the blockchain by deploying the first intelligent contract on the blockchain, so that the blocking of the on-chain transaction caused by the absence of the service time windows of the participants can be avoided.

In some embodiments, the plurality of participants further includes a second participant that may send a second invocation request for the first intelligent contract to the blockchain. The second invocation request may be for querying a service time window of the first participant.

Fig. 7 is a flowchart illustrating a process of querying a service time window of a first participant according to an embodiment of the disclosure. As shown in fig. 7, when a second participant needs to query the service time window of the first participant on the blockchain, the second participant may query by invoking the second interface of the first intelligent contract. After receiving the second invocation request of the second party, the block link may return the query result of the service time window of the first party to the second party. In some embodiments, if the target transaction involves multiple first parties, the second party may collectively query the service time windows of the multiple first parties by invoking the second interface of the first smart contract.

As one example, the result of the query sent to the second party for the first party's service time window may be the first party's service time window. The blockchain may return the first party's service time window directly to the second party so that the second party may determine when to initiate a transaction on the blockchain based on the service time window.

As another example, the second invocation request may include the time of initiation of the target transaction, such as the current point in time, or some point in time at which the transaction is scheduled to be initiated. In this case, the result of the query of the first party's service time window sent to the second party may be used to indicate whether the initiation time of the targeted transaction is within the first party's service time window. As an implementation manner, after the blockchain queries the service time window of the first party based on the second invocation request, it may also be determined whether the initiation time of the target transaction is located in the service time window of the first party. The query result returned by the blockchain to the second party may be, for example, that the service is available when the initiation time of the target transaction is within the service time window of the first party; the query result returned by the blockchain to the second party may be, for example, that the service is unavailable when the initiation time of the target transaction is outside the service time window of the first party.

As one implementation, the intelligent contract and the time calculation may be combined, and the service time window may be dynamically expanded and calculated by using the characteristic of the intelligent contract dynamic calculation to determine whether the initiation time of the target transaction is located in the inter-service window of the first participant. Specifically, after receiving the second invocation request of the first intelligent contract from the second party, the blockchain may dynamically expand the service time window of the first party into a time period according to the initiation time of the target transaction, determine whether the initiation time of the target transaction is within the time period, and then return the query result of the service time window of the first party to the second party according to the determination result.

An example of the blockchain determining whether the initiation time of the target transaction is within the service time window of the first party is given below.

For example, the second party, when sending the second invocation request, may enter the initiation time of the target transaction: 2021-07-1815: 00. after receiving the second invocation request, the blockchain may first query the service time window of the first party stored in the blockchain, and then expand the service time window of the first party according to the input initiation time of the target transaction. For example, the service time window for querying the first participant is "workdays 9: 00-18: 00 or 12 per weekday: 00-20: 00 may provide service ", since the day, the day of the target transaction's origination time 2021-07-18, is a weekday, the service time window for weekdays is not in effect. Then the service time window for this first party may be expanded to 2012-07-1812 according to the initiation time of the target transaction: 00-2021-07-1820: 00. after the service time window of the first party is expanded into a time period, the blockchain can automatically judge whether the initiation time of the target transaction is within the time period after the service time window of the first party is expanded, and return the query result of the service time window of the first party to the second party according to the judgment result. For example, in this example, 2021-07-1815: 00 at 2012-07-1812: 00-2021-07-1820: 00, then the query results available for service may be returned to the second party.

The second party can inquire the service time windows of all the first parties involved in the target transaction before initiating the target transaction, and then initiate the target transaction when the initiation time of the target transaction is within the service time windows of all the first parties, so that the transaction blockage caused by the unavailable service of the first parties can be avoided, and the timeliness of transaction processing on the chain is further improved.

In some embodiments, a second intelligent contract may also be deployed on the blockchain, which may be used to execute the target transaction. The second intelligent contract may be, for example, an intelligent contract for a money transfer transaction, or may be an intelligent contract for a lease transaction.

The second party may send a first transaction execution request to the blockchain, which may be used to request the first party to execute the target transaction. The second party may initiate the first transaction execution request by invoking the second smart contract.

For example, in the system architecture shown in FIG. 8, a second intelligent contract may be automatically associated with a first intelligent contract, and thus, the second intelligent contract may invoke the first intelligent contract to query the first participant's service time window. When the second party initiates the first transaction execution request by invoking the second intelligent contract, the second intelligent contract may parse the target transaction to confirm the first party participating in the target transaction after receiving the first transaction execution request. After the first participant is analyzed, the second intelligent contract can directly call the first intelligent contract to inquire whether the initiation time of the first transaction execution request is positioned in the service time window of the first participant or not, and if the initiation time of the first transaction execution request is positioned outside the service time window of the first participant, the target transaction is terminated to avoid transaction blocking; if the initiation time of the first transaction execution request is within the first party's service time window, the target transaction continues to be advanced.

By automatically associating the second intelligent contract with the first intelligent contract, the second intelligent contract can directly invoke the first intelligent contract to query the service time window of the first participant, so that the service time window and the second intelligent contract on the chain can be automatically combined, and the interaction cost of the user is further reduced.

Method embodiments of the present disclosure are described in detail above in conjunction with fig. 1-8, and apparatus embodiments of the present disclosure are described in detail below in conjunction with fig. 9-11. It is to be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments, and therefore reference may be made to the preceding method embodiments for parts not described in detail.

Fig. 9 is a schematic block diagram of a transaction processing device based on a blockchain according to an embodiment of the present disclosure. The transaction processing arrangement 900 of fig. 9 may be applied to a blockchain (or a node in a blockchain network). Wherein the blockchain has a first intelligent contract deployed thereon for managing a service time window of at least one of the plurality of participants for the target transaction. The service time window of the at least one participant is used to indicate a time at which the at least one participant is able to participate in the target transaction. The at least one participant includes a first participant, and the transaction processing device 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 invocation request of a first intelligent contract from a first participant, the first invocation request being used to set a service time window of the first participant.

The setting unit 920 may be configured to set a service time window of the first participant according to the first invocation request.

Optionally, the plurality of parties includes a second party, and the transaction processing arrangement 900 may further include a second receiving unit and a transmitting unit. The second receiving unit may be configured to receive a second invocation request of the first intelligent contract from the second participant, the second invocation request being used to query the first participant's service time window. The transmitting unit may be configured to transmit a result of the query of the service time window of the first party to the second party.

Optionally, the second invocation request includes an initiation time of the target transaction, and the query result is used to indicate whether the initiation time of the target transaction is located in the service time window of the first party.

Optionally, the plurality of parties includes a second party, 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 party, the first transaction execution request requesting the first party to execute the target transaction. The invoking unit may be configured to invoke, in response to the first transaction execution request, the first smart contract to query whether an initiation time of the first transaction execution request is located within a service time window of the first party. The termination unit may be configured to terminate the target transaction if the initiation time of the first transaction execution request is outside a service time window of the first party.

Optionally, a second intelligent contract is deployed on the blockchain, the second intelligent contract being used to execute the target transaction.

Optionally, the transaction processing device 900 further comprises a first verification unit and a second verification unit. The first verification unit may be configured to verify the right of the first party. The second checking unit may be configured to check the validity of the rules of the service time window of the first participant. The setting unit 920 may be further configured to set a service time window of the first participant in response to the permission and the rule validity check passing.

Optionally, the first invocation request includes a digital signature of the first participant, and the first verification unit may be further configured to verify the digital signature based on a public key of the first participant certified in the first intelligent contract, where the public key is a public key corresponding to a private key used when the first participant generates the digital signature.

Fig. 10 is a schematic block diagram of a transaction processing device based on a blockchain according to another embodiment of the present disclosure. A first intelligent contract is deployed on the blockchain, the first intelligent contract for managing a service time window of at least one of a plurality of participants of the targeted transaction. Wherein the service time window of the at least one participant is to indicate a time at which the at least one participant is able to participate in the target transaction. The at least one participant includes a first participant to which the transaction processing arrangement 1000 of fig. 10 may be applied. The transaction processing device 1000 may include a transmitting unit 1010. The transmitting unit 1010 is described in detail below.

The sending unit 1010 may be configured to send a first invocation request of the first intelligent contract to the blockchain, the first invocation request being used to set a service time window of the first participant.

Optionally, a second intelligent contract is deployed on the blockchain, the second intelligent contract being used to execute the target transaction.

Optionally, the first invocation request includes a digital signature of the first party, the digital signature being generated by the first party using a private key.

Fig. 11 is a schematic block diagram of a transaction processing device based on a blockchain according to another embodiment of the present disclosure. The transaction processing apparatus 1100 shown in fig. 11 may be a computing device having a computing function, for example, the transaction processing apparatus 1100 may be a server. Transaction processing device 1100 may include memory 1110 and processor 1120. Memory 1110 may be used to store executable code. The processor 1120 may be configured to execute the executable code stored in the memory 1110 to implement the steps of the various methods described above. In some embodiments, the transaction processing device 1100 may also include a network interface 1130, and data exchange between the processor 1120 and an external device may be performed through the network interface 1130.

In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any other combination. When implemented in software, 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. The procedures or functions described in accordance with the embodiments of the disclosure are, in whole or in part, generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.

In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:自动化交易数据生成方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!