A data processing method, device, computer equipment and medium

By sending privacy-preserving computation events to off-chain nodes within the blockchain and verifying them using proxy chaincode, the problem of user workload and inefficiency caused by multiple off-chain computations is solved, achieving efficient execution of privacy-preserving computations and data confidentiality.

CN115329366BActive Publication Date: 2025-12-12HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210782658.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-12-12
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

When performing privacy computation in a blockchain, existing technologies require multiple off-chain computations, which increases the burden on users and the volume of transaction processing, thus reducing the efficiency of privacy computation.

Method used

By receiving transaction requests through blockchain nodes, identifying privacy computation events and sending them to off-chain computing nodes for processing, and using proxy chaincode to verify privacy computation results, user operations are reduced and efficiency is improved.

Benefits of technology

It achieves data confidentiality in privacy computing while reducing the user's operational burden and improving the execution efficiency of privacy computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115329366B_ABST
    Figure CN115329366B_ABST
Patent Text Reader

Abstract

Embodiments of the present application are suitable for the field of blockchain technology, and provide a data processing method and device, computer equipment and medium. The method is applied to a blockchain node, and includes: receiving a transaction request from a user, the transaction request including a computing event; if the computing event is a privacy computing event, sending the privacy computing event to an off-chain computing node to obtain a privacy computing result of the privacy computing event; in response to the privacy computing result, verifying the privacy computing result by using a proxy chaincode to obtain a verification result, the proxy chaincode being a contract deployed in the blockchain; based on the verification result and the privacy computing result, returning a privacy computing response to the off-chain computing node, so that the off-chain computing node returns event end information of the transaction request to the user according to the received privacy computing response. Through the above method, the privacy of privacy computing in the blockchain can be guaranteed, and the execution efficiency of privacy computing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of blockchains, and particularly relates to a data processing method and device, a computer device, and a medium. BACKGROUND

[0002] The data publicity feature of a blockchain poses a challenge to the privacy protection of private data. Although there are solutions such as anonymous sets in a blockchain that can prevent the leakage of personal private data of transaction parties, the solutions are still powerless to the demand for hiding the specific content of a transaction.

[0003] In order to hide the content of a transaction in the use of a blockchain, a privacy technology can be used in the blockchain. At present, a private computation can be performed by using an off-chain node in the blockchain, so as to protect the data in the transaction process from being disclosed.

[0004] However, when the private computation is performed by using the off-chain node, multiple private computations often need to be performed for one business; a user needs to initiate multiple transactions to implement multiple off-chain computations and thus complete the business. This not only increases the operation burden of the user side, but also increases the transaction processing capacity of the blockchain platform and reduces the execution efficiency of the private computation. SUMMARY

[0005] In view of this, the embodiments of the present application provide a data processing method, device, computer device, and medium to improve the execution efficiency of a private computation.

[0006] A first aspect of the embodiments of the present application provides a data processing method applied to a blockchain node, and the method comprises the following steps.

[0007] Receiving a transaction request from a user, wherein the transaction request comprises a computation event;

[0008] If the computation event is a private computation event, sending the private computation event to an off-chain computation node to obtain a private computation result of the private computation event, wherein the off-chain computation node is configured to execute the private computation event;

[0009] In response to the private computation result, verifying the private computation result by using a proxy chaincode to obtain a verification result, wherein the proxy chaincode is a contract deployed in the blockchain;

[0010] Based on the verification result and the private computation result, returning a private computation response to the off-chain computation node, so that the off-chain computation node returns event end information of the transaction request to the user according to the received private computation response.

[0011] A second aspect of the embodiments of the present application provides a data processing method applied to an off-chain computation node, and the method comprises the following steps.

[0012] The execution module is configured to execute a privacy calculation event sent by a blockchain node to obtain a privacy calculation result corresponding to the privacy calculation event, the privacy calculation event being obtained by the blockchain node from a transaction request from a user;

[0013] The callback module is configured to call back a proxy chain code corresponding to the privacy calculation event, the proxy chain code being configured to verify the privacy calculation result and return a verification result and the privacy calculation result to the blockchain node;

[0014] The response module is configured to return event end information of the transaction request to the user in response to a privacy calculation response of each of the privacy calculation events returned by the blockchain node.

