Block chain service processing method, device and system and computer equipment
By determining the lower limit of virtual resources and gradually increasing the amount of resources, the problem of waste of computing resources in traditional blockchain business transactions is solved, and more efficient transaction processing is achieved.
Patent Information
- Application Number
- CN202310505315.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2024-11-08
AI Technical Summary
During the traditional blockchain business transaction process, the requesting party consumes a lot of computing resources when initiating a request for on-chain transaction, resulting in waste of resources and inefficiency.
By obtaining the uplink proxy request for business transactions, determine the lower limit of virtual resources to be consumed for on-chain contract call parameters, generate a uplink request matching the amount of resources, and gradually increase the resource amount until the response is met, and the uplink processing node transfer is carried out. Resources to inspire their response.
On the basis of ensuring that transactions are on the chain, the computing resources consumed in business processing are saved, and transaction efficiency and resource utilization are improved.
Smart Images

Figure CN118921155A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a blockchain business processing method, apparatus, system, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] As a decentralized multi-node network, blockchain can achieve secure data storage. During the application process, when the contract call parameters of the business transaction are on the chain, the blockchain node can implement the business transaction by calling the smart contract deployed on the blockchain.
[0003] In traditional technology, the requester of a business transaction initiates a request to upload the contract call parameters to the chain. When the request is responded to by the chain processing node, the blockchain node calls the corresponding smart contract to implement the business transaction. With traditional technology, the requester needs to consume a lot of computing resources in the process of initiating a chain transaction request. Summary of the invention
[0004] Based on this, it is necessary to provide a blockchain business processing method, device, system, computer equipment, computer-readable storage medium and computer program product that can save computing resources in response to the above technical problems.
[0005] In a first aspect, the present application provides a blockchain business processing method. The method comprises:
[0006] Obtaining an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by a blockchain system;
[0007] Determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain;
[0008] Generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0009] If the uplink request meets the update condition, update the uplink request and broadcast it until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0010] Transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0011] In a second aspect, the present application provides a blockchain business processing system. The system includes a requester, a proxy service node, and an on-chain processing node;
[0012] The requester is used to initiate an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system;
[0013] The proxy service node is used to obtain the on-chain proxy request, determine the lower limit of virtual resources consumed for on-chaining the contract call parameters of the business transaction, generate an on-chain request carrying the contract call parameters and the amount of resources matching the lower limit of virtual resources, and broadcast the on-chain request to the on-chain processing node of the blockchain system; and is also used to update the on-chain request and broadcast it when the on-chain request meets the update condition until the broadcasted on-chain request is responded to by the on-chain processing node; the amount of resources carried in each broadcasted on-chain request increases gradually in the order of broadcast time;
[0014] The on-chain processing node is used to respond to the on-chain request and perform on-chain processing on the contract call parameters;
[0015] The proxy service node is also used to transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0016] In a third aspect, the present application provides a blockchain business processing device. The device includes:
[0017] An on-chain proxy request acquisition module is used to obtain an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system;
[0018] A virtual resource lower limit determination module, used to determine the virtual resource lower limit required to upload the contract call parameters of the business transaction to the chain;
[0019] An on-chain request generation module, used to generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0020] An uplink request update module, configured to update and broadcast the uplink request if the uplink request meets the update condition, until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0021] The contract calling module is used to transfer the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0022] In a fourth aspect, the present application provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0023] Obtaining an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by a blockchain system;
[0024] Determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain;
[0025] Generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0026] If the uplink request meets the update condition, update the uplink request and broadcast it until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0027] Transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0028] In a fifth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0029] Obtaining an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by a blockchain system;
[0030] Determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain;
[0031] Generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0032] If the uplink request meets the update condition, update the uplink request and broadcast it until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0033] Transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0034] In a sixth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0035] Obtaining an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by a blockchain system;
[0036] Determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain;
[0037] Generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0038] If the uplink request meets the update condition, update the uplink request and broadcast it until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0039] Transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0040] The above-mentioned blockchain business processing method, device, system, computer equipment, computer-readable storage medium and computer program product, on the one hand, based on the contract call parameters of the business transaction, determine the lower limit of virtual resources required to put the transaction on the chain, generate and broadcast a chain request carrying the resource amount matching the lower limit of the virtual resources, and when the chain request meets the update conditions, increase the resource amount by gradient until the broadcasted chain request is responded by the chain processing node, and transfer the virtual resources represented by the resource amount carried by the responded chain request to the chain processing node that responds to the chain request, which can motivate the chain processing node to consume its own computing resources to respond to the chain request and ensure that the transaction is on the chain. On the other hand, obtain a chain proxy request for a business transaction, generate and broadcast a chain request based on the contract call parameters of the business transaction, and when the broadcasted chain request is responded by the chain processing node, call the smart contract to implement the business transaction, which is equivalent to using a centralized processing method, using dedicated computing resources to initiate a chain request, and calling a smart contract to implement the business transaction. Compared with the decentralized processing method, it can save computing resources consumed by business processing to a certain extent. Therefore, by adopting the above method, it is possible to save computing resources consumed in business processing while ensuring that transactions are put on the chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a process of generating a new block in some embodiments;
[0042] Figure 2 It is an application environment diagram of the blockchain business processing method in some embodiments;
[0043] Figure 3 A flowchart of a blockchain business processing method in some embodiments;
[0044] Figure 4 A schematic diagram of a process of a blockchain business processing method in some embodiments;
[0045] Figure 5 A schematic diagram of an interactive process for updating the remaining resource amount of a requester in some embodiments;
[0046] Figure 6 A schematic diagram of an update process of an uplink request in some embodiments;
[0047] Figure 7 A flowchart of a blockchain business processing method in some other embodiments;
[0048] Figure 8 It is a structural block diagram of a blockchain business processing system in some embodiments;
[0049] Fig. 9 A schematic diagram of the interaction process of the on-chain proxy service in some embodiments;
[0050] Fig.10 A schematic diagram of a process in which a proxy service node calls a smart contract to implement a business transaction in some embodiments;
[0051] Fig.11 It is a structural block diagram of a blockchain business processing device in some embodiments;
[0052] Fig.12 is an internal structure diagram of a computer device in some embodiments;
[0053] Fig.13 1 is a diagram of the internal structure of a computer device in some other embodiments. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] Before going into detail, some terms involved in this application are explained first.
[0056] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0057] The blockchain business processing method provided in the embodiment of the present application can be applied to a data sharing system. Among them, the data sharing system refers to a system for sharing data between nodes, and the data sharing system may include multiple nodes, and the multiple nodes may refer to each client in the data sharing system. In the embodiment of the present application, the node may specifically include a proxy service node, an on-chain processing node, etc. Each node can receive input information when performing normal work, and maintain the shared data in the data sharing system based on the received input information. In order to ensure the information intercommunication within the data sharing system, there may be an information connection between each node in the data sharing system, and the nodes can transmit information through the above-mentioned information connection. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system are consistent.
[0058] Each node in the data sharing system has a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so that the generated blocks can be broadcast to other nodes in the data sharing system according to the node identifiers of other nodes. A node identifier list can be maintained in each node, and the node name and node identifier are stored in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address and any other information that can be used to identify the node.
[0059] Each node in the data sharing system stores the same blockchain. The blockchain consists of multiple blocks. When generating each block in the blockchain, refer to Figure 1, when the node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, the input information is stored in the memory pool, and the hash tree used to record the input information is updated; then, the information in the memory pool is packaged and processed by the chain processing node, specifically updating the update timestamp to the time when the input information is received, and trying different random numbers, performing characteristic value calculations multiple times. When the calculation is completed, the information can be stored accordingly, and the block header and block body are generated to obtain the current block. Subsequently, the node where the blockchain is located sends the newly generated blocks to other nodes in the data sharing system according to the node identifiers of other nodes in the data sharing system, and other nodes verify the newly generated blocks, and add the newly generated blocks to the blockchain stored in them after the verification is completed.
[0060] The blockchain business processing method provided in this application can be applied to Figure 2 In the application environment shown. The application environment includes a requester 201, a proxy service node 202 and an on-chain processing node 203, which can communicate over the network and realize consensus, data recording and on-chain functions in blockchain technology based on smart contracts. Among them, the proxy service node 202, in the process of implementing the blockchain business processing method: obtains an on-chain proxy request for a business transaction initiated by the requester 201; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system; determines the lower limit of virtual resources consumed by on-chaining the contract call parameters of the business transaction; generates an on-chain request carrying the contract call parameters and the amount of resources matching the lower limit of the virtual resources, and broadcasts the on-chain request to the on-chain processing node 203 of the blockchain system; when the on-chain request meets the update conditions, the on-chain request is updated and broadcast until the broadcast on-chain request is responded to by the on-chain processing node; the amount of resources carried in each broadcast on-chain request increases in a gradient order according to the broadcast time; transfers the virtual resources represented by the amount of resources carried by the responded on-chain request to the on-chain processing node that responds to the on-chain request, and calls the smart contract to implement the business transaction.
[0061] Furthermore, the requester 201, the proxy service node 202 and the on-chain processing node 203 can all be implemented through a terminal or a server. Among them, the terminal includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc., and the server can be implemented as an independent server or a server cluster composed of multiple servers. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0062] In one embodiment, Figure 3 As shown, a blockchain business processing method is provided. This embodiment applies this method to Figure 2Taking the proxy service node 202 in the example as an example, the following steps are included:
[0063] Step S302, obtaining an on-chain proxy request for a business transaction.
[0064] Among them, business transactions include transactions that need to be implemented by calling smart contracts deployed by the blockchain system. In the blockchain, transactions are equivalent to events, and business transactions refer to events that implement business, which may include at least one of data storage, data authentication, data update or data query. Business transactions are initiated by the requester, which is the party requesting the implementation of business transactions. The on-chain proxy request refers to a proxy request for transaction on the chain. In the blockchain system, only transactions packaged on the chain can be executed, and the operation of packaging on the chain can be performed by the on-chain processing node. The premise for the on-chain processing node to package transactions into blocks is that there is a broadcast on-chain request for business transactions. In this application, the proxy service node uniformly performs on-chain proxy, generates on-chain requests, and broadcasts the on-chain requests to the on-chain processing nodes of the blockchain system.
[0065] Specifically, when the requester needs to implement a business transaction by calling a smart contract deployed by the blockchain system, the requester can initiate an on-chain proxy request for the business transaction to the proxy service node, and the proxy service node will obtain the on-chain proxy request.
[0066] Furthermore, the on-chain proxy request may carry contract call parameters signed by the requester. The contract call parameters may include the contract identifier of the smart contract to be called and the contract input data determined by the requester. The contract identifier is the unique identifier of the smart contract and may be represented by the contract address. The contract input data may include input data passed to a function in the smart contract, that is, the contract call parameters may also include function identifiers and function input data. Among them, the function identifier may be represented by the function name; the data type of the input data may be an integer, a string, an array, etc. In a specific implementation, the requester determines the contract call parameters including the contract identifier of the smart contract to be called and the contract input data when it is necessary to implement a business transaction by calling a smart contract deployed by the blockchain system, and then signs the contract call parameters using the requester's private key, and sends the signed contract call parameters to the proxy service node to initiate an on-chain proxy request for the business transaction to the proxy service node, and then the proxy service node obtains the on-chain proxy request for subsequent processing.
[0067] Step S304, determine the lower limit of virtual resources consumed to put the contract call parameters of the business transaction on the chain.
[0068] As mentioned above, in the blockchain system, only transactions that are packaged and uploaded to the chain can be executed. Packaging transactions and uploading them to the chain essentially means packaging the relevant data of the transaction and uploading them to the chain. Specifically for this application, the relevant data packaged and uploaded to the chain include the contract call parameters of the business transaction. The operation of packaging and uploading to the chain is generally performed by the upchain processing node, which consumes the computing resources of the upchain processing node. Therefore, it is usually necessary to transfer virtual resources that match the computing resources to the upchain processing node to incentivize the upchain processing node to consume its own computing resources for upchain processing. The lower limit of virtual resources refers to the minimum value of virtual resources required to consume the contract call parameters of business transactions on the chain.
[0069] Specifically, the proxy service node determines the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain. The specific method for determining the lower limit of the virtual resources is not unique. In one embodiment, the proxy service node can determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain based on the transaction type of the business transaction and the resource consumption of each historical business transaction of the same type. Exemplarily, the server can determine the minimum or average value of the resource consumption of multiple historical business transactions of the same type as the lower limit of virtual resources. The server can also subtract or add a set value based on the average value of each resource consumption to obtain the lower limit of virtual resources. In one embodiment, the proxy service node can obtain the current transaction volume of the blockchain system, and based on the current transaction volume, determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain. Among them, the virtual resource lower limit is positively correlated with the current transaction volume. Exemplarily, when the current transaction volume is less than the transaction volume threshold, the proxy service node can determine the set value according to the difference between the current transaction volume and the transaction volume threshold, and then, based on the average value of each resource consumption, subtract the set value to obtain the virtual resource lower limit; correspondingly, when the current transaction volume is greater than the transaction volume threshold, the proxy service node can determine the set value according to the difference between the current transaction volume and the transaction volume threshold, and then, based on the average value of each resource consumption, add the set value to obtain the virtual resource lower limit. Among them, the difference between the previous transaction volume and the transaction volume threshold is positively correlated with the set value.
[0070] Step S306: Generate an on-chain request that carries the contract call parameters and the resource quantity that matches the lower limit of the virtual resources, and broadcast the on-chain request to the on-chain processing node of the blockchain system.
[0071] Among them, the on-chain request is a request to put the business transaction on the chain, and the on-chain request can specifically request to add the contract call parameters of the business transaction to the blockchain. The resource amount matches the virtual resource lower limit, which means that the difference between the resource amount and the virtual resource lower limit is within the difference range. Exemplarily, the proxy service node can determine the resource amount represented by the virtual resource lower limit as the resource amount that matches the virtual resource lower limit; it can also increase or subtract the set resource amount based on the resource amount represented by the virtual resource lower limit to obtain the resource amount that matches the virtual resource lower limit.
[0072] Specifically, the proxy service node can determine the amount of resources that matches the lower limit of the virtual resources, generate an on-chain request carrying the contract call parameters and the amount of resources, and after signing the on-chain request, broadcast the on-chain request to the on-chain processing node of the blockchain system.
[0073] Step S308: When the uplink request meets the update condition, the uplink request is updated and broadcasted until the broadcasted uplink request is responded to by the uplink processing node.
[0074] Among them, the on-chain request meets the update condition, which means that there is no on-chain processing node that responds to the on-chain request. Specifically, after the proxy service node broadcasts the on-chain request to the on-chain processing node of the blockchain system, it waits for the response of the on-chain processing node. If there is an on-chain processing node that responds to the on-chain request, the on-chain processing node performs on-chain processing, packages the relevant data of the business transaction targeted by the on-chain request, and generates the current block to be on-chain for storing the packaged data. Then, the on-chain processing node can broadcast the current block to the blockchain network, and the consensus node in the blockchain network performs consensus authentication on it, and after the authentication is passed, the current block is connected to the blockchain, thereby completing the on-chain of the business transaction. The relevant data includes contract call parameters, signature information, etc. After setting the waiting time, if there is no on-chain processing node that responds to the on-chain request, the proxy service node determines that the on-chain request meets the update condition, and then increases the amount of resources carried in the on-chain request, updates the on-chain request and broadcasts it, and enters the next round of waiting. And so on, until the broadcasted on-chain request is responded to by the on-chain processing node. The set waiting time can be specified by the requester or determined by the proxy service node based on the requester's urgency to go online. The higher the urgency of going online, the more likely the requester wants to go online as soon as possible, and the set waiting time can be appropriately shortened.
[0075] Furthermore, the amount of resources carried in each broadcast uplink request increases gradually in the order of broadcast time. That is to say, for each broadcast uplink request of the same business transaction, the later the broadcast time order, the greater the amount of resources carried. Exemplarily, for business transaction A, the amount of resources carried by the first broadcast uplink request is a0. If there is no uplink processing node that responds to the uplink request after the waiting time is set, the proxy service node determines that the uplink request meets the update condition, updates the uplink request and broadcasts it. At this time, the amount of resources carried in the broadcast uplink request is a0+a1. By analogy, the amount of resources carried by the third broadcast uplink request is a0+a1+a2, and the amount of resources carried by the nth broadcast uplink request is a0+a1+a2+…+a n-1 Among them, a i > 0, i = 0, 1, 2, ..., n-1. Furthermore, the resource increment of the uplink request after the update relative to the uplink request before the update can be the same or different. That is, in the above example, a1 = a2 = ... = a n-1 ; can also be a1 to a n-1 There is at least one resource whose value is different from that of other resource increments.
[0076] In addition, in one embodiment, the transaction serial numbers of the on-chain requests before and after the update are consistent. In this way, for multiple on-chain requests corresponding to the same transaction serial number, the on-chain processing node can process the on-chain request with the largest amount of resources, and invalidate the remaining unresponded on-chain requests, so as to avoid repeated responses to on-chain requests for the same business transaction.
[0077] Step S310: transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0078] Specifically, when the on-chain processing node processes the on-chain request and packages it into blocks so that the contract call parameters of the business transaction are on-chain, the proxy service node transfers the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, so as to compensate for the resource consumption of the on-chain processing node during the on-chain processing process, and calls the smart contract to realize the business transaction. Furthermore, in the process of calling the smart contract to realize the business transaction, the proxy service node can first check the contract call parameters, verify the signature of the requester, and check whether the remaining resources of the requester are sufficient to pay for the consumed resources of this on-chain. If the parameters are correct, the signature verification is passed, and the remaining resources are sufficient, the smart contract is called based on the contract call parameters to realize the business transaction.
[0079] It can be understood that if the first uplink request generated and broadcasted by the proxy service node for a certain uplink proxy request is responded to by the uplink processing node, there is no need to update the uplink request, and the virtual resources represented by the resource amount carried by the responded uplink request can be directly transferred to the uplink processing node that responds to the uplink request. That is, in one embodiment, Figure 4 As shown in the figure, the blockchain business processing process includes:
[0080] Step S401, obtaining an on-chain proxy request;
[0081] Among them, the on-chain proxy request is a proxy request for business transactions; business transactions include transactions that need to be implemented by calling smart contracts deployed by the blockchain system;
[0082] Step S402, generate and broadcast a link request;
[0083] The on-chain request carries the contract call parameters of the business transaction and the amount of resources that matches the lower limit of virtual resources consumed by the contract call parameters on-chain; the proxy service node specifically broadcasts the on-chain request to the on-chain processing node of the blockchain system;
[0084] Step S403, determine whether there is an uplink processing node that responds to the currently broadcasted uplink request; if not, execute step S404; if yes, execute step S405;
[0085] Step S404, update the link request and broadcast it, and return to step S403;
[0086] The amount of resources carried in each broadcast uplink request increases gradually according to the broadcast time sequence;
[0087] Step S405, transferring virtual resources to realize business transactions;
[0088] The proxy service node specifically transfers the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and calls the smart contract to implement the business transaction.
[0089] The above-mentioned blockchain business processing method, on the one hand, determines the lower limit of virtual resources required to put the transaction on the chain based on the contract call parameters of the business transaction, generates and broadcasts a chain request carrying the resource amount matching the virtual resource lower limit, and when the chain request meets the update conditions, the resource amount is increased by gradient until the broadcasted chain request is responded to by the chain processing node, and the virtual resources represented by the resource amount carried by the responded chain request are transferred to the chain processing node that responds to the chain request, which can motivate the chain processing node to consume its own computing resources to respond to the chain request and ensure that the transaction is on the chain. On the other hand, the chain proxy request initiated by the requester for the business transaction is obtained, and the chain request is generated and broadcast based on the contract call parameters of the business transaction. When the broadcasted chain request is responded to by the chain processing node, the smart contract is called to implement the business transaction, which is equivalent to using a centralized processing method, using dedicated computing resources to initiate a chain request, and calling a smart contract to implement the business transaction. Compared with the decentralized processing method, it can save the computing resources consumed by business processing to a certain extent. Therefore, the above method can save the computing resources consumed by business processing on the basis of ensuring the transaction on the chain.
[0090] In some embodiments, step S302 includes: obtaining the current transaction volume of the blockchain system; based on the current transaction volume, determining the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain.
[0091] Among them, the lower limit of virtual resources is positively correlated with the current transaction volume. Positive correlation means that when other conditions remain unchanged, the two variables change in the same direction. When one variable changes from large to small, the other variable also changes from large to small, but it does not require that when one variable changes a little, the other variable must also change. For example, when variable a is between 10 and 20, variable b can be set to 100, and when variable a is between 20 and 30, variable b can be set to 120. In this way, the change direction of a and b is that when a increases, b also increases. But when a is in the range of 10 to 20, b can be unchanged. The current transaction volume of the blockchain system refers to the sum of the number of transactions currently waiting to be responded to and the number of transactions being processed by the blockchain system, including the number of on-chain requests that have been broadcast but not responded. It can be understood that the larger the current transaction volume of the blockchain system, on the one hand, it means that the blockchain network is more congested, and the on-chain processing node needs to consume more computing resources to package transactions on the chain; on the other hand, it also means that the busier the business of the on-chain processing node is, the more on-chain requests that can be selected for response.
[0092] Based on this, the proxy service node can obtain the current transaction volume of the blockchain, and based on the current transaction volume, determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain. Exemplarily, the proxy service node can establish a correspondence between the transaction volume and the virtual resource lower limit, and obtain the current transaction volume of the blockchain, and based on the current transaction volume and the correspondence between the transaction volume and the virtual resource lower limit, determine the virtual resource lower limit that matches the current transaction volume. The corresponding relationship can be represented by the mapping relationship between the transaction volume and the virtual resource lower limit, or by the functional relationship satisfied by the transaction volume and the virtual resource lower limit.
[0093] In this embodiment, based on the current transaction volume, the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain is determined, so that the lower limit of virtual resources matches the current transaction volume, ensuring that the amount of resources carried by the chain request is consistent with the current transaction situation of the blockchain, and thus ensuring that the chain request can be responded to in a timely manner.
[0094] In one embodiment, the blockchain business processing method further includes: extracting contract call parameters for business transactions from the on-chain proxy request; determining the complexity of the called contract in the contract call parameters, and the data volume of the contract input data determined by the requesting party. In the case of this embodiment, based on the current transaction volume, determining the lower limit of virtual resources consumed by putting the contract call parameters of the business transaction on the chain includes: determining the lower limit of virtual resources consumed by putting the contract call parameters of the business transaction on the chain based on the current transaction volume, complexity and data volume.
[0095] Among them, the lower limit of virtual resources is also positively correlated with the complexity of the called contract in the contract call parameters and the amount of contract input data determined by the requester. For the specific definition of positive correlation, please refer to the above, which will not be repeated here. The complexity can be represented by the number of functions contained in the called contract. It can be understood that the more functions there are in the smart contract, the higher the complexity of the smart contract. The more complex the smart contract required to call the business transaction and the larger the amount of contract input data, the more computing resources are required to put the contract call parameters of the business transaction on the chain. Based on this, the proxy service node also comprehensively considers the complexity of the contract and the amount of contract input data in the process of determining the lower limit of virtual resources. Specifically, the proxy service node extracts the contract call parameters for the business transaction from the on-chain proxy request, determines the complexity of the called contract in the contract call parameters, and the amount of contract input data determined by the requester. Then, based on the current transaction volume, complexity and data volume, the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain is determined.
[0096] In this embodiment, the complexity of the contract and the amount of contract input data are comprehensively considered in the process of determining the virtual resource lower limit, which can further ensure the accuracy of the virtual resource lower limit, and thus ensure that the chain request carrying the resource amount matching the virtual resource lower limit can be responded to in a timely manner.
[0097] In a specific implementation, based on the current transaction volume, complexity and data volume, the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain is determined, including: obtaining the weight coefficients of the current transaction volume, complexity and data volume; using each weight coefficient to perform a weighted sum of the current transaction volume, complexity and data volume to determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain.
[0098] Among them, the weight coefficient is used to characterize the contribution of the corresponding indicator to the consumption of resources on the chain. Specifically, the proxy service node can obtain the weight coefficients of the current transaction volume, complexity and data volume, and then use each weight coefficient to perform weighted summation on the current transaction volume, complexity and data volume to determine the lower limit of virtual resources consumed by putting the contract call parameters of the business transaction on the chain. It should be noted that since the units and orders of magnitude of the current transaction volume, complexity and data volume are not the same, weighted summation cannot be performed directly. Therefore, before performing the weighted summation, the current transaction volume, complexity and data volume can be standardized. The specific method for standardization is not unique, for example, it can be the range standardization method, the standard deviation standardization method, etc.
[0099] In this embodiment, a weighted sum is performed in combination with a weight coefficient to determine the lower limit of virtual resources consumed to put the contract call parameters of the business transaction on the chain. The algorithm is simple and is conducive to further saving computing resources and improving efficiency.
[0100] In some embodiments, the blockchain business processing method further includes: determining the available resource quota of the requester based on the remaining resource amount of the requester and the pending on-chain request associated with the requester. In the case of this embodiment, generating an on-chain request carrying contract call parameters and the resource amount matching the virtual resource lower limit includes: if the virtual resource lower limit is within the range of the available resource quota, generating an on-chain request carrying contract call parameters and the resource amount matching the virtual resource lower limit.
[0101] Among them, the pending on-chain request refers to the on-chain request generated based on the on-chain proxy request initiated by the requester and not responded by the on-chain processing node. For the same business request, the pending on-chain request refers to the on-chain request that is currently broadcast to the on-chain processing node but has not yet been responded to by the on-chain node. For the same requester, there may be multiple on-chain requests corresponding to each of the associated business requests. In the process of the proxy service node performing on-chain proxy, since the on-chain request is a transaction signed by the proxy service node, the proxy service node needs to advance the virtual resources represented by the amount of resources carried by the response on-chain request to the on-chain processing node that responds to the on-chain request. In order to ensure that the advanced virtual resources can be collected from the requester later, the proxy service node needs to determine the available resource quota of the requester before uploading the on-chain request.
[0102] Specifically, the proxy service node can determine the available resource quota of the requester based on the remaining resource amount of the requester and the pending on-chain requests associated with the requester. For example, the proxy service node can obtain the resource amount carried by each pending on-chain request associated with the requester, and subtract each resource amount from the remaining resource amount of the requester to obtain the available resource quota of the requester. For another example, the proxy service node can estimate the resource consumption upper limit of each pending on-chain request associated with the requester, and subtract each resource consumption upper limit from the remaining resource amount of the requester to obtain the available resource quota of the requester.
[0103] Then, the requester determines whether the virtual resource lower limit corresponding to the currently processed on-chain proxy request is within the range of the available resource quota. If the virtual resource lower limit is within the range of the available resource quota, an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit is generated; if the virtual resource lower limit is not within the range of the available resource quota, a feedback message of insufficient available resource quota is sent to the requester, and the processing of the on-chain proxy request is terminated. Among them, the virtual resource lower limit is within the range of the available resource quota, which may mean that the virtual resource lower limit is less than the available resource quota, or the virtual resource lower limit is less than or equal to the available resource quota.
[0104] In the above embodiment, the proxy service node determines the available resource quota of the requester, and generates a chain request when the lower limit of the virtual resources is within the range of the available resource quota. This can ensure that the virtual resources advanced by the proxy service node can be recovered and used to process subsequent chain proxy requests, which is conducive to improving the scientific nature of the blockchain business processing method.
[0105] In a specific embodiment, the available resource amount of the requester is determined based on the remaining resource amount of the requester and the pending uplink requests associated with the requester, including: obtaining the resource consumption upper limit of the pending uplink requests associated with the requester; based on the remaining resource amount of the requester and the resource consumption upper limit of the pending uplink requests, determining the available resource amount of the requester.
[0106] Among them, the resource consumption upper limit of the pending response on-chain request refers to the maximum value of the virtual resources required to chain the contract call parameters carried by the pending response on-chain request. The resource consumption upper limit can be determined by the requester based on its own remaining resources when initiating the on-chain proxy request, or it can be determined by the proxy service node. Take the case where the proxy service node determines the resource consumption upper limit as an example. The proxy service node can determine the maximum value of each resource consumption as the upper limit of the virtual resources required to chain the contract call parameters of the business transaction based on the transaction type of the business transaction associated with the pending response on-chain request and the resource consumption of each historical business transaction of the same type; it can also determine multiple historical business transactions with differences in the above-mentioned indicator values within the difference range based on at least one of the indicators such as the current transaction volume, the complexity of the called contract associated with the pending response on-chain request, and the data volume of the contract input data determined by the requester, and then determine the maximum value of each resource consumption of each historical business transaction as the upper limit of the virtual resources required to chain the contract call parameters of the business transaction.
[0107] Specifically, the proxy service node can determine the pending on-chain requests associated with the requester, and obtain the resource consumption upper limit of each pending on-chain request, and then determine the available resource quota of the requester based on the remaining resource amount of the requester and the resource consumption upper limit of each pending on-chain request. Exemplarily, the proxy service node can obtain the available resource quota of the requester by subtracting the resource consumption upper limits from the remaining resource amount of the requester. In one possible implementation, to further ensure that the available resource quota is sufficient, the proxy service node subtracts the resource consumption upper limits and the set quota from the remaining resource amount of the requester to obtain the available resource quota of the requester.
[0108] Furthermore, the proxy service node can also estimate the resource consumption upper limit of the currently processed on-chain proxy request. If the resource consumption upper limit of the on-chain proxy request is within the available resource quota of the requester, the amount corresponding to the resource consumption upper limit of the on-chain proxy request in the available resource quota is frozen. That is, the available resource quota of the requester after freezing is the difference between the available resource quota before freezing and the resource consumption upper limit of the on-chain proxy request. Then, the proxy service node generates an on-chain request carrying the contract call parameters and the amount of resources that matches the lower limit of the virtual resources. Among them, corresponding to a certain on-chain proxy request, the frozen amount refers to the dedicated amount of the on-chain proxy request. After the associated transaction of the on-chain proxy request is completed, the remaining part of the frozen amount can be released and become part of the available resource quota of the requester.
[0109] In this embodiment, the available resource quota of the requester is determined based on the resource consumption upper limit of the pending uplink request associated with the requester, so as to ensure the accuracy of the available resource quota.
[0110] In one embodiment, a blockchain business processing method includes: when a requesting party initiates a resource deposit request, extracting the virtual resources to be deposited carried in the resource deposit request; depositing the virtual resources to be deposited into the virtual resource account of the requesting party, and updating the remaining resource amount of the requesting party.
[0111] As mentioned above, if the lower limit of the virtual resource is not within the range of the available resource quota, the proxy service node sends a feedback message to the requester that the available resource quota is insufficient, and terminates the processing of the on-chain proxy request. In order to ensure the smooth progress of business processing, a virtual resource deposit service is also required. In this embodiment, the proxy service node manages the virtual resource accounts of each node on the blockchain system and handles the deposit, transfer, query and withdrawal of virtual resources.
[0112] Specifically, the requester can initiate a resource deposit request to the proxy service node, and the proxy service node responds to the resource deposit request, extracts the virtual resources to be deposited from the resource deposit request, and deposits the virtual resources to be deposited into the virtual resource account of the requester, and adds the resource amount of the virtual resources that have been deposited on the basis of the current remaining resource amount of the requester to update the remaining resource amount of the requester. Furthermore, the requester can also initiate a resource query request to the proxy service node, and the proxy service node responds to the resource query request, queries and feeds back the current remaining resource amount of the requester to the requester, so that the requester can understand its own remaining resource amount and deposit virtual resources in time when the remaining resource amount is insufficient.
[0113] In a specific implementation, the virtual resource deposit function can be implemented by a proxy contract deployed in the proxy service node. Specifically, Figure 5As shown, the requester can call the virtual resource deposit interface of the proxy contract and deposit the virtual resources into the address of the proxy contract to initiate a resource deposit request to the proxy service node. The virtual resources deposited in the proxy contract are the virtual resources to be deposited that the requester requests to deposit into its own virtual resource account. The proxy service node can monitor the resource quantity data of the proxy contract in real time, and obtain the resource deposit request when the resource quantity data changes. Then, in response to the resource deposit request, the requester address and the resource quantity of the virtual resources to be deposited are obtained, the virtual resources to be deposited are deposited into the virtual resource account of the requester, and the remaining resource quantity of the requester is updated. Among them, the requester address can be used as the unique identifier of the requester, and the virtual resource account of the requester is associated with the requester address.
[0114] In the above embodiment, when the requesting party initiates a resource deposit request, the virtual resources to be deposited carried in the resource deposit request are extracted, the virtual resources to be deposited are deposited into the virtual resource account of the requesting party, and the remaining resource amount of the requesting party is updated. This can support the virtual resource deposit service initiated by the requesting party, which is equivalent to using dedicated computing resources to centrally manage each virtual resource account. Compared with the decentralized processing method, it can further save the computing resources consumed by business processing.
[0115] In one embodiment, the process of updating the uplink request includes: extracting the uplink mode parameter from the uplink proxy request; determining the resource increment that matches the uplink urgency based on the uplink urgency represented by the uplink mode parameter; and superimposing the resource increment on the resource amount carried by the uplink request to obtain an updated uplink request.
[0116] Among them, the resource increment is positively correlated with the urgency of chaining. For the specific definition of positive correlation, please refer to the above, which will not be repeated here. The urgency of chaining refers to the urgency of the requester for the transaction chaining, which can be characterized by the expected chaining time determined by the requester. The expected chaining time can refer to the expected time point for realizing the chaining of business transactions, or it can refer to the expected time spent from initiating the chaining proxy request for the business transaction to the chaining of the business transaction. It can be understood that the shorter the time interval between the expected time point and the current moment, or the shorter the expected time, the higher the urgency of the requester to chain, and the more it is hoped that the business transaction can be chained as soon as possible; conversely, the longer the time interval between the expected time point and the current moment, or the shorter the expected time, the lower the urgency of the requester to chain, and the lower the requirement for chaining time. Further, there can be two or more levels of chaining urgency, such as "very urgent", "generally urgent" and "not urgent", and "very urgent" and "not urgent", which are not limited here.
[0117] Specifically, Figure 6As shown, the proxy service node can extract the chain mode parameter representing the chain urgency from the chain proxy request, and determine the resource increment matching the chain urgency based on the chain urgency represented by the chain mode parameter, and then superimpose the resource increment on the resource amount carried by the chain request to obtain an updated chain request. Exemplarily, the proxy service node can pre-establish the corresponding relationship between the chain mode parameter and the resource increment, and then determine the resource increment matching the chain urgency based on the extracted chain mode parameter and the corresponding relationship between the chain mode parameter and the resource increment. The resource increment can be a fixed value or a non-fixed value associated with the remaining resource amount of the requester. For example, when the chain urgency represented by the chain mode parameter is very urgent, 1 / 10 of the remaining resource amount of the requester can be used as the resource increment, and when the chain urgency represented by the chain mode parameter is not urgent, 1 / 20 of the remaining resource amount of the requester can be used as the resource increment.
[0118] It can be understood that when the urgency of chaining represented by the chaining mode parameters is not urgent, the proxy service node can help the requester save virtual resources by reducing the resource increment. In a specific implementation, the chaining mode parameters determined by the requester include "chaining as soon as possible" and "saving virtual resources". In the case where the requester chooses to chain as soon as possible, it means that the urgency of the requester to chain is high, and the proxy service node can determine a relatively large resource increment to ensure that the broadcast chaining request is responded to by the chain processing node as soon as possible. In the case where the requester chooses to save virtual resources, it means that the urgency of the requester to chain is not high, and the proxy service node can determine a relatively small resource increment to minimize the amount of resources carried by the responded chaining request.
[0119] Further, the proxy service node can also adjust the set waiting time after broadcasting the uplink request based on the uplink urgency represented by the uplink mode parameter. Specifically, contrary to the resource increment, the set waiting time is anti-correlated with the uplink urgency. Anti-correlation means that when other conditions remain unchanged, the two variables change in opposite directions, and when one variable changes from large to small, the other variable changes from small to large. As mentioned above, after broadcasting the uplink request, the proxy service node needs to wait for the response of the uplink processing node. If there is no uplink processing node that responds to the uplink request after setting the waiting time, the proxy service node determines that the uplink request meets the update condition, increases the amount of resources carried in the uplink request, updates the uplink request and broadcasts it, and enters the next round of waiting. It can be understood that the shorter the waiting time is set, the faster the amount of resources carried in the broadcasted uplink request increases, and the higher the probability of being responded to by the uplink processing node; the longer the waiting time is set, the slower the amount of resources carried in the broadcasted uplink request increases, and the amount of resources carried by the responded uplink request can be minimized.
[0120] In the above embodiment, based on the urgency of chain-up represented by the chain-up mode parameters, the resource increment matching the urgency of chain-up is determined, which can ensure that the broadcast chain-up request can match the actual needs of the requesting party, thereby expanding the application scenarios of the blockchain business processing method and improving the flexibility of the blockchain business processing method.
[0121] In one embodiment, the blockchain business processing method further includes: determining the consumed resources of the business transaction; and receiving the virtual resources transferred from the virtual resource account of the requester when the business transaction is implemented.
[0122] Among them, the consumed resources include the proxy consumed resources of the on-chain proxy request and the on-chain consumed resources of the contract call parameters. The resource amount of the virtual resources corresponds to the resource amount of the consumed resources. It can be understood that in the process of the proxy service node performing on-chain proxy, on the one hand, it needs to consume its own computing resources, and on the other hand, it needs to advance the virtual resources represented by the resource amount carried by the on-chain request to the on-chain processing node. In order to ensure that the proxy service node can continue to provide proxy services, it is necessary to charge the corresponding virtual resources to the requester. Specifically, the proxy service node determines the consumed resources of the business transaction, and when the business transaction is realized, receives the virtual resources corresponding to the consumed resources transferred from the virtual resource account of the requester. In a specific implementation, the proxy service node can transfer the virtual resources paid to the on-chain processing node during the business on-chain process and the proxy consumed resources corresponding to the computing resources consumed during the on-chain proxy process from the virtual resource account of the requester to the virtual resource account of the proxy service node after calling the smart contract to realize the business transaction. The proxy consumed resources can be used as the proxy service fee charged by the proxy service node to the requester.
[0123] In the above embodiment, when the business transaction is realized, receiving the virtual resources corresponding to the consumed resources transferred from the virtual resource account of the requester can ensure that the proxy service node can continue to provide proxy services, which is conducive to improving the scientific nature of the blockchain business processing method.
[0124] In some embodiments, the blockchain business processing method provided by the present application can be applied to the application scenario of data on-chain storage. In this scenario, the proxy service node obtains the on-chain proxy request initiated by the requester for the data storage transaction. The on-chain proxy request carries the contract call parameters for the smart contract deployed on the blockchain, and the contract call parameters include the contract address of the called smart contract, and the data to be stored. Then, the proxy service node determines the virtual resource lower limit required to chain the contract call parameters, generates a chain request carrying the contract call parameters and the amount of resources matching the virtual resource lower limit, and broadcasts the chain request to the chain processing node of the blockchain system. Next, the proxy service node waits for the response of the chain processing node. In the absence of a chain processing node that responds to the on-chain request, the proxy service node updates the chain request and broadcasts it until the broadcast chain request is responded to by the chain processing node. Among them, the amount of resources carried in each broadcast chain request increases in a gradient order according to the broadcast time. Finally, the proxy service node transfers the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and calls the smart contract to implement the data storage transaction to complete the on-chain storage of the data.
[0125] In some embodiments, the blockchain business processing method provided by the present application can be applied to the application scenario of data chain authentication. In this scenario, the proxy service node obtains the chain proxy request initiated by the requester for data authentication. The chain proxy request carries the contract call parameters for the smart contract deployed on the blockchain, and the contract call parameters include the contract address of the called smart contract, and the data to be authenticated. Then, the proxy service node determines the lower limit of the virtual resources required to chain the contract call parameters, generates a chain request carrying the contract call parameters and the amount of resources matching the lower limit of the virtual resources, and broadcasts the chain request to the chain processing node of the blockchain system. Next, the proxy service node waits for the response of the chain processing node. In the absence of a chain processing node that responds to the chain request, the proxy service node updates the chain request and broadcasts it until the broadcast chain request is responded to by the chain processing node. Among them, the amount of resources carried in each broadcast chain request increases in a gradient order according to the broadcast time. Finally, the proxy service node transfers the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and calls the smart contract to implement the data authentication transaction to complete the on-chain authentication of the data.
[0126] In a specific embodiment, Figure 7 As shown, the blockchain business processing method includes the following steps:
[0127] Step S701, obtaining a chain proxy request for a business transaction initiated by a requester;
[0128] Among them, business transactions include transactions that need to be implemented by calling smart contracts deployed by the blockchain system;
[0129] Step S702, extracting the contract call parameters for the business transaction from the on-chain proxy request;
[0130] Step S703, obtaining the current transaction volume of the blockchain system, and determining the complexity of the called contract in the contract call parameters, and the data volume of the contract input data determined by the requester;
[0131] Step S704, obtaining the weight coefficients of the current transaction volume, complexity and data volume;
[0132] Step S705: Use various weight coefficients to perform weighted summation on the current transaction volume, complexity, and data volume to determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain;
[0133] Step S706, obtaining the resource consumption upper limit of the pending uplink request associated with the requester;
[0134] Among them, the pending uplink request refers to the uplink request generated based on the uplink proxy request initiated by the requester and not responded by the uplink processing node; for the same service request, the pending uplink request refers to the uplink request currently broadcasted to the uplink processing node but not yet responded by the uplink node;
[0135] Step S707, determining the available resource quota of the requester based on the remaining resource amount of the requester and the upper limit of resource consumption of the on-chain request to be responded to;
[0136] Step S708: If the virtual resource lower limit is within the range of the available resource quota, a chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit is generated, and the chain request is broadcast to the chain processing node of the blockchain system;
[0137] Step S709, when the uplink request meets the update condition, based on the uplink urgency represented by the uplink mode parameter extracted from the uplink proxy request, determine the resource increment that matches the uplink urgency;
[0138] The on-chain request satisfies the update condition, which means that there is no on-chain processing node that responds to the on-chain request;
[0139] Step S710, adding the resource amount carried by the uplink request to the resource increment, obtaining an updated uplink request and broadcasting it until the broadcasted uplink request is responded to by the uplink processing node;
[0140] The amount of resources carried in each on-chain request broadcasted increases in order of broadcast time; the resource increment is positively correlated with the urgency of on-chaining; in the process of responding to the on-chain request, the on-chain processing node packages the contract call parameters carried in the on-chain request into a block to realize the transaction on-chain;
[0141] Step S711, transferring the virtual resources represented by the resource quantity carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and calling the smart contract to implement the business transaction;
[0142] Step S712, determining the consumed resources of the business transaction;
[0143] Among them, the consumed resources include the proxy consumed resources of the on-chain proxy request and the on-chain consumed resources of the contract call parameters;
[0144] Step S713: When the business transaction is realized, receiving the virtual resources corresponding to the consumed resources transferred from the virtual resource account of the requesting party.
[0145] The above-mentioned blockchain business processing method, on the one hand, determines the lower limit of virtual resources required to put the transaction on the chain based on the contract call parameters of the business transaction, generates and broadcasts a chain request carrying the resource amount matching the virtual resource lower limit, and when the chain request meets the update conditions, the resource amount is increased by gradient until the broadcasted chain request is responded to by the chain processing node, and the virtual resources represented by the resource amount carried by the responded chain request are transferred to the chain processing node that responds to the chain request, which can motivate the chain processing node to consume its own computing resources to respond to the chain request and ensure that the transaction is on the chain. On the other hand, the chain proxy request initiated by the requester for the business transaction is obtained, and the chain request is generated and broadcast based on the contract call parameters of the business transaction. When the broadcasted chain request is responded to by the chain processing node, the smart contract is called to implement the business transaction, which is equivalent to using a centralized processing method, using dedicated computing resources to initiate a chain request, and calling a smart contract to implement the business transaction. Compared with the decentralized processing method, it can save the computing resources consumed by business processing to a certain extent. Therefore, the above method can save the computing resources consumed by business processing on the basis of ensuring the transaction on the chain.
[0146] The following is a detailed introduction to the blockchain business processing method with reference to the accompanying drawings.
[0147] In one embodiment, the proxy service node provides the requester with an on-chain proxy service through a proxy contract and manages the virtual resource accounts of each node in the blockchain system. The virtual resource account includes the virtual resource account of the requester. The proxy contract is essentially a smart contract deployed on the blockchain system. In order to distinguish it from the smart contract that needs to be called to implement business transactions, in this embodiment, the smart contract that needs to be called to implement business transactions is called the target contract. Specifically, Figure 5 As shown, the requester does not need to care about the amount of virtual resources consumed by the chain. It only needs to call the virtual resource deposit interface of the proxy contract before initiating the chain proxy request, and deposit the virtual resources into the address of the proxy contract to initiate a resource deposit request to the proxy service node. The virtual resources deposited in the proxy contract are the virtual resources to be deposited that the requester requests to deposit into its own virtual resource account. The proxy service node can monitor the resource quantity data of the proxy contract in real time, and obtain the resource deposit request when the resource quantity data changes. Then, in response to the resource deposit request, the requester address and the resource quantity of the virtual resources to be deposited are obtained, the virtual resources to be deposited are deposited into the virtual resource account of the requester, and the remaining resource quantity of the requester is updated. Among them, the requester address can be used as the unique identifier of the requester, and the virtual resource account of the requester is associated with the requester address.
[0148] When the requester needs to implement a business transaction by calling the target contract deployed by the blockchain system, the requester initiates an on-chain proxy request for the business transaction to the proxy service node. The on-chain proxy request carries the contract call parameters signed by the requester and the on-chain mode parameters determined by the requester. The contract call parameters may include the contract address of the target contract and the contract input data determined by the requester. The contract input data may include the input data passed to a function in the target contract, that is, the contract call parameters may also include the function name and function input data.
[0149] like Figure 8As shown, after the proxy service node obtains the on-chain proxy request, it first verifies the signature of the requester, and determines the available resource quota of the requester based on the remaining resource amount of the requester and the upper limit of resource consumption of the on-chain request to be responded to by the requester. Then, the upper limit and lower limit of resource consumption of the on-chain proxy request are estimated. If the upper limit of resource consumption of the on-chain proxy request is within the available resource quota of the requester, the quota corresponding to the upper limit of resource consumption of the on-chain proxy request in the available resource quota is frozen, and an on-chain request carrying contract call parameters and the amount of resources matching the lower limit of virtual resources is generated. That is, the available resource quota of the requester after freezing is the difference between the available resource quota before freezing and the upper limit of resource consumption of the on-chain proxy request. If the upper limit of resource consumption of the on-chain proxy request exceeds the available resource quota range of the requester, the proxy service node sends feedback information of insufficient available resource quota to the requester and terminates the processing of the on-chain proxy request. Among them, the lower limit of resource consumption can be determined according to the current transaction volume of the blockchain network, and the virtual resource lower limit is positively correlated with the current transaction volume.
[0150] Next, the proxy service node broadcasts the generated on-chain request to the on-chain proxy node in the blockchain network, and monitors whether the broadcast on-chain request is responded. The on-chain proxy node can be, for example, a bookkeeping node. If there is an on-chain processing node that responds to the on-chain request, the on-chain processing node performs on-chain processing, packages the relevant data of the business transaction targeted by the on-chain request, and generates the current block to be on-chain for storing the packaged data. Then, the on-chain processing node can broadcast the current block to the blockchain network, and the consensus node in the blockchain network performs consensus authentication on it, and after the authentication is passed, the current block is connected to the blockchain, thereby completing the on-chain of the business transaction. The relevant data includes contract call parameters, signature information, etc. After setting the waiting time, if there is no on-chain processing node that responds to the on-chain request, the proxy service node determines that the on-chain request meets the update conditions, increases the amount of resources carried in the on-chain request, updates the on-chain request and broadcasts it, and enters the next round of waiting. And so on, until the broadcast on-chain request is responded to by the on-chain processing node. The set waiting time can be specified by the requester or determined by the proxy service node based on the requester's urgency to go online. The higher the urgency of going online, the more likely the requester wants to go online as soon as possible, and the set waiting time can be shortened appropriately. After the business transaction is on-chain, the proxy service node needs to transfer the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, that is, the proxy service node needs to advance the virtual resources consumed by the on-chain to the on-chain processing node that responds to the on-chain request.
[0151] Furthermore, in the process of updating the on-chain request, the proxy service node also extracts the on-chain mode parameter from the on-chain proxy request, determines the resource increment that matches the on-chain urgency based on the on-chain urgency represented by the on-chain mode parameter, and then superimposes the resource increment on the resource amount carried by the on-chain request to obtain an updated on-chain request. On-chain urgency refers to the urgency of the requester for the transaction to be on-chain, which can be represented by the expected on-chain time determined by the requester. The expected on-chain time can refer to the expected time point for realizing the on-chain of the business transaction, or it can refer to the expected time spent from initiating the on-chain proxy request for the business transaction to the on-chain of the business transaction. It can be understood that the shorter the time interval between the expected time point and the current moment, or the shorter the expected time, means that the requester's on-chain urgency is higher, and the more it is hoped that the business transaction can be on-chain as soon as possible; conversely, the longer the time interval between the expected time point and the current moment, or the shorter the expected time, means that the requester's on-chain urgency is lower, and the requirement for on-chain time is lower. In a specific implementation, the link-up mode parameters determined by the requester include "link-up as soon as possible" and "save virtual resources". In the case where the requester chooses to link-up as soon as possible, it means that the requester has a high degree of urgency in linking up, and the proxy service node can determine a relatively large resource increment to ensure that the broadcast link-up request is responded to by the link-up processing node as soon as possible. In the case where the requester chooses to save virtual resources, it means that the requester has a low degree of urgency in linking up, and the proxy service node can determine a relatively small resource increment to minimize the amount of resources carried by the responded link-up request.
[0152] In addition, the transaction serial numbers of the on-chain requests before and after the update are the same. In this way, for multiple on-chain requests corresponding to the same transaction serial number, the on-chain processing node can process the on-chain request with the largest amount of resources, and invalidate the remaining unresponded on-chain requests, so as to avoid repeated responses to on-chain requests for the same business transaction.
[0153] The contract call parameters of the business transaction can only be executed after being packaged and uploaded to the chain. Specifically, the proxy service node can call the target contract through the proxy contract to implement the business transaction requested by the requester. In other words, the proxy service node can manage the virtual resource account and call the target contract through the proxy contract. Among them, the blockchain system supports smart contracts calling smart contracts. Specifically, a business can be composed of multiple smart contracts, similar to a service that can be divided into multiple sub-services, and sub-services can call sub-services, such as an access service can call an evidence service. In this embodiment, the smart contract that initiates the call is called a proxy contract, and the contract called by the smart contract is called a target contract. Fig. 9As shown, the proxy service node can check whether the contract call parameters are correct by calling the proxy execution interface of the proxy contract, verify the contract call parameters, and check again whether the remaining resource quota of the requester is sufficient. It can be understood that the remaining resource quota can include the frozen quota for the currently processed business transaction and the available resource quota, so that the actual resource consumption required is greater than the estimated resource consumption upper limit. Then, when the contract call parameters are correct and the remaining resource quota is sufficient, the target contract is called based on the contract call parameters to realize the business transaction. Finally, when the business transaction is realized, the proxy service node receives the virtual resources corresponding to the consumption resources of the business transaction transferred from the virtual resource account of the requester. The consumption resources include the proxy consumption resources requested by the on-chain proxy and the on-chain consumption resources of the contract call parameters. The on-chain consumption resources are the virtual resources that the proxy service node advances to the on-chain processing node. In the above processing process, the processing logic of the contract is fixed and publicly visible, and cannot be tampered with, which can ensure the security of the business processing process.
[0154] Furthermore, during the business processing, the proxy service node and the requester can synchronize the business processing progress through interaction, and the specific method of interaction is not limited here. For example, after the business transaction is completed, the proxy service node can send a prompt message of the transaction completion to the requester; for another example, during the business processing, the requester can also actively send a query request for the business processing status to the proxy service node.
[0155] The above-mentioned blockchain business processing method, on the one hand, determines the lower limit of virtual resources required to put the transaction on the chain based on the contract call parameters of the business transaction, generates and broadcasts a chain request carrying the resource amount matching the virtual resource lower limit, and when the chain request meets the update conditions, the resource amount is increased by gradient until the broadcasted chain request is responded to by the chain processing node, and the virtual resources represented by the resource amount carried by the responded chain request are transferred to the chain processing node that responds to the chain request, which can motivate the chain processing node to consume its own computing resources to respond to the chain request and ensure that the transaction is on the chain. On the other hand, the chain proxy service provided by the proxy service node is equivalent to using a centralized processing method, using dedicated computing resources to initiate chain requests, and calling smart contracts that implement business transactions. Compared with the decentralized processing method, it can save the computing resources consumed by business processing to a certain extent. Therefore, the above method can save the computing resources consumed by business processing on the basis of ensuring that the transaction is on the chain.
[0156] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0157] Based on the same inventive concept, the embodiment of the present application also provides a blockchain business processing system for implementing the blockchain business processing method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more blockchain business processing system embodiments provided below can refer to the limitations of the blockchain business processing method above, and will not be repeated here.
[0158] In some embodiments, Fig.10 As shown, a blockchain business processing system 1000 is provided, including a requester 1001, a proxy service node 1002 and an on-chain processing node 1003. The requester 1001 is used to initiate an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system. The proxy service node 1002 is used to obtain the on-chain proxy request initiated by the requester 1001, determine the lower limit of virtual resources consumed by on-chaining the contract call parameters of the business transaction, generate an on-chain request carrying the contract call parameters and the amount of resources matching the lower limit of the virtual resources, and broadcast the on-chain request to the on-chain processing node 1003 of the blockchain system; it is also used to update the on-chain request and broadcast it when the on-chain request meets the update condition until the broadcast on-chain request is responded by the on-chain processing node; the amount of resources carried in each broadcast on-chain request increases gradually in the order of broadcast time. The on-chain processing node 1003 is used to respond to the on-chain request and process the contract call parameters on-chain. The proxy service node 1002 is also used to transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
[0159] In some embodiments, the proxy service node 1002 is specifically used to: obtain the current transaction volume of the blockchain system; based on the current transaction volume, determine the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain; the lower limit of virtual resources is positively correlated with the current transaction volume.
[0160] In some embodiments, the proxy service node 1002 is also used to: extract the contract call parameters for the business transaction from the on-chain proxy request; determine the complexity of the called contract in the contract call parameters, and the data volume of the contract input data determined by the requester. In the case of this embodiment, the proxy service node 1002 determines the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain based on the current transaction volume, including: determining the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain based on the current transaction volume, complexity and data volume; the virtual resource lower limit is also positively correlated with the complexity and data volume.
[0161] In some embodiments, the proxy service node 1002 is specifically used to: obtain the respective weight coefficients of the current transaction volume, complexity, and data volume; use the various weight coefficients to perform weighted summation on the current transaction volume, complexity, and data volume to determine the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain.
[0162] In some embodiments, the proxy service node 1002 is also used to determine the available resource quota of the requester based on the remaining resource amount of the requester and the pending on-chain request associated with the requester. In the case of this embodiment, the proxy service node 1002 is specifically used to generate an on-chain request carrying contract call parameters and the resource amount matching the virtual resource lower limit if the virtual resource lower limit is within the range of the available resource quota. Among them, the pending on-chain request refers to an on-chain request generated based on the on-chain proxy request initiated by the requester and not responded to by the on-chain processing node.
[0163] In some embodiments, the proxy service node 1002 is specifically used to: obtain the resource consumption upper limit of the pending uplink request associated with the requester; and determine the available resource amount of the requester based on the remaining resource amount of the requester and the resource consumption upper limit of the pending uplink request.
[0164] In some embodiments, the proxy service node 1002 is further used to: when the requester initiates a resource deposit request, extract the virtual resources to be deposited carried in the resource deposit request; deposit the virtual resources to be deposited into the virtual resource account of the requester, and update the remaining resource amount of the requester.
[0165] In some embodiments, the process of the proxy service node 1002 updating the uplink request includes: extracting the uplink mode parameter from the uplink proxy request; determining the resource increment that matches the uplink urgency based on the uplink urgency represented by the uplink mode parameter; and adding the resource amount carried by the uplink request to the resource increment to obtain an updated uplink request. The resource increment is positively correlated with the uplink urgency.
[0166] In some embodiments, the proxy service node 1002 is further used to: determine the consumed resources of the business transaction; and when the business transaction is implemented, receive the virtual resources corresponding to the consumed resources transferred from the virtual resource account of the requester. The consumed resources include the proxy consumed resources of the on-chain proxy request and the on-chain consumed resources of the contract call parameters.
[0167] In the above blockchain business processing system, on the one hand, the proxy service node 1002 determines the lower limit of virtual resources required to put the transaction on the chain based on the contract call parameters of the business transaction, generates and broadcasts a chain request carrying the resource amount matching the lower limit of the virtual resources, and when the chain request meets the update conditions, the resource amount is increased by gradient until the broadcasted chain request is responded to by the chain processing node, and the virtual resources represented by the resource amount carried by the responded chain request are transferred to the chain processing node that responds to the chain request, which can motivate the chain processing node to consume its own computing resources to respond to the chain request and ensure that the transaction is on the chain. On the other hand, the proxy service node is configured to provide the requester with a chain proxy service, specifically obtain the chain proxy request initiated by the requester for the business transaction, generate and broadcast the chain request based on the contract call parameters of the business transaction, and when the broadcasted chain request is responded to by the chain processing node, call the smart contract to implement the business transaction, which is equivalent to using a centralized processing method, using dedicated computing resources to initiate a chain request, and calling a smart contract to implement the business transaction. Compared with the decentralized processing method, it can save computing resources consumed by business processing to a certain extent. Therefore, by adopting the above method, it is possible to save computing resources consumed in business processing while ensuring that transactions are put on the chain.
[0168] In some embodiments, the updated on-chain request is consistent with the transaction sequence number of the on-chain request. In the case of this embodiment, the on-chain processing node 1003 is also used to determine the associated on-chain request that is consistent with the transaction sequence number of the responded on-chain request, and invalidate the associated on-chain request.
[0169] The transaction sequence number is used to characterize the business transaction associated with the on-chain request. That is, the transaction sequence numbers of multiple on-chain requests for the same business transaction are the same. The transaction sequence number can be represented by a Nonce value. Nonce is the abbreviation of Numberonce. In cryptography, Nonce is an arbitrary or non-repeating random value that is used only once. In the blockchain system, if the Nonce values of two transactions are the same, only one transaction can be successfully packaged.
[0170] Specifically, for multiple on-chain requests corresponding to the same transaction sequence number, the on-chain processing node 1003 can perform on-chain processing on the on-chain request carrying the largest amount of resources, and invalidate the remaining unresponded on-chain requests, that is, discard the remaining unresponded associated on-chain requests to avoid repeated responses to on-chain requests for the same business transaction.
[0171] In this embodiment, the on-chain processing node 1003 is also used to determine the associated on-chain request that is consistent with the transaction sequence number of the responded on-chain request, and to invalidate the associated on-chain request, thereby avoiding repeated responses to on-chain requests for the same business transaction, which is conducive to improving the scientific nature of the blockchain business processing method.
[0172] Based on the same inventive concept, the embodiment of the present application also provides a blockchain business processing device for implementing the blockchain business processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more blockchain business processing device embodiments provided below can refer to the limitations of the blockchain business processing method above, and will not be repeated here.
[0173] In some embodiments, Fig.11 As shown, a blockchain business processing device 1100 is provided, including: an on-chain proxy request acquisition module 1102, a virtual resource lower limit determination module 1104, an on-chain request generation module 1106, an on-chain request update module 1108 and a contract calling module 1110, wherein:
[0174] The on-chain proxy request acquisition module 1102 is used to obtain an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system;
[0175] A virtual resource lower limit determination module 1104 is used to determine the virtual resource lower limit required to upload the contract call parameters of the business transaction to the chain;
[0176] The on-chain request generation module 1106 is used to generate an on-chain request carrying contract call parameters and a resource amount matching the lower limit of the virtual resource, and broadcast the on-chain request to the on-chain processing node of the blockchain system;
[0177] The uplink request update module 1108 is used to update the uplink request and broadcast it when the uplink request meets the update condition, until the broadcasted uplink request is responded by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence;
[0178] The contract calling module 1110 is used to transfer the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to realize the business transaction.
[0179] In some embodiments, the virtual resource lower limit determination module 1104 includes: a transaction volume acquisition unit, used to obtain the current transaction volume of the blockchain system; a virtual resource lower limit determination unit, used to determine the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain based on the current transaction volume; the virtual resource lower limit is positively correlated with the current transaction volume.
[0180] In some embodiments, the blockchain business processing device 1100 also includes a parameter extraction module, which is used to: extract the contract call parameters for the business transaction from the on-chain proxy request; determine the complexity of the called contract in the contract call parameters and the amount of contract input data, and the contract input data is determined by the requester who initiates the on-chain proxy request. In the case of this embodiment, the virtual resource lower limit determination unit is specifically used to: determine the lower limit of virtual resources required to chain the contract call parameters of the business transaction based on the current transaction volume, complexity and data volume; the virtual resource lower limit is also positively correlated with the complexity and data volume.
[0181] In some embodiments, the virtual resource lower limit determination unit is specifically used to: obtain the weight coefficients of the current transaction volume, complexity, and data volume; use the weight coefficients to perform weighted summation on the current transaction volume, complexity, and data volume to determine the lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain.
[0182] In some embodiments, the on-chain proxy request is initiated by the requester. In the case of this embodiment, the blockchain business processing device 1100 also includes: an available resource quota determination module, which is used to determine the available resource quota of the requester based on the remaining resource amount of the requester and the pending on-chain request associated with the requester. In the case of this embodiment, the on-chain request generation module 1106 is specifically used to: if the virtual resource lower limit is within the range of the available resource quota, then generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit. Among them, the pending on-chain request refers to an on-chain request generated based on the on-chain proxy request initiated by the requester and not responded to by the on-chain processing node.
[0183] In some embodiments, the available resource quota determination module is specifically used to: obtain the resource consumption upper limit of the pending response uplink request associated with the requester; and determine the available resource quota of the requester based on the remaining resources of the requester and the resource consumption upper limit of the pending response uplink request.
[0184] In some embodiments, the blockchain business processing device 1100 also includes a remaining resource amount update module, which is used to: when the requesting party initiates a resource deposit request, extract the virtual resources to be deposited carried in the resource deposit request; deposit the virtual resources to be deposited into the virtual resource account of the requesting party, and update the remaining resource amount of the requesting party.
[0185] In some embodiments, the uplink request update module 1108 is specifically used to: extract the uplink mode parameter from the uplink proxy request; determine the resource increment that matches the uplink urgency based on the uplink urgency represented by the uplink mode parameter; and add the resource amount carried by the uplink request to the resource increment to obtain an updated uplink request. The resource increment is positively correlated with the uplink urgency.
[0186] In some embodiments, the blockchain business processing device 1100 further includes a resource receiving module, which is used to: determine the consumed resources of the business transaction; and when the business transaction is implemented, receive the virtual resources transferred from the virtual resource account of the requesting party. The consumed resources include the proxy consumed resources of the on-chain proxy request and the on-chain consumed resources of the contract call parameters; the resource amount of the virtual resources corresponds to the resource amount of the consumed resources.
[0187] Each module in the above-mentioned blockchain business processing device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0188] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the blockchain business processing method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a blockchain business processing method is implemented.
[0189] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless method can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a blockchain business processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0190] Those skilled in the art will understand that Fig.12 and Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0191] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned blockchain business processing method are implemented.
[0192] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned blockchain business processing method are implemented.
[0193] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above-mentioned blockchain business processing method when executed by a processor.
[0194] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0195] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0196] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0197] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A blockchain business processing method, characterized in that: The method comprises: Obtaining an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by a blockchain system; Determine the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain; Generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system; If the uplink request meets the update condition, update the uplink request and broadcast it until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence; Transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
2. The method according to claim 1, characterized in that The determining of the lower limit of virtual resources consumed by uploading the contract call parameters of the business transaction to the chain includes: Obtaining the current transaction volume of the blockchain system; Based on the current transaction volume, determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain; the lower limit of virtual resources is positively correlated with the current transaction volume.
3. The method according to claim 2, characterized in that The method further comprises: Extracting contract call parameters for the business transaction from the on-chain proxy request; Determine the complexity of the called contract in the contract call parameters and the amount of contract input data; the contract input data is determined by the requester who initiates the on-chain proxy request; The determining, based on the current transaction volume, a lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain includes: Based on the current transaction volume, the complexity and the data volume, the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain is determined; the lower limit of virtual resources is also positively correlated with the complexity and the data volume.
4. The method according to claim 3, characterized in that The determining, based on the current transaction volume, the complexity, and the data volume, a lower limit of virtual resources required to upload the contract call parameters of the business transaction to the chain includes: Obtaining respective weight coefficients of the current transaction volume, the complexity, and the data volume; Using each of the weight coefficients, a weighted sum is taken of the current transaction volume, the complexity, and the data volume to determine the lower limit of virtual resources required to put the contract call parameters of the business transaction on the chain.
5. The method according to claim 1, characterized in that The uplink proxy request is initiated by the requester; the method further includes: Determine the available resource quota of the requester based on the remaining resource amount of the requester and the pending uplink request associated with the requester; the pending uplink request refers to an uplink request generated based on the uplink proxy request initiated by the requester and not responded by the uplink processing node; The generating a chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit includes: If the virtual resource lower limit is within the range of the available resource amount, an on-chain request is generated that carries the contract call parameters and the resource quantity that matches the virtual resource lower limit.
6. The method according to claim 5, characterized in that The determining, based on the remaining amount of resources of the requesting party and the pending uplink requests associated with the requesting party, the available resource amount of the requesting party includes: Obtaining the resource consumption upper limit of the pending on-chain request associated with the requester; Based on the remaining resources of the requester and the upper limit of resource consumption of the uplink request to be responded to, the available resource quota of the requester is determined.
7. The method according to claim 5, characterized in that The method further comprises: In the case where the requesting party initiates a resource deposit request, extracting the virtual resources to be deposited carried in the resource deposit request; The virtual resources to be deposited are deposited into the virtual resource account of the requesting party, and the remaining resource amount of the requesting party is updated.
8. The method according to claim 1, characterized in that The process of updating the on-chain request includes: Extracting an uplink mode parameter from the uplink proxy request; Based on the link-up urgency represented by the link-up mode parameter, determining a resource increment that matches the link-up urgency; the resource increment is positively correlated with the link-up urgency; The resource amount carried by the uplink request is added to the resource increment to obtain an updated uplink request.
9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: Determine the consumed resources of the business transaction; the consumed resources include the proxy consumed resources of the on-chain proxy request and the on-chain consumed resources of the contract call parameters; In the case where the business transaction is realized, receiving virtual resources transferred from the virtual resource account of the requesting party; the resource amount of the virtual resources corresponds to the resource amount of the consumed resources.
10. A blockchain business processing system, characterized in that: Includes requester, proxy service node and on-chain processing node; The requester is used to initiate an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system; The proxy service node is used to obtain the on-chain proxy request, determine the lower limit of virtual resources consumed by on-chaining the contract call parameters of the business transaction, generate an on-chain request carrying the contract call parameters and the amount of resources matching the lower limit of virtual resources, and broadcast the on-chain request to the on-chain processing node of the blockchain system; and is also used to update the on-chain request and broadcast it when the on-chain request meets the update condition until the broadcasted on-chain request is responded to by the on-chain processing node; The amount of resources carried in each broadcast uplink request increases gradually in the order of broadcast time; The on-chain processing node is used to respond to the on-chain request and perform on-chain processing on the contract call parameters; The proxy service node is also used to transfer the virtual resources represented by the amount of resources carried in the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
11. The system according to claim 10, characterized in that The updated on-chain request is consistent with the transaction sequence number of the on-chain request; The on-chain processing node is also used to determine an associated on-chain request that is consistent with the transaction sequence number of the responded on-chain request, and to invalidate the associated on-chain request.
12. A blockchain business processing device, characterized in that: The device comprises: An on-chain proxy request acquisition module is used to obtain an on-chain proxy request for a business transaction; the business transaction includes a transaction that needs to be implemented by calling a smart contract deployed by the blockchain system; A virtual resource lower limit determination module, used to determine the virtual resource lower limit required to upload the contract call parameters of the business transaction to the chain; An on-chain request generation module, used to generate an on-chain request carrying the contract call parameters and the resource amount matching the virtual resource lower limit, and broadcast the on-chain request to the on-chain processing node of the blockchain system; An uplink request update module, configured to update and broadcast the uplink request if the uplink request meets the update condition, until the broadcasted uplink request is responded to by the uplink processing node; the amount of resources carried in each broadcasted uplink request increases gradually according to the broadcast time sequence; The contract calling module is used to transfer the virtual resources represented by the amount of resources carried by the response to the on-chain request to the on-chain processing node that responds to the on-chain request, and call the smart contract to implement the business transaction.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
