Transaction processing method and device based on blockchain
By deploying smart contracts on the blockchain to manage the service time windows of participants, it solves the transaction blocking problem caused by the unavailability of participants' services and achieves more efficient transaction processing.
Patent Information
- Application Number
- CN202111122529.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-09-24
AI Technical Summary
In a blockchain transaction scenario involving multiple parties, when the off-chain services of the participants are unavailable, the transaction will not be accepted for a long time, which will cause on-chain transaction blocking.
Deploy smart contracts on the blockchain to manage the service time windows of participants. By receiving and processing smart contract call requests, set and query the service time windows of participants to ensure that transactions are carried out within the available time.
It avoids on-chain transaction blocking caused by the unavailability of the participant's service time window, and improves the timeliness and user experience of transaction processing.
Smart Images

Figure CN113781230B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular to a transaction processing method and device based on blockchain. Background Art
[0002] At present, in the scenario of blockchain transactions involving multiple parties, the advancement of some transactions requires the participants to operate off-chain. In this case, the blockchain only ensures that the participants have confirmed the transaction on the chain, and the confirmation process of each participant depends on the participant completing the security review process in the internal system and submitting it to the blockchain to advance the transaction status.
[0003] If the on-chain status of a transaction requires confirmation from the participants, but the off-chain services of the participants are unavailable, for example, it is not within the time window when the participants can provide services, the transaction will not be processed for a long time. As a result, a large number of unfinished transactions will cause on-chain transactions to be blocked. Summary of the invention
[0004] In view of this, the present disclosure provides a transaction processing method and device based on blockchain to avoid on-chain transaction congestion caused by not being within the service time window of the participating parties.
[0005] In a first aspect, a transaction processing method based on blockchain is provided, wherein a first smart contract is deployed on the blockchain, and the first smart contract is used to manage a service time window of at least one participant among multiple participants of a target transaction, and 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, and the at least one participant includes a first participant. The method comprises: receiving a first call request for the first smart contract from the first participant, and the first call request is used to set the service time window of the first participant; and setting the service time window of the first participant according to the first call request.
[0006] In a second aspect, a transaction processing method based on blockchain is provided, wherein a first smart contract is deployed on the blockchain, and the first smart contract is used to manage a service time window of at least one participant among multiple participants of a target transaction, and 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, and the at least one participant includes a first participant. The method is applied to the first participant, and the method includes: sending a first call request of the first smart contract to the blockchain, and the first call request is used to set the service time window of the first participant.
[0007] According to a third aspect, a transaction processing device based on blockchain is provided, wherein a first smart contract is deployed on the blockchain, wherein the first smart contract is used to manage a service time window of at least one of multiple participants in a target transaction, wherein the service time window of the at least one participant is used to indicate a time when the at least one participant can participate in the target transaction, wherein the at least one participant includes a first participant, and the device includes: a first receiving unit, configured to receive a first call request for the first smart contract from the first participant, wherein the first call request is used to set the service time window of the first participant; and a setting unit, configured to set the service time window of the first participant according to the first call request.
[0008] In a fourth aspect, a transaction processing device based on blockchain is provided, wherein a first smart contract is deployed on the blockchain, wherein the first smart contract is used to manage a service time window of at least one participant among multiple participants of a target transaction, wherein the service time window of the at least one participant is used to indicate a time when the at least one participant can participate in the target transaction, wherein the at least one participant includes a first participant, and the device is applied to the first participant, wherein the device includes: a sending unit, configured to send a first call request of the first smart contract to the blockchain, wherein the first call request is used to set the service time window of the first participant.
[0009] In a fifth aspect, a blockchain-based transaction processing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and the processor is configured to execute the executable code to implement the method described in the first aspect or the second aspect.
[0010] In a sixth aspect, a computer-readable storage medium is provided, on which an executable code is stored. When the executable code is executed, the method described in the first aspect or the second aspect can be implemented.
[0011] In a seventh aspect, a computer program product is provided, comprising an executable code, which, when executed, can implement the method described in the first aspect or the second aspect.
[0012] The technical solution provided by the embodiment of the present disclosure deploys a first smart contract on the blockchain to ensure that the service time window of each participant of the target transaction can be managed on the blockchain, thereby avoiding on-chain transaction congestion caused by not being within the service time window of the participant. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 An example diagram of a blockchain system provided for an embodiment of the present disclosure.
[0014] Figure 2 A schematic diagram of a transaction involving multiple parties provided for an embodiment of the present disclosure.
[0015] Figure 3 An example diagram of a system architecture provided for an embodiment of the present disclosure.
[0016] Figure 4 An example diagram of the first smart contract provided in an embodiment of the present disclosure.
[0017] Figure 5 A flowchart of a blockchain-based transaction processing method provided in an embodiment of the present disclosure.
[0018] Figure 6 A schematic diagram of a process for setting a service time window for a first participant provided in an embodiment of the present disclosure.
[0019] Figure 7 A schematic diagram of a process for querying a service time window of a first participant provided in an embodiment of the present disclosure.
[0020] Figure 8 An exemplary diagram of another system architecture provided for an embodiment of the present disclosure.
[0021] Fig. 9 A schematic diagram of the structure of a blockchain-based transaction processing device provided in one embodiment of the present disclosure.
[0022] Fig.10 A schematic diagram of the structure of a blockchain-based transaction processing device provided in another embodiment of the present disclosure.
[0023] Fig.11 A schematic diagram of the structure of a blockchain-based transaction processing device provided in yet another embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0025] Blockchain is a distributed chain storage and accounting technology based on cryptography. Blockchain technology can organize and maintain large amounts of data in a decentralized or multi-centralized manner. It has the characteristics of being distributed, tamper-proof, traceable, secure and reliable, and is therefore widely used in many fields.
[0026] Figure 1 is an example diagram of a blockchain system provided by an embodiment of the present disclosure. Figure 1As shown, the blockchain system 100 may include a blockchain user terminal (hereinafter referred to as the user terminal) 110 and a blockchain network 120. The blockchain network 120 may include multiple blockchain nodes (hereinafter referred to as nodes), for example, Figure 1 Node 120-A, node 120-B, node 120-C, ..., node 120-N.
[0027] The nodes in the user terminal 110 and / or the blockchain network 120 may include various computing devices, such as smart phones, desktop computers, or servers. In some embodiments, the server may be an independent server or a server group, which may be centralized or distributed. In some embodiments, the server may be executed on a cloud platform.
[0028] The user terminal 110 is a terminal that can use blockchain services. The user terminal 110 can be connected to a node in the blockchain network 120 to obtain blockchain services. In some embodiments, the user terminal 110 can obtain blockchain services by initiating a blockchain transaction (referred to as a transaction, also referred to as a request), that is, the user terminal 110 can generate a transaction and send the generated transaction to the blockchain network 120.
[0029] The nodes in the blockchain network 120 may receive transactions broadcasted in the blockchain network 120. After receiving the transaction, the blockchain node may perform relevant operations according to the transaction content, i.e., execute the transaction. For example, transfer funds (or assets) between accounts to execute a remittance transaction. For another example, query blockchain data to execute a transaction to query the data. Or, call (or execute) a smart contract deployed on the blockchain to execute a transaction to call the smart contract.
[0030] A smart contract is a set of digitally defined promises, including protocols on which contract participants can execute these promises. A smart contract is essentially a piece of code running in a blockchain network to complete the business logic assigned by the user.
[0031] Smart contracts can contain information about transactions and only execute resulting actions after the requirements are met. Smart contracts can execute transactions that are traceable, irreversible, and secure.
[0032] As mentioned above, blockchain has the characteristics of being tamper-proof, secure and reliable. Therefore, transactions on blockchain can solve the problem of mutual trust among transaction participants. Based on this, blockchain can be used as an important development direction in transaction scenarios involving multiple parties. For example, blockchain can be widely used in transaction scenarios involving multiple parties and inherently lack of trust, such as fund transfer (such as remittance transactions), trade finance, and equipment leasing.
[0033] Combine the following Figure 2 , briefly introduces blockchain transactions involving multiple parties. Figure 2 In the illustrated scenario, a transaction may have multiple parties. For example, the multiple parties may include party A, which may be the initiator of the transaction. The multiple parties may also include party B and party C, which may be the promoters or executors of the transaction.
[0034] Taking a remittance transaction involving fund transfer as an example, Party A may refer to the initiator of the remittance transaction (e.g., the financial system of a certain enterprise), Party B may refer to the remittance bank, and Party C may refer to the receiving bank. Party A may initiate a remittance request to the blockchain, requesting Party B to pay a certain amount of funds from its corresponding bank account to a certain bank account of Party C. In some embodiments, the remittance transaction may refer to a cross-border remittance. In some embodiments, the remittance transaction may refer to an inter-bank remittance.
[0035] Taking equipment leasing as an example, Party A can refer to the lessee (e.g., a factory), Party B can refer to the lessor (e.g., a leasing platform), and Party C can refer to the supplier. Party A can initiate a leasing request to the blockchain, requesting Party B to lease a certain device to Party A. After Party B receives the request, it needs to request Party C to send the device to Party A.
[0036] In this transaction scenario involving multiple parties, as an example, when the execution of all transactions can be completed on the chain, it is theoretically possible to predefine trigger rules through smart contracts, so that transactions can be automatically completed on the chain.
[0037] As another example, when the blockchain is responsible for recording transactions and advancing transaction status on the chain, and the actual transaction operation requires the cooperation of the participants off-chain (for example, in a remittance transaction, participant B remits money to participant C off-chain; or in an equipment leasing transaction, supplier C sends the equipment to participant A off-chain), the transaction cannot actually be automatically advanced on the chain, but requires the participants to call the relevant smart contract interface to advance the transaction status.
[0038] That is to say, in some transaction scenarios involving multiple parties, due to internal supervision and other reasons, the participants need to operate blockchain transactions off-chain. Therefore, the blockchain only completes the reliability certification of the transaction on the chain, that is, to ensure that the participants have indeed confirmed the transaction. The confirmation process of each participant depends on the participant completing the security review process in the internal system and submitting 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 status.
[0039] For example, in scenarios involving fund transfers, the reliability of transactions can be authenticated on the blockchain. The actual fund transfer also depends on the participants performing operations off-chain, and the on-chain status of each transaction needs to be confirmed by the participants.
[0040] However, if the on-chain status of a transaction requires confirmation from the participants, but the off-chain services of the participants are not available, for example, it is not within the time window in which the participants can provide services, this will cause the current transaction status on the blockchain to remain as "created, waiting for confirmation by the participants", until the business system of the participants calls the smart contract interface to advance the transaction, and the transaction can reach the final state on the chain normally. In other words, the completion of a transaction depends on the service capabilities of each participant, especially the time window in which the services can be provided.
[0041] If the parties involved cannot confirm the transaction status in time after the transaction is initiated, the transaction will not be processed for a long time. As a result, a large number of unfinished transactions will cause on-chain transaction congestion.
[0042] In some embodiments, transaction blocking may affect customer experience. For example, in a remittance transaction involving fund transfer, after participant A initiates a remittance transaction request, the initiation time of the remittance transaction is not within the time window in which participant C can provide services, resulting in the funds of this remittance transaction being occupied, while participant A is unaware of this situation and cannot use the funds, affecting customer experience.
[0043] Taking the scenario involving fund transfer as an example, in the relevant technology, in order to avoid the situation where multiple parties need to confirm during the transaction, the transaction can be conducted through a money transfer company. Money transfer companies can first make an account deposit in the corresponding receiving bank, so that the transaction involving multiple parties can be transformed into two independent intra-bank remittances (the remitting bank directly transfers and receives the funds, and the receiving bank also directly transfers and remits the funds).
[0044] This solution can avoid transactions involving multiple parties by prepaying, thus avoiding the problem of multiple party confirmations. However, when adopting this solution, the money transfer company needs to prepay in advance. For some large-scale transfer scenarios, the prepayment cost of the money transfer company is extremely high and not feasible.
[0045] In order to solve the above problems, the embodiments of the present disclosure provide a transaction processing method and device based on blockchain to avoid on-chain transaction congestion caused by not being within the service time window of the participating parties.
[0046] Figure 3 is an example diagram of a system architecture provided by an embodiment of the present disclosure. Figure 3As shown, the system 300 may include a first participant 310, a second participant 320, and a blockchain 330. The first participant 310 and the second participant 320 are both one of the multiple participants of the target transaction.
[0047] The first participant 310 may be a promoter or executor of the target transaction. During the completion of a target transaction, there may be multiple first participants 310 promoting or executing the target transaction.
[0048] In 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.
[0049] The second party 320 may be the initiator of the target transaction. For example, the second party 320 may initiate a remittance transaction on the blockchain.
[0050] The first participant 310 and the second participant 320 may be user terminals on the blockchain. The first participant 310 and the second participant 320 may send a smart contract call request to the blockchain 330 (or blockchain network) in the form of a transaction, and call and execute the corresponding smart contract through all nodes in the blockchain 330.
[0051] The first party 310 and the second party 320 can communicate with the blockchain 330. In some embodiments, the first party 310 and the second party 320 do not need to communicate directly with each other.
[0052] A first smart contract may be deployed in the blockchain 330, and the first smart contract may be used to manage a 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 may be used to indicate a time when the at least one participant can participate in the target transaction. For example, the first smart contract may be used to manage the service time window of the first participant 310.
[0053] In some embodiments, the first smart contract may include two main interfaces. The first interface may be called to set its own service time window. For example, the first participant 310 may set its own service time window through the first interface. The second interface may be called to query the service time window of the first participant. For example, the second participant 320 may query the service time window of the first participant 310 through the second interface.
[0054] Combine the following Figure 4, giving an example of a first smart contract. The first smart contract may include a first interface (or referred to as an interface for setting a service time window, setupServiceTimeWindow) and a second interface (or referred to as an interface for querying a service time window, queryServiceTimeWindow). The first smart contract may also include stored on-chain persistent data.
[0055] The first participant can call the first interface to create or update the information of its own service time window. When the first smart contract receives the call request of the first interface, it can create or update the content of the persistent data on the chain according to the call request.
[0056] 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 information about the service time window of each first participant and the loop rule (loop_order) within the service time window.
[0057] Information about the service time window of the first party can be found in Figure 4 The "On-chain persistent data association relationship" section shown. The service time window information of the first participant may include a series of time slice information (TimeSlice), and a service time window (ServiceTimeWindow) composed of the combination information of these time slices.
[0058] like Figure 4 As shown, each time slice may include a pair of start and end times and corresponding time zones, and the start and end times are the service time windows of the corresponding first participant. Figure 4 In the table representing time slices, the row with id 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 Time Zone 8).
[0059] The first participant or the second participant can call the second interface to query the service time window of a first participant to confirm whether the first participant can provide services at a certain time point.
[0060] When the second interface of the first smart contract is called, the first smart contract can dynamically parse the rules corresponding to each service time window. After the parsing is completed, it can be determined 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.) and the date matching (day_match) rule in the time slice match. If they match, the time point to be matched and the start and end time in the time slice are further matched. If both match, it can be considered that the time point to be matched and the time slice match, and then it can be known whether each service time window matches.
[0061] In some embodiments, the date matching rules can be directly written into the first smart contract when the first smart contract is created. In some embodiments, input parameters can be added in the second interface to allow the first party to define its own corresponding date matching rules. For example, the judgment rules for weekends and weekdays are universal and can be directly written into the logic of the first smart contract, while various holidays will change dynamically, allowing the first party to customize the settings.
[0062] Combine the following Figure 5 , the transaction processing method based on blockchain provided by the embodiment of the present disclosure is described in detail. The transaction processing method based on blockchain provided by the embodiment of the present disclosure can be applied to Figure 3 The system architecture shown. Figure 5 The method shown is described from the perspective of the first party interacting with the blockchain.
[0063] In step 510, the first participant sends a first call request for a first smart contract to the blockchain.
[0064] 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 rules may be used to indicate the time when the first participant can provide services. As an example, the service time rules may indicate that the service is available or unavailable during a certain time period. For example, the service time rules may take any of the following forms or a combination thereof: "unavailable from 12:00 on Saturdays to 18:00 on Sundays", "unavailable on US holidays", or "available from 9:00 to 18:00 on weekdays".
[0065] In some embodiments, the first party may send a first call request by calling an interface in the first smart contract. For example, the first party may call a first interface in the first smart contract to set its own service time window.
[0066] In step 520, the blockchain sets a service time window for the first participant according to the first call request.
[0067] After receiving the first call request sent by the first participant, the blockchain may 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 may create the service time window of the first participant in the blockchain according to the first call 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 stored in the blockchain according to the first call request.
[0068] See also Figure 6 In some embodiments, after the blockchain receives the first call request sent by the first participant, it can verify the authority of the first participant to confirm whether the first call request is sent by the corresponding first participant, thereby ensuring that each first participant can only call the interface to set its own service time window on the blockchain.
[0069] As an implementation method, the first call request may include the digital signature of the first participant, that is, the first participant may use the private key of its account on the blockchain to digitally sign when sending the first call request. After receiving the first call request, the blockchain may verify the digital signature in the first call request based on the public key of the first participant stored in the first smart contract, wherein 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.
[0070] In some embodiments, after the first participant's authority verification is passed, the blockchain can also verify the legality of the rules of the service time window submitted by the first participant. For example, it can verify whether the rules of the first participant's service time window are within its support range; or it can verify whether the time point of the first participant's service time window is legal; for example, it can verify whether the corresponding holidays in the first participant's service time window have been maintained in the first smart contract (for example, the first smart contract needs to pre-enter the specific time corresponding to, for example, American holidays).
[0071] When the first participant's authority and the legitimacy of the rules of the first participant's service time window are both verified, the blockchain can set the first participant's service time window based on the first call request sent by the first participant; when the first participant's authority or the legitimacy of the rules of the first participant's service time window are not verified, the blockchain can refuse to set the first participant's service time window and return a call failure result to the first participant.
[0072] The disclosed embodiment deploys a first smart contract on the blockchain to ensure that the service time window of each participant of the target transaction can be managed on the blockchain, thereby avoiding on-chain transaction congestion caused by not being within the service time window of the participant.
[0073] In some embodiments, the plurality of participants further includes a second participant, and the second participant may send a second call request of the first smart contract to the blockchain. The second call request may be used to query the service time window of the first participant.
[0074] Figure 7 A flow chart of querying the service time window of the first participant provided in the embodiment of the present disclosure. Figure 7 As shown, 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 receiving the second call request from the second participant, the blockchain 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 query the service time windows of the multiple first participants uniformly by calling the second interface of the first smart contract.
[0075] 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 may 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 based on the service time window.
[0076] As another example, the second call request may include the initiation time of the target transaction, for example, the current time point, or the time point at which a certain transaction is planned to be initiated. In this case, the query result of the service time window of the first participant sent to the second participant can be used to indicate whether the initiation time of the target transaction is within the service time window of the first participant. As an implementation method, 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, for example, that the service is available; when the initiation time of the target transaction is outside the service time window of the first participant, the query result returned by the blockchain to the second participant may be, for example, that the service is unavailable.
[0077] As an implementation method, the smart contract and time calculation can be combined, and the characteristics of dynamic calculation of the smart contract can be used to dynamically expand and dynamically calculate the service time window to determine whether the initiation time of the target transaction is within the service time window of the first participant. Specifically, after the blockchain receives the second call 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 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 participant to the second participant based on the judgment result.
[0078] The following is an example of how the blockchain determines whether the initiation time of the target transaction is within the service time window of the first participant.
[0079] For example, when sending the second call request, the second participant can enter the initiation time of the target transaction: 2021-07-18 15:00. After receiving the second call request, the blockchain can first query the service time window of the first participant stored in the blockchain, and then expand the service time window of the first participant according to the initiation time of the input target transaction. For example, the service time window of the first participant is found to be "services can be provided from 9:00-18:00 on each working day or from 12:00-20:00 on every Sunday". Since the initiation time of the target transaction, 2021-07-18, is Sunday, the service time window on working days is not effective. 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 the service time window of the first participant is expanded into a time period, the blockchain can automatically determine whether the initiation time of the target transaction is within the time period after the service time window of the first participant is expanded, and return the query result of the service time window of the first participant to the second participant according to the judgment result. For example, in this example, 2021-07-18 15:00 is within the time period of 2012-07-18 12:00-2021-07-18 20:00, then the query result of service availability can be returned to the second participant.
[0080] Before initiating the target transaction, the second participant can first query the service time windows of all the first participants involved in the target transaction. When the initiation time of the target transaction is within the service time windows of all the first participants, the target transaction can be initiated. This can avoid transaction congestion caused by the unavailability of the first participant's service, thereby improving the timeliness of on-chain transaction processing.
[0081] In some embodiments, a second smart contract may be deployed on the blockchain, and the second smart contract may be used to execute the target transaction. The second smart contract may be, for example, a smart contract for a remittance transaction, or a smart contract for a leasing transaction.
[0082] The second party may send a first transaction execution request to the blockchain, and the first transaction execution request may be used to request the first party to execute the target transaction. The second party may initiate the first transaction execution request by calling the second smart contract.
[0083] For example, in Figure 8In the system architecture shown, 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 receiving the first transaction execution request, the second smart contract can parse the target transaction to confirm the first participant participating in the target transaction. After parsing the first participant, the second smart contract can directly call 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 to avoid transaction blocking; if the initiation time of the first transaction execution request is within the service time window of the first participant, the target transaction is continued.
[0084] 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 combined, further reducing the user's interaction cost.
[0085] Combination of the above Figures 1 to 8 , describes in detail the method embodiment of the present disclosure, and the following is combined with Figures 9 to 11 , describes the device embodiment of the present disclosure in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.
[0086] Fig. 9 It is a schematic structural diagram of a blockchain-based transaction processing device provided in one embodiment of the present disclosure. Fig. 9 The transaction processing device 900 can be applied to a blockchain (or a node in a blockchain network). A first smart contract is deployed on the blockchain, 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. 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.
[0087] The first receiving unit 910 can be configured to receive a first call request of a first smart contract from a first participant, where the first call request is used to set a service time window for the first participant.
[0088] The setting unit 920 may be configured to set a service time window of the first party according to the first call request.
[0089] Optionally, the multiple participants include a second participant, and the transaction processing device 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, the second call request being 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.
[0090] 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.
[0091] Optionally, the multiple participants include a second participant, and the transaction processing device 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, the first transaction execution request being used to request the first participant to execute a 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 terminating 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.
[0092] Optionally, a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
[0093] 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 legitimacy 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 legitimacy verification passing.
[0094] Optionally, the first call request includes a digital signature of the first party, and the first verification unit can be further configured to verify the digital signature based on the public key of the first party stored in the first smart contract, wherein the public key is the public key corresponding to the private key used by the first party to generate the digital signature.
[0095] Fig.10 : is a schematic structural diagram of a transaction processing device based on blockchain provided by another embodiment of the present disclosure. A first smart contract is deployed on the blockchain, 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. The at least one participant includes a first participant, Fig.10 The transaction processing device 1000 may be applied to the first party. The transaction processing device 1000 may include a sending unit 1010. The sending unit 1010 is described in detail below.
[0096] The sending unit 1010 can 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 a service time window of the first participant.
[0097] Optionally, a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
[0098] Optionally, the first call request includes a digital signature of the first party, which is generated by the first party using a private key.
[0099] Fig.11 It is a schematic structural diagram of a blockchain-based transaction processing device provided in yet another embodiment of the present disclosure. Fig.11 The transaction processing device 1100 shown may be a computing device with computing functions, for example, the transaction processing device 1100 may be a server. The transaction processing device 1100 may include a memory 1110 and a processor 1120. The memory 1110 may be used to store executable code. The processor 1120 may be used to execute the executable code stored in the memory 1110 to implement the steps in 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 implemented through the network interface 1130.
[0100] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can 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 a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0101] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments of the present disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.
[0102] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0103] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0105] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
[0106] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A transaction processing method based on blockchain, wherein a first smart contract is deployed on the blockchain, the first smart contract is used to manage a service time window of at least one of multiple participants in a target transaction, the service time window of the at least one participant is used to indicate a time when the at least one participant can participate in the target transaction, the at least one participant includes a first participant, and the multiple participants include a second participant, The method comprises: receiving a first call request for the first smart contract from the first participant, where the first call request is used to set a service time window for the first participant; According to the first call request, setting a service time window of the first participant, where the service time window of the first participant is used to determine a transaction time of the target transaction; receiving a first transaction execution request from the second participant, wherein the first transaction execution request is used to request the first participant 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.
2. The method according to claim 1, further comprising: receiving a second call request for the first smart contract from the second participant, where the second call request is used to query a service time window of the first participant; Sending a query result of the service time window of the first party to the second party.
3. According to the method of claim 2, 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.
4. The method according to claim 3, after receiving the second call request of the first smart contract from the second participant, the method further comprises: According to the initiation time of the target transaction, dynamically expand the service time window of the first participant into time periods; Determine whether the initiation time of the target transaction is within the time period.
5. According to the method of claim 1, a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
6. The method according to claim 1, after receiving the first call request of the first smart contract from the first participant, the method further comprises: Verifying the authority of the first participant; Verifying the legality of the service time window rules of the first participant; The step of setting the service time window of the first participant according to the first call request includes: In response to the permission and the rule legitimacy being verified, setting a service time window for the first participant.
7. The method according to claim 6, wherein the first call request includes a digital signature of the first party. 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 the public key corresponding to the private key used by the first participant to generate the digital signature.
8. A transaction processing method based on blockchain, wherein a first smart contract is deployed on the blockchain, the first smart contract is used to manage the service time window of at least one of multiple participants in a 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 a first participant, the multiple participants include a second participant, the second participant sends a first transaction execution request, the first transaction execution request is used to request the first participant to execute the target transaction, the method is applied to the first participant, The method comprises: Sending a first call request of the first smart contract to the blockchain, where the first call request is used to set a service time window of the first participant, where the service time window of the first participant is used to determine a transaction time of the target transaction; The first transaction execution request is also used to call 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 will be terminated.
9. According to the method of claim 8, a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
10. According to the method of claim 8, 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. A transaction processing device based on blockchain, wherein a first smart contract is deployed on the blockchain, the first smart contract is used to manage a service time window of at least one of multiple participants in a target transaction, the service time window of the at least one participant is used to indicate a time when the at least one participant can participate in the target transaction, the at least one participant includes a first participant, and the multiple participants include a second participant, The device comprises: A first receiving unit is 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 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 call request, wherein the service time window of the first participant is used to determine a transaction time of the target transaction; A third receiving unit is configured to receive a first transaction execution request from the second participant, wherein the first transaction execution request is used to request the first participant to execute the target transaction; a calling unit, 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 is 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.
12. The device according to claim 11, further comprising: A second receiving unit is configured to receive 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; A sending unit is configured to send the query result of the service time window of the first participant to the second participant.
13. According to the device of claim 12, 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.
14. The apparatus according to claim 13, further comprising: an expansion unit, configured to dynamically expand the service time window of the first participant into time periods according to the initiation time of the target transaction; The determination unit is configured to determine whether the initiation time of the target transaction is within the time period.
15. The device according to claim 11, wherein a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
16. The apparatus according to claim 11, further comprising: A first verification unit, configured to verify the authority of the first participant; A second verification unit is configured to verify the legality of the rule of the service time window of the first participant; The setting unit is further configured to set a service time window for the first participant in response to the validity check of the authority and the rule passing.
17. The apparatus according to claim 16, wherein the first call request includes a digital signature of the first party. The first verification unit is further configured to verify the digital signature based on the public key of the first party stored in the first smart contract, wherein: The public key is the public key corresponding to the private key used by the first party to generate the digital signature.
18. A transaction processing device based on blockchain, wherein a first smart contract is deployed on the blockchain, the first smart contract is used to manage the service time window of at least one of multiple participants in a 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 a first participant, the multiple participants include a second participant, the second participant sends a first transaction execution request, the first transaction execution request is used to request the first participant to execute the target transaction, the device is applied to the first participant, The device comprises: A sending unit is configured to send a first call request of the first smart contract to the blockchain, where the first call request is used to set a service time window of the first participant, where the service time window of the first participant is used to determine the transaction time of the target transaction, and the first transaction execution request is also used to call 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 will be terminated.
19. According to the transaction processing device according to claim 18, a second smart contract is deployed on the blockchain, and the second smart contract is used to execute the target transaction.
20. According to the device of claim 18, 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.
21. A blockchain-based transaction processing device, comprising a memory and a processor, wherein the memory stores executable code, and the processor is configured to execute the executable code to implement the method described in any one of claims 1 to 10.