[0015] A third aspect of an embodiment of the present application provides a data processing apparatus applied to a blockchain node, the apparatus comprising:

[0016] The obtaining module is configured to receive a transaction request from a user, the transaction request comprising a calculation event;

[0017] The sending module is configured to, if the calculation event is a privacy calculation event, send the privacy calculation event to an off-chain calculation node to obtain a privacy calculation result of the privacy calculation event, the off-chain calculation node being configured to execute the privacy calculation event;

[0018] The verification module is configured to, in response to the privacy calculation result, verify the privacy calculation result by using a proxy chain code deployed in the blockchain to obtain a verification result;

[0019] The response module is configured to return a privacy calculation response to the off-chain calculation node based on the verification result and the privacy calculation result, so that the off-chain calculation node returns event end information of the transaction request to the user according to the received privacy calculation response.

[0020] A fourth aspect of an embodiment of the present application provides a data processing apparatus applied to an off-chain calculation node, the apparatus comprising:

[0021] The execution module is configured to execute a privacy calculation event sent by a blockchain node to obtain a privacy calculation result corresponding to the privacy calculation event, the privacy calculation event being obtained by the blockchain node from a transaction request from a user;

[0022] The callback module is configured to call back a proxy chain code corresponding to the privacy calculation event, the proxy chain code being configured to verify the privacy calculation result and return a verification result and the privacy calculation result to the blockchain node;

[0023] The returning module is configured to return event end information of the transaction request to the user in response to a received privacy computation response of each of the privacy computation events returned by the blockchain node.

[0024] A fifth aspect of the embodiments of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method according to the first aspect or the second aspect when executing the computer program.

[0025] A sixth aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the method according to the first aspect or the second aspect.

[0026] A seventh aspect of the embodiments of the present application provides a computer program product, which, when executed on a computer device, causes the computer device to perform the method according to the first aspect or the second aspect.

[0027] Compared with the prior art, the embodiments of the present application have the following advantages:

[0028] In the embodiments of the present application, when the blockchain node receives the transaction request sent by the user, the corresponding privacy computation event can be obtained from the transaction request. Then, the privacy computation event is sent to the off-chain computing node for processing. After the off-chain computing node processes the privacy computation event, the privacy computation result of the privacy computation event can be obtained, and the proxy chain code in the blockchain node is called back to verify the privacy computation result. The proxy chain code verifies the privacy computation result to obtain a verification result. Then, the blockchain node can return a privacy computation response to the off-chain computing node according to the verification result and the privacy computation result. After receiving the privacy computation response, the off-chain computing node can return event end information of the transaction request to the user. In the embodiments, the off-chain computing node is used for privacy computation, so that the process of privacy computation is not disclosed, thereby ensuring the data privacy of privacy computation. On the other hand, the off-chain computing node is called to perform the computation of the privacy computation event, which can improve the execution efficiency of privacy computation. In addition, in the embodiments, only the transaction request and the event end information of the verification request need to be sent, and the specific computation of the transaction request does not need to be participated, thereby reducing the operation burden of the user. BRIEF DESCRIPTION OF DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0030] Figure 1 is a step flow diagram of a data processing method provided by an embodiment of the present application;

[0031] Figure 2 is a step flow diagram of another data processing method provided by an embodiment of the present application;

[0032] Figure 3 is a calling timing diagram of single privacy calculation provided by an embodiment of the present application;

[0033] Figure 4 is a schematic diagram of grouping privacy calculation events provided by an embodiment of the present application;

[0034] Figure 5 is a calling timing diagram of parallel calculation provided by an embodiment of the present application;

[0035] Figure 6 is a calling timing diagram of serial calculation provided by an embodiment of the present application;

[0036] Figure 7 is a schematic diagram of a data processing device provided by an embodiment of the present application;

[0037] Figure 8 is a schematic diagram of another data processing device provided by an embodiment of the present application;

[0038] Figure 9 is a schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0039] In the following description, specific details are set forth in order to provide a thorough understanding of embodiments of the present application. However, persons skilled in the art will understand that embodiments of the present application can be practiced without these specific details. In other instances, well-known systems, devices, circuits, and methods have not been described in detail so as not to obscure the description of the present application.

[0040] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0041] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0042] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0043] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0044] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0045] The technical solution of this application will be described below through specific embodiments.

[0046] Reference Figure 1 The diagram illustrates a step-by-step flowchart of a data processing method provided in an embodiment of this application, which may specifically include the following steps:

[0047] S101, Receive a transaction request from a user, the transaction request including a calculation event.

[0048] The execution subject of the embodiment is a blockchain node, which can be specifically a business chain code deployed in the blockchain node. The business chain code is a smart contract deployed on the blockchain and can be used to process a transaction request. The blockchain node in the embodiment is an on-chain node of the blockchain.

[0049] The user can send a transaction request to a blockchain node using an authorized on-chain account and certificate.

[0050] After receiving the transaction request, the blockchain node can determine the calculation events required for executing the transaction request. One calculation event can correspond to one calculation step obtained by decomposing the process of the transaction request.

[0051] S102, if the calculation event is a privacy calculation event, the privacy calculation event is sent to an off-chain calculation node to obtain a privacy calculation result of the privacy calculation event, and the off-chain calculation node is used to execute the privacy calculation event.

[0052] In the embodiment, the privacy calculation event needs to be executed by the off-chain calculation node. Since the off-chain calculation node does not have the data disclosure feature, the execution of the privacy calculation event using the off-chain calculation node can guarantee the privacy of the privacy data in the execution process.

[0053] The calculation event can have a calculation event identifier, a calculation circuit identifier, and a calculation input. According to the calculation event identifier, it can be determined whether the calculation event is a privacy calculation event.

[0054] If the calculation event is a privacy calculation event, the business chain code can send the privacy calculation event to the off-chain calculation node. After receiving the privacy calculation event, the off-chain calculation node executes the privacy calculation event to obtain a privacy calculation result.

[0055] A transaction request can include multiple privacy calculation events. The privacy calculation events can have no association or can have a parameter calling relationship. Therefore, the execution relationship between the multiple privacy calculation events can be determined. Then, the multiple privacy calculation events having a parallel execution relationship are sent to the off-chain calculation node as a calculation group, so that the off-chain calculation node executes the multiple privacy calculation events in the calculation group in parallel.

[0056] In one possible implementation, the business chain code of the blockchain node can call the proxy chain code to obtain the calculation parameters of the privacy calculation event. After obtaining the calculation parameters of the privacy calculation event, the business chain code can send the privacy calculation event to the off-chain calculation node. After sending the privacy calculation event to the off-chain calculation node, the blockchain node can send a transaction response to the user, which can be used to indicate that the blockchain has started to execute the privacy calculation in the transaction request.

[0057] S103, in response to the privacy calculation result, verifying the privacy calculation result by using a proxy chain code, obtaining a verification result, the proxy chain code being a contract deployed in the blockchain.

[0058] After the off-chain computing node performs the privacy calculation event and obtains the privacy calculation result, the proxy chain code in the blockchain needs to be called back for verification. The off-chain computing node can send the privacy calculation result to the proxy chain code in the blockchain node. After receiving the privacy calculation result, the proxy chain code can verify the privacy calculation result by using a verification function to obtain a verification result. The proxy chain code is a smart contract deployed in the blockchain. The blockchain can include multiple proxy chain codes, and each proxy chain code can provide different proxy services, such as verifying the calculation result, parsing the transaction request, etc.

[0059] S104, based on the verification result and the privacy calculation result, returning a privacy calculation response to the off-chain computing node, so that the off-chain computing node returns event end information of the transaction request to the user according to the received privacy calculation response.

[0060] A transaction request can include multiple privacy calculation events. If the input parameter of a first privacy calculation event includes the privacy calculation result of a second privacy calculation event, it indicates that the second privacy calculation event must be executed before the first privacy calculation event, and the first privacy calculation event and the second privacy calculation event have a serial relationship.

[0061] In this embodiment, the off-chain computing node needs to obtain the response of the blockchain node for each privacy calculation event after performing the privacy calculation event.

[0062] After receiving the privacy calculation result and the verification result, the blockchain node can determine whether there is a target privacy calculation event using the privacy calculation result as an input parameter. If there is a target privacy calculation event, the target privacy calculation event is encapsulated in the privacy calculation response. The privacy calculation response is sent to the off-chain computing node, so that the off-chain computing node executes the target privacy calculation event according to the privacy calculation result.

[0063] In a possible implementation, the transaction request in the embodiment is a transaction request including a privacy calculation event, but in the transaction request, a non-privacy calculation event can also be included, and the non-privacy calculation event can be directly executed by a business chain code of a blockchain node and call a corresponding proxy chain code for verification. When privacy calculation is needed in the execution process of the transaction request, the business chain code can call the corresponding proxy chain code to obtain the calculation parameters of the privacy calculation event, and the calculation parameters can include a calculation event identifier, a calculation circuit identifier, and calculation parameters. Then the privacy calculation event is sent to an off-chain calculation node; the off-chain calculation node can execute the privacy calculation event according to the calculation parameters to obtain a privacy calculation result; then the off-chain calculation node can send the privacy calculation result to the corresponding proxy chain code according to the calculation circuit identifier, so as to call back the proxy chain code to verify the privacy calculation result; the verification result of the proxy chain code after verifying the privacy calculation result and the privacy calculation result are returned to the business chain code, so that the business chain code can use the privacy calculation result to process the transaction request and return the processing result to the proxy chain code; then the proxy chain code returns a privacy calculation response to the off-chain calculation node according to the processing result; after receiving the privacy calculation event response, the off-chain calculation node can return time end information of the transaction request to the user, so that the user knows the execution result of the transaction request.

[0064] In the embodiment, the off-chain calculation node is used to process the privacy calculation event, which can guarantee the privacy of the privacy calculation event, and at the same time, using the off-chain calculation node to process the privacy calculation event can reduce the burden of the on-chain node and improve the execution efficiency of the privacy calculation.

[0065] Referring to Figure 2 , a step flowchart diagram of another data processing method provided by the embodiment is shown, which can specifically include the following steps:

[0066] S201, a privacy calculation event sent by a blockchain node is executed to obtain a privacy calculation result corresponding to the privacy calculation event, and the privacy calculation event is obtained by the blockchain node from a transaction request from a user.

[0067] The execution subject of the embodiment is an off-chain calculation node, and the off-chain calculation node is used to provide a privacy calculation service for an on-chain node.

[0068] The privacy calculation event can be sent by a business chain code in the blockchain node to the off-chain calculation node. The blockchain node can receive a transaction request sent by a user, and in the processing process of the transaction request, if privacy calculation is needed, the business chain code can call a proxy contract in a proxy chain code to obtain calculation parameters of the privacy calculation event, and the calculation parameters can include a calculation event identifier, a calculation circuit identifier, and calculation input.

[0069] After the chain off computing node receives the privacy computing event, the privacy computing event can be executed according to the computing input to obtain a privacy execution result.

[0070] In a possible implementation, multiple privacy computing events can be included in one transaction request. If the multiple privacy computing events are in parallel relationship, the business chain code can combine the multiple privacy computing events into one computing group and send the computing group to the chain off computing node, and the chain off computing node can execute in parallel.

[0071] In a possible implementation, if the multiple privacy computing events in the transaction request are in serial relationship, one privacy computing event can be sent to the chain off computing node in the execution order first. When the privacy computing result of the privacy computing event is received, the next executed privacy computing event is encapsulated as an additional parameter in the privacy computing response for the privacy computing result, and then the privacy computing response is sent to the chain off computing node. The chain off computing node obtains the next executed privacy computing event from the privacy computing response after receiving the privacy computing response, and then executes the privacy computing event. After receiving each privacy computing event, the chain off computing node can detect whether the next executed privacy computing event is included in the privacy computing response. If the next executed privacy computing event is included in the privacy computing response, the privacy computing event is continued to be executed. If the next executed privacy computing event is not included in the privacy computing response, it is indicated that the privacy computing event has been executed.

[0072] In actual application, the multiple privacy computing events in the transaction request usually contain both parallel relationship and serial relationship. At this time, the multiple privacy computing events can be divided into multiple computing groups. The privacy computing events in each computing group can be executed in parallel. The computing groups have execution relationship in sequence. The chain off computing node executes the multiple privacy computing events in the computing group in parallel, and then receives the privacy computing response corresponding to each privacy computing event. If the next computing group exists in the privacy computing response, the next computing group is executed in parallel. For example, the transaction request includes eight privacy computing events a-h. The execution order of the eight privacy computing events is: a-b-c; then d-f are executed based on the execution result of c; and g and h are executed based on the execution result of f; at this time, the eight privacy computing events can be divided into five computing groups {a}, {b}, {c}, {d, e, f}, and {g, h}. The five computing groups have execution relationship in sequence. Therefore, the execution order of the chain off computing node is: a-b-c are executed in series; then d-f are executed in parallel; and g and h are executed in parallel after the execution result of f is obtained.

[0073] In a possible implementation, the plurality of privacy computing events can be divided into a plurality of computing groups. The plurality of privacy computing events in each computing group are either all serial or all parallel, and there is no case of both serial and parallel.

[0074] S202, callback the proxy chaincode corresponding to the privacy computing event, the proxy chaincode is used for verifying the privacy computing result, and the verification result and the privacy computing result are returned to the blockchain node.

[0075] After obtaining the privacy computing result, the off-chain computing node can verify the privacy computing result by calling the verification function in the corresponding proxy chaincode according to the computing circuit identifier corresponding to the privacy computing event, to obtain a verification result.

[0076] After verification, the proxy chaincode can return the verification result and the privacy computing result to the business chaincode in the blockchain node; the business chaincode can continue to process the transaction request according to the privacy computing result.

[0077] S203, in response to the privacy computing response of the privacy computing event returned by the blockchain node, return the event end information of the transaction request to the user.

[0078] After processing the transaction request according to the privacy computing result, the blockchain node can send the processing result to the proxy chaincode; after receiving the processing result, the proxy chaincode can send a privacy computing response to the off-chain computing node; the off-chain computing node can determine whether the transaction request is executed according to the received privacy computing response; if it is determined that the transaction request is executed, the event end information can be returned to the user. The event end information can include the execution result of the transaction request, and the user can determine that the transaction request has been executed by the event end information.

[0079] In a possible implementation, when the off-chain computing node receives the privacy computing response returned by the blockchain node for the privacy computing result, it determines whether the target privacy computing event is included in the privacy computing response, the target privacy computing event being a privacy computing event taking the privacy computing result as an input parameter; if the target privacy computing event is included in the privacy computing response, the target privacy computing event is executed according to the privacy computing result; if the target privacy computing event is not included in the privacy computing response, it is determined that the transaction request is executed, and the event end information of the transaction request is returned to the user.

[0080] In this embodiment, when the off-chain computing node is used to process the privacy computing event, the execution order of the privacy computing event can be more reasonably arranged according to the execution relationship of each privacy computing event, and the execution efficiency of the privacy computing event can be improved by using parallel execution of the privacy computing event.

[0081] It should be noted that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0082] Figure 3 is a single privacy computing calling timing diagram provided by the embodiments of the present application, in which Figure 3 The transaction request includes a privacy computing event. Figure 3 The business chain code and the proxy chain code shown in are contracts deployed on a blockchain, and the vc node is an off-chain computing node used to execute a privacy computing event.

[0083] As shown in Figure 3 , a user initiates an execution process of a business transaction. The business chain code executes the business transaction, that is, business processing 1 in Figure 3 . When the content that needs off-chain computing is executed, the business chain code can call the proxy chain code corresponding to the off-chain computing, and the proxy chain code returns the calculation parameters of the off-chain computing service to the business chain code. The calculation parameters mainly include: {computing event id, computing circuit id, computing input}. As shown in Figure 3 , after executing the business processing 1, the business chain code needs to perform privacy computing, at this time, the business chain code can invoke computeandprove, that is, call the computeandprove function, to obtain the calculation parameters that need to be privacy computed. After receiving the calculation parameters, the business chain code will throw a privacy computing event EVENT_COMPUTE to the off-chain vc node. The vc node will call the verification function of the proxy chain code with the privacy computing result as the callback parameter after completing the privacy computing. The proxy chain code will further call the specified function of the business chain code after the verification of the privacy computing result is passed, and the specified function is provided when the business chain code calls the proxy chain code for the first time, that is, the parameter of invoke computeAndProve in Figure 3 . After the privacy computing is executed, the business chain code can continue to execute the transaction business, that is, business processing 2 in Figure 3 . After the transaction business processing is completed, the business chain code can return the processing result to the proxy chain code. The proxy chain code will receive the execution result of the callback business chain code, that is, Figure 3the return processing result. At this time, in the single privacy calculation scenario, the part related to the privacy calculation has been completely executed, and then the proxy chaincode can pass the last end message finish response to the vc node, and the vc node can return the event end information EVENT_FINISH to the user side.

[0084] However, in the transaction business, multiple privacy calculation events are usually included, at this time, the privacy calculation events can be grouped to better determine the execution order. Figure 4 is a schematic diagram provided by an embodiment of the present application for grouping privacy calculation events; as Figure 4 shown, the privacy calculation events involved can be divided into several groups that have no association with each other, and there is a forced calling sequence between the privacy calculations in the group.

[0085] If multiple privacy calculation events in a group do not have a calling relationship, the multiple privacy calculation events can be executed in parallel at this time. Figure 5 is a calling timing diagram of parallel calculation provided by an embodiment of the present application.

[0086] As Figure 5 shown, all privacy calculation requests can be combined in an EVENT_COMPUTE event, at this time, the vc node can execute each privacy calculation and callback operation in parallel. Finally, when the off-chain service receives all callback replies, it will return an EVENT_FINISH event to the user end at one time. Figure 5 An execution schematic diagram of two unrelated privacy calculations is given. Figure 5 The proxy chaincode 1 and the proxy chaincode 2 in the can be used to verify the results of the two unrelated privacy calculations respectively. After the verification is completed, the proxy chaincode 1 and the proxy chaincode 2 can respectively call the business chaincode with the corresponding verification content and the privacy calculation result as parameters. The business chaincode returns the processing result to the proxy chaincode 1 and the proxy chaincode 2 respectively; the proxy chaincode 1 and the proxy chaincode 2 respectively return the finish response to the off-chain calculation node according to the received processing result. The execution and response of the two unrelated privacy calculation events can be performed in parallel.

[0087] If multiple privacy calculation events in a group have a calling relationship, the multiple privacy calculation events can be executed in series at this time. Figure 6 is a calling timing diagram of serial calculation provided by an embodiment of the present application.

[0088] As Figure 6As shown, the business chain code uses the parameter passing mode to record the next EVENT_COMPUTE event by adding a field in the finish response, so as to start a new round of calculation while confirming the completion of the previous round of calculation. If the vc node receives a finish response including the next EVENT_COMPUTE event, it continues to execute the next EVENT_COMPUTE event; if the vc node receives a finish response that does not include the next EVENT_COMPUTE event, the vc node can send the EVENT_FINISH event to the user side, indicating that the privacy calculation is completed. The present application requests off-chain calculation services multiple times in one transaction request, which shields the user from business-side data processing and improves the execution efficiency of privacy transactions.

[0089] With reference to Figure 7 , a schematic diagram of a data processing apparatus provided by an embodiment of the present application is shown, which can be applied to a blockchain node and specifically can include an acquisition module 71, a sending module 72, a verification module 73, and a response module 74, wherein:

[0090] The acquisition module 71 is configured to receive a transaction request from a user, wherein the transaction request includes a calculation event.

[0091] The sending module 72 is configured to, if the calculation event is a privacy calculation event, send the privacy calculation event to an off-chain calculation node to obtain a privacy calculation result of the privacy calculation event, wherein the off-chain calculation node is configured to execute the privacy calculation event.

[0092] The verification module 73 is configured to, in response to the privacy calculation result, verify the privacy calculation result by using a proxy chain code to obtain a verification result, wherein the proxy chain code is a chain code deployed in the blockchain.

[0093] The response module 74 is configured to return a privacy calculation response to the off-chain calculation node based on the verification result and the privacy calculation result, so that the off-chain calculation node returns event end information of the transaction request to the user according to the received privacy calculation response.

[0094] In a possible implementation manner, the transaction request includes a plurality of privacy calculation events, and the sending module 72 includes:

[0095] A determination sub-module is configured to determine an execution relationship between the plurality of privacy calculation events.

[0096] The merging submodule is configured to send multiple privacy calculation events having a parallel execution relationship to the off-chain calculation node as a calculation group, so that the off-chain calculation node executes multiple privacy calculation events in the calculation group in parallel.

[0097] In a possible implementation, the response module 74 includes:

[0098] The determining submodule is configured to determine whether there is a target privacy calculation event using the privacy calculation execution result as an input parameter;

[0099] The packaging submodule is configured to, if the target privacy calculation event exists, package the target privacy calculation event in the privacy calculation response.

[0100] The sending submodule is configured to send the privacy calculation response to the off-chain calculation node, so that the off-chain calculation node executes the target privacy calculation event according to the privacy calculation result.

[0101] With reference to Figure 8 , a schematic diagram of another data processing apparatus provided by an embodiment of the present application is shown, which can be applied to an off-chain calculation node and specifically can include an execution module 81, a callback module 82, and a return module 83, where:

[0102] The execution module 81 is configured to execute a privacy calculation event sent by a blockchain node to obtain a privacy calculation result corresponding to the privacy calculation event, where the privacy calculation event is obtained by the blockchain node from a transaction request from a user.

[0103] The callback module 82 is configured to call a proxy chain code corresponding to the privacy calculation event, where the proxy chain code is configured to verify the privacy calculation result and return the verification result and the privacy calculation result to the blockchain node.

[0104] The return module 83 is configured to, in response to a privacy calculation response of the privacy calculation event returned by the blockchain node, return event end information of the transaction request to the user.

[0105] In a possible implementation, the number of privacy calculation events includes multiple, and the execution module 81 includes:

[0106] The receiving submodule is configured to receive a calculation group sent by the blockchain node, where the calculation group includes multiple privacy calculation events.

[0107] The parallel execution submodule is configured to execute the privacy calculation events in the calculation group in parallel to obtain multiple corresponding privacy calculation results.

[0108] In one possible implementation, the return module 83 mentioned above includes:

[0109] The judgment submodule is used to determine, in response to the privacy computing response returned by the blockchain node for the privacy computing result, whether the privacy computing response includes a target privacy computing event, wherein the target privacy computing event is a privacy computing event that uses the privacy computing result as an input parameter;

[0110] The execution submodule is used to execute the target privacy computation event based on the privacy computation result if the privacy computation response includes the target privacy computation event;

[0111] The return submodule is used to determine that the transaction request has ended if the privacy computation response does not include the target privacy computation event, and to return the event end information of the transaction request to the user.

[0112] In one possible implementation, the callback module 82 mentioned above includes:

[0113] The acquisition submodule is used to acquire the proxy chaincode identifier of the privacy computing event;

[0114] The verification submodule is used to send the privacy calculation result to the proxy chaincode corresponding to the proxy chaincode identifier, so that the proxy chaincode calls a preset verification function to verify the privacy calculation result.

[0115] As the apparatus embodiments are basically similar to the method embodiments, they are described in a relatively simple manner. For relevant details, please refer to the description in the method embodiment section.

[0116] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 9 As shown, the computer device 9 of this embodiment includes: at least one processor 90 ( Figure 9 (Only one is shown) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, wherein the processor 90 executes the computer program 92 to implement the steps in any of the above method embodiments.

[0117] The computer device 9 can be a desktop computer, laptop, handheld computer, or cloud server, etc. This computer device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will understand that... Figure 9The computer device 9 is merely an example and does not limit the computer device 9, which can include more or less components, or combine some components, or include different components, for example, can also include input / output devices, network access devices, etc.

[0118] The processor 90 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0119] The memory 91 can be an internal storage unit of the computer device 9 in some embodiments, for example, a hard disk or a memory of the computer device 9. The memory 91 can also be an external storage device of the computer device 9 in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 91 can include both the internal storage unit and the external storage device of the computer device 9. The memory 91 is used to store an operating system, application programs, a boot loader, data and other programs, for example, program codes of the computer program, etc. The memory 91 can also be used to temporarily store data that has been output or will be output.

[0120] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned various method embodiments.

[0121] The embodiments of the present application provide a computer program product. When the computer program product is run on a computer device, the computer device is enabled to implement the steps in the above-mentioned various method embodiments.

[0122] The data processing method, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer-readable medium at least includes any entity or device capable of carrying the computer program code to the computer device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0123] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0124] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0125] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other ways. For example, the apparatus / computer device embodiments described above are only schematic. The division of the modules or units is only a logical function division, and there can be another division in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0126] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.

[0127] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method of data processing, characterized by, Applied to a blockchain node, the method comprises: receiving a transaction request from a user, the transaction request comprising a computing event; if the computing event is a privacy computing event, sending the privacy computing event to an off-chain computing node to obtain a privacy computing result of the privacy computing event, the off-chain computing node being configured to execute the privacy computing event; in response to the privacy computing result, verifying the privacy computing result by using a proxy chaincode to obtain a verification result, the proxy chaincode being a contract deployed in the blockchain; based on the verification result and the privacy computing result, returning a privacy computing response to the off-chain computing node, so that the off-chain computing node returns event end information of the transaction request to the user according to the received privacy computing response; wherein, based on the verification result and the privacy computing result, returning a privacy computing response to the off-chain computing node comprises: determining whether there is a target privacy computing event using the privacy computing result as an input parameter; if there is the target privacy computing event, encapsulating the target privacy computing event in the privacy computing response; sending the privacy computing response to the off-chain computing node, so that the off-chain computing node executes the target privacy computing event according to the privacy computing result.

2. The method of claim 1, wherein, The transaction request comprises a plurality of privacy computing events, and if the computing event is a privacy computing event, the privacy computing event is sent to an off-chain computing node, comprising: determining the execution relationship between a plurality of privacy computing events; sending a plurality of privacy computing events with parallel execution relationship as a computing group to the off-chain computing node, so that the off-chain computing node executes a plurality of privacy computing events in the computing group in parallel.

3. A method of data processing, characterized by, Applied to an off-chain computing node, the method comprises: executing a privacy computing event sent by a blockchain node to obtain a privacy computing result corresponding to the privacy computing event, the privacy computing event being obtained by the blockchain node from a transaction request from a user; calling back a proxy chaincode corresponding to the privacy computing event, the proxy chaincode being configured to verify the privacy computing result and return a verification result and the privacy computing result to the blockchain node; in response to a privacy computing response returned by the blockchain node for the privacy computing result, determining whether the target privacy computing event is included in the privacy computing response, the target privacy computing event being a privacy computing event using the privacy computing result as an input parameter; if the target privacy computing event is included in the privacy computing response, executing the target privacy computing event according to the privacy computing result; if the target privacy computing event is not included in the privacy computing response, determining that the transaction request execution is completed, and returning event end information of the transaction request to the user.

4. The method of claim 3, wherein, The number of privacy computing events comprises a plurality, and the execution of the privacy computing event sent by the blockchain node to obtain the privacy computing result corresponding to the privacy computing event comprises: receive a calculation group sent by the blockchain node, the calculation group including a plurality of privacy calculation events; execute the privacy calculation events in the calculation group in parallel to obtain a plurality of corresponding privacy calculation results.

5. The method of claim 3 or 4, wherein, The callback includes: obtain a proxy chain code identifier of the privacy calculation event; send the privacy calculation result to the proxy chain code corresponding to the proxy chain code identifier to enable the proxy chain code to call a preset verification function to verify the privacy calculation result.

6. An apparatus for data processing, characterized by An apparatus applied to a blockchain node, the apparatus comprising: an obtaining module configured to receive a transaction request from a user, the transaction request including a calculation event; a sending module configured to, if the calculation event is a privacy calculation event, send the privacy calculation event to an off-chain calculation node to obtain a privacy calculation result of the privacy calculation event, the off-chain calculation node being configured to execute the privacy calculation event; a verification module configured to, in response to the privacy calculation result, verify the privacy calculation result using a proxy chain code to obtain a verification result, the proxy chain code being a contract deployed in the blockchain; a responding module configured to, based on the verification result and the privacy calculation result, return a privacy calculation response to the off-chain calculation node, to enable the off-chain calculation node to return event end information of the transaction request to the user according to the received privacy calculation response; the responding module is configured to perform: determine whether there is a target privacy calculation event using the privacy calculation result as an input parameter; if the target privacy calculation event exists, encapsulate the target privacy calculation event in the privacy calculation response; send the privacy calculation response to the off-chain calculation node, to enable the off-chain calculation node to execute the target privacy calculation event according to the privacy calculation result.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-5.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Off-chain privacy calculation method and device for on-chain data

    CN111047450A