Blockchain-based privacy service processing method and device
By deploying smart contracts on blockchain nodes and configuring privacy computing modules, the privacy computing modules can be directly called to execute privacy services. This solves the problem of low processing efficiency caused by the independent deployment of blockchain and privacy computing systems, and achieves more efficient privacy business processing.
Patent Information
- Application Number
- CN202210240763.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-03-10
AI Technical Summary
In existing technologies, blockchain systems and privacy computing systems are deployed independently and process privacy services through cross-system communication, resulting in low processing efficiency.
Deploy smart contracts on blockchain nodes and configure privacy computing modules. By assigning internal ports and business execution sequences to each smart contract, directly call the privacy computing module to execute privacy services, avoiding cross-system communication.
It improves the processing efficiency of privacy services, reduces the need for cross-system communication, and increases processing speed.
Smart Images

Figure CN114580025B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and more specifically, to a method and apparatus for processing privacy services based on blockchain. Background Art
[0002] In recent years, driven by related industries, blockchain and privacy-preserving computing technologies have continued to develop. Both utilize a combination of cryptography and distributed systems, each with its own distinct yet complementary characteristics. Blockchain's advantages lie in its open, secure, and tamper-proof data sharing, but this also compromises data privacy. Privacy-preserving computing, on the other hand, offers advantages in its ability to maintain data privacy without being visible, but it cannot address the challenges of multi-party collaboration and trust. Privacy-preserving computing can enhance blockchain's scalability and privacy, making data traceable and data processing verifiable.
[0003] However, the integration of the two technologies is still in the exploratory stage. The general technical solution is to adopt a dual-system approach, that is, independently deploying the blockchain system and the privacy computing system, and processing privacy data through cross-system communication. However, this method has problems such as high cost, low cross-system processing efficiency, and multiple operating platforms that are inconsistent and unfriendly to users.
[0004] There is currently no effective solution to the problem that the relevant technologies use independently deployed blockchain systems and privacy computing systems to process privacy business through cross-system communication, resulting in relatively low processing efficiency of privacy business. Summary of the Invention
[0005] The main purpose of this application is to provide a blockchain-based privacy business processing method and device to solve the problem that the related technology uses independently deployed blockchain systems and privacy computing systems to process privacy business through cross-system communication, resulting in relatively low privacy business processing efficiency.
[0006] To achieve the above-mentioned objectives, according to one aspect of the present application, a method for processing a privacy-related business based on a blockchain is provided. The method for processing a privacy-related business is used in a privacy-related business processing system based on a blockchain, wherein the privacy-related business processing system includes multiple smart contracts, wherein the smart contracts are deployed on each blockchain node, and the smart contracts are configured with a privacy computing module. The smart contracts call the privacy computing module to execute a target privacy business. The method includes: obtaining a target privacy business ID, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business; according to the target privacy business ID, allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; according to the internal port and the business execution order, the target smart contract calls the privacy computing module to execute the target privacy business.
[0007] Furthermore, before allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy business ID, the method also includes: sending the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business to each target smart contract.
[0008] Furthermore, based on the target privacy business ID, the internal port generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, including: based on the target privacy business ID, the first internal port randomly generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract to obtain a first internal port number; based on the target privacy business ID, the second internal port randomly generated by the target smart contract is allocated to the communication port of the target smart contract and the IP address of the target smart contract to obtain a second internal port number; each target smart contract saves the target privacy business ID, the first internal port number, and the second internal port number in the target comparison table of each target smart contract.
[0009] Furthermore, based on the internal port and the business execution order, the target smart contract calls the privacy computing module to execute the target privacy business, including: based on the business execution order, determining the first target smart contract one to execute the target privacy business; the target smart contract one calls the first privacy computing module corresponding to the target smart contract one to perform computing work and obtain a first computing result; based on the target privacy business ID, the target smart contract one determines the second internal port number corresponding to the second target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one; the first privacy computing module transmits the first computing result to the second internal port of the target smart contract one based on the second internal port number; and sends the first computing result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0010] Furthermore, after sending the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, the method also includes: based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; based on the first internal port number, the target smart contract two transmits the first calculation result to the first internal port of the target smart contract two; the second privacy computing module obtains the first calculation result, and performs calculation work to obtain the second calculation result; continue to execute based on the target privacy business ID, the target smart contract two determines the second internal port number corresponding to the next target smart contract that executes the target privacy business through the target comparison table of the target smart contract two, until the execution of the target privacy business is completed.
[0011] Furthermore, each smart contract is provided with a unique communication interface, wherein the communication interface is used to implement data interaction between the smart contracts.
[0012] To achieve the above-mentioned objectives, according to another aspect of the present application, a blockchain-based privacy service processing device is provided. The device includes: an acquisition unit for acquiring a target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the service execution order of each target smart contract for the target privacy service; an allocation unit for allocating, based on the target privacy service ID, the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; and an execution unit for invoking the privacy computing module by the target smart contract to execute the target privacy service based on the internal port and the service execution order.
[0013] Furthermore, the device also includes: a first sending unit, which is used to send the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business to each target smart contract before allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy business ID.
[0014] Furthermore, the allocation unit includes: a first allocation module, used to allocate the first internal port randomly generated by the target smart contract to the privacy computing module corresponding to the target smart contract based on the target privacy business ID, and obtain a first internal port number; a second allocation module, used to allocate the second internal port randomly generated by the target smart contract to the communication port of the target smart contract and the IP address of the target smart contract based on the target privacy business ID, and obtain a second internal port number; a storage module, used for each target smart contract to save the target privacy business ID, the first internal port number and the second internal port number to the target comparison table of each target smart contract.
[0015] Furthermore, the execution unit includes: a first determination module, used to determine the first target smart contract one that executes the target privacy business based on the business execution order; a calculation module, used by the target smart contract one to call the first privacy calculation module corresponding to the target smart contract one to perform calculation work and obtain a first calculation result; a second determination module, used to determine the second target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one based on the target privacy business ID; a first sending module, used by the first privacy calculation module to transmit the first calculation result to the second internal port of the target smart contract one based on the second internal port number; a second sending module, used to send the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0016] Furthermore, the device also includes: a first determination unit, which is used to send the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, and then, based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; a second sending unit, which is used to transmit the first calculation result to the first internal port of the target smart contract two based on the first internal port number; a calculation unit, which is used for the second privacy computing module to obtain the first calculation result and perform calculation work to obtain the second calculation result; a second determination unit, which is used to continue to execute the target privacy business ID, and the target smart contract two determines the second internal port number corresponding to the next target smart contract that executes the target privacy business through the target comparison table of the target smart contract two, until the execution of the target privacy business is completed.
[0017] Furthermore, each smart contract is provided with a unique communication interface, wherein the communication interface is used to implement data interaction between the smart contracts.
[0018] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a processor is provided, which is used to run a program, wherein the program executes any one of the above-mentioned blockchain-based privacy service processing methods when running.
[0019] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, and the memory is used to store a processing method for one or more processors to implement any of the above-mentioned blockchain-based privacy services.
[0020] This application adopts the following steps: obtaining the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy service; based on the target privacy service ID, assigning the internal port generated by the target smart contract to the privacy computing module, communication port, and IP address corresponding to the target smart contract; based on the internal port and business execution order, the target smart contract calls the privacy computing module to execute the target privacy service. This solves the problem of low privacy service processing efficiency caused by the use of independently deployed blockchain systems and privacy computing systems in related technologies, which is achieved through cross-system communication. By assigning the internal port generated by the target smart contract to the privacy computing module, communication port, and IP address corresponding to the target smart contract, and then using the above internal port and task execution order, the target smart contract calls the privacy computing module to complete the privacy service, avoiding cross-system communication to complete the privacy service, thereby achieving the effect of improving the processing efficiency of the privacy service. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0022] Figure 1 This is a flowchart of a method for processing a privacy service based on blockchain provided in an embodiment of the present application;
[0023] Figure 2 This is a schematic diagram of a blockchain-based privacy service processing system provided according to an embodiment of the present application;
[0024] Figure 3 This is a flowchart of an optional blockchain-based privacy service processing method provided in an embodiment of the present application;
[0025] Figure 4 2 is a schematic diagram of a blockchain-based privacy service processing device according to an embodiment of the present application;
[0026] Figure 5 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] The present invention will be described below in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a method for processing a privacy service based on blockchain according to an embodiment of the present application. Figure 1 As shown, the method includes the following steps:
[0031] Step S101: Obtain the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the service execution order of each target smart contract for the target privacy service.
[0032] Specifically, the privacy service processing method is used in a privacy service processing system based on blockchain, such as Figure 2 As shown, the processing system includes multiple blockchain nodes. Figure 2Nodes A, B, and C in the example are the aforementioned blockchain nodes. Smart contracts are deployed on the blockchain nodes to execute blockchain transactions. A privacy-preserving computing module is also deployed on the smart contracts. When executing blockchain transactions, the smart contracts invoke the corresponding privacy-preserving computing module to complete the privacy-preserving task. When a target privacy-preserving task is pending, the target privacy-preserving task ID, the IP addresses of the multiple target smart contracts involved in the task, the communication ports for each target smart contract, and the execution order for each target smart contract are obtained. For example, if target privacy-preserving task ID 1 requires the target smart contracts on nodes A, B, and C to complete, the corresponding IP addresses and communication ports are: node A IP: 50000, node B IP: 50000, and node C IP: 50000. The execution order for the target privacy-preserving task is node A, node B, and node C.
[0033] Step S102: Based on the target privacy service ID, the internal port generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract.
[0034] Specifically, taking the target smart contract A on the above-mentioned node A as an example, according to the target privacy business ID1, the target smart contract A is its corresponding privacy computing module A, the IP address and communication port of the target smart contract B on node B and the IP address and communication port of the target smart contract C on node C are assigned randomly generated internal ports.
[0035] Step S103: Based on the internal port and business execution order, the target smart contract calls the privacy computing module to execute the target privacy business.
[0036] To summarize, by allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, and then through the above-mentioned internal port and task execution sequence, the target smart contract calls the privacy computing module to complete the privacy business, avoiding cross-system communication to complete the privacy business and improving the execution efficiency of the privacy business.
[0037] Optionally, in the blockchain-based privacy business processing method provided in the embodiment of the present application, before allocating the internal port generated by the target smart contract to the privacy computing module, the communication port of the target smart contract, and the IP address of the target smart contract corresponding to the target privacy business based on the target privacy business ID, the method also includes: sending the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business to each target smart contract.
[0038] Specifically, after obtaining the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business, the above information is sent to each target smart contract. In this way, each target smart contract can allocate internal port numbers for the IP addresses of multiple target smart contracts involved in the target privacy business and the communication port of each target smart contract based on the ID of the target privacy business.
[0039] Optionally, in the blockchain-based privacy business processing method provided in the embodiment of the present application, the internal port generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy business ID, including: according to the target privacy business ID, the first internal port randomly generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract to obtain a first internal port number; according to the target privacy business ID, the second internal port randomly generated by the target smart contract is allocated to the communication port of the target smart contract and the IP address of the target smart contract to obtain a second internal port number; each target smart contract saves the target privacy business ID, the first internal port number and the second internal port number in the target comparison table of each target smart contract.
[0040] Specifically, taking target smart contract A on node A as an example, for target privacy service ID 1, target smart contract A allocates a first internal port to its corresponding privacy computing module A, with the corresponding first internal port number being localhost:50001. Target smart contract A allocates a second internal port to the IP address and communication port of target smart contract B on node B, with the corresponding second port number being localhost:50002. Target smart contract A allocates a second internal port to the IP address and communication port of target smart contract C on node C, with the corresponding second port number being localhost:50003. The target privacy service ID, first internal port number, and second internal port number are saved in the target comparison table of each target smart contract. That is, target privacy service ID 1, localhost:50001, localhost:50002, and localhost:50003 are saved in target comparison table A of target smart contract A. Target smart contract B on node B and target smart contract C on node C then use the same method to allocate internal port numbers. For example, the internal port numbers assigned to target smart contract B on node B are: target privacy service ID 1, localhost:50004 (corresponding to the IP address and communication port of target smart contract A), localhost:50005 (corresponding to the privacy computing module B of target smart contract B), and localhost:50006 (corresponding to the IP address and communication port of target smart contract C). By following these steps, the internal port generated by the target smart contract is assigned to the privacy computing module, communication port, and IP address corresponding to the target smart contract, enabling fast communication between smart contracts and improving the processing efficiency of privacy services.
[0041] Optionally, in the blockchain-based privacy business processing method provided in the embodiment of the present application, the target smart contract calls the privacy computing module to execute the target privacy business based on the internal port and the business execution order, including: determining the first target smart contract one that executes the target privacy business based on the business execution order; the target smart contract one calls the first privacy computing module corresponding to the target smart contract one to perform computing work and obtain a first computing result; based on the target privacy business ID, the target smart contract one determines the second internal port number corresponding to the second target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one; the first privacy computing module transmits the first computing result to the second internal port of the target smart contract one based on the second internal port number; and sends the first computing result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0042] Specifically, the order of task execution for the target privacy business ID1 is node A, node B, and node C. That is, the target smart contract A is the first target smart contract one to execute the target privacy business. The target smart contract A calls the privacy computing module A (that is, the first privacy computing module mentioned above) to perform privacy computing and obtains the first computing result; based on the target privacy business ID1, the second internal port number corresponding to the second target smart contract two that executes the target privacy business is obtained by querying the target comparison table A, that is, the second internal port number localhost:50002 corresponding to the target smart contract B; the first computing result is transmitted to the second internal port corresponding to localhost:50002; and then the first computing result and the target privacy business ID1 are sent to the communication port of the target smart contract B through the communication port of the target smart contract A. For example, Figure 3 The privacy business processing flow shown, Figure 3 The 1.1.1 in the above description is the second internal port corresponding to transmitting the first calculation result to localhost:50002. Figure 3 1.1.2 in the preceding text refers to the process described above, where the first computation result and the target privacy service ID 1 are sent to the target privacy service ID 1 via the communication port of target smart contract A. Through these steps, the privacy computing module can collaborate to complete the target privacy service without having to communicate with any external privacy computing modules.
[0043] Optionally, in the blockchain-based privacy business processing method provided in the embodiment of the present application, after sending the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, the method also includes: based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; based on the first internal port number, the target smart contract two transmits the first calculation result to the first internal port of the target smart contract two; the second privacy computing module obtains the first calculation result, and performs the calculation work to obtain the second calculation result; continue to execute based on the target privacy business ID, the target smart contract two determines the second internal port number corresponding to the next target smart contract that executes the target privacy business through the target comparison table of the target smart contract two, until the target privacy business is executed.
[0044] Specifically, after the target smart contract B receives the first calculation result and the target privacy business ID1, the target smart contract B queries the target comparison table B according to the target privacy business ID1 to obtain the first internal port number corresponding to the privacy computing module B of the target smart contract B (that is, the above-mentioned second privacy computing module), that is, localhost:50005. The target smart contract B sends the first calculation result to the first internal port corresponding to localhost:50005. The privacy computing module B obtains the first calculation result, performs the calculation work, and obtains the second calculation result; then continues to execute according to the target privacy business ID1, the target smart contract B determines the second internal port number corresponding to the next target smart contract (for example, target smart contract C) that executes the target privacy business through the target comparison table B until the target privacy business is executed. For example, Figure 3 1.1.3 corresponds to the target smart contract B sending the first calculation result to the first internal port corresponding to localhost:50005. Through these steps, the first internal port number corresponding to the privacy computing module of the target privacy service is accurately found using the target privacy service ID, avoiding the problem of being unable to identify which privacy service the currently interacted information belongs to due to multiple privacy services using the same port number.
[0045] Optionally, in the blockchain-based privacy business processing method provided in the embodiment of the present application, a unique communication interface is set on each smart contract, wherein the communication interface is used to implement data interaction between smart contracts.
[0046] Specifically, all smart contracts only have a unique external communication interface, and the privacy computing module on the smart contract communicates with the outside world through the unique communication port of the smart contract.
[0047] The blockchain-based privacy service processing method provided in the embodiment of the present application obtains the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the service execution order of each target smart contract for the target privacy service; based on the target privacy service ID, the internal port generated by the target smart contract is assigned to the privacy computing module, the communication port, and the IP address of the target smart contract corresponding to the target privacy service; based on the internal port and the service execution order, the target smart contract calls the privacy computing module to execute the target privacy service, thereby solving the problem of low privacy service processing efficiency caused by the use of independently deployed blockchain systems and privacy computing systems in related technologies and the cross-system communication method to realize privacy service processing. By assigning the internal port generated by the target smart contract to the privacy computing module, the communication port, and the IP address of the target smart contract corresponding to the target privacy service, and then using the above-mentioned internal port and task execution order, the target smart contract calls the privacy computing module to complete the privacy service, avoiding cross-system communication to complete the privacy service, thereby achieving the effect of improving the processing efficiency of the privacy service.
[0048] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0049] The present application also provides a device for processing a privacy-related service based on blockchain. It should be noted that the device for processing a privacy-related service based on blockchain in the present application can be used to execute the method for processing a privacy-related service based on blockchain provided in the present application. The following describes the device for processing a privacy-related service based on blockchain provided in the present application.
[0050] Figure 4 Schematic diagram of a processing device for privacy services based on blockchain according to an embodiment of the present application. Figure 4 As shown, the device includes: an acquisition unit 401, an allocation unit 402 and an execution unit 403.
[0051] The acquisition unit 401 is used to obtain the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the service execution order of each target smart contract for the target privacy service.
[0052] The allocation unit 402 is used to allocate the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy business ID.
[0053] The execution unit 403 is used to call the privacy computing module to execute the target privacy business based on the internal port and business execution order.
[0054] The blockchain-based privacy service processing device provided in the embodiment of the present application obtains the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the service execution order of each target smart contract for the target privacy service through the acquisition unit 401; the allocation unit 402 allocates the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy service ID; the execution unit 403, based on the internal port and the service execution order, the target smart contract calls the privacy computing module to execute the target privacy service, thereby solving the problem of low privacy service processing efficiency caused by the use of independently deployed blockchain systems and privacy computing systems in related technologies and the cross-system communication method to realize the processing of privacy services. By allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, and then using the above-mentioned internal port and task execution order, the target smart contract calls the privacy computing module to complete the privacy service, avoiding cross-system communication to complete the privacy service, thereby achieving the effect of improving the processing efficiency of the privacy service.
[0055] Optionally, in the blockchain-based privacy business processing device provided in the embodiment of the present application, the device also includes: a first sending unit, which is used to send the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business to each target smart contract before allocating the internal port generated by the target smart contract to the privacy computing module, the communication port, and the IP address of the target smart contract corresponding to the target privacy business.
[0056] Optionally, in the blockchain-based privacy business processing device provided in an embodiment of the present application, the allocation unit 402 includes: a first allocation module, used to allocate a first internal port randomly generated by the target smart contract to the privacy computing module corresponding to the target smart contract based on the target privacy business ID, and obtain a first internal port number; a second allocation module, used to allocate a second internal port randomly generated by the target smart contract to the communication port and the IP address of the target smart contract based on the target privacy business ID, and obtain a second internal port number; a storage module, used for each target smart contract to save the target privacy business ID, the first internal port number and the second internal port number to the target comparison table of each target smart contract.
[0057] Optionally, in the blockchain-based privacy business processing device provided in the embodiment of the present application, the execution unit 403 includes: a first determination module, used to determine the first target smart contract one that executes the target privacy business based on the business execution order; a calculation module, used by the target smart contract one to call the first privacy calculation module corresponding to the target smart contract one to perform calculation work and obtain a first calculation result; a second determination module, used to determine the second internal port number corresponding to the target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one based on the target privacy business ID; a first sending module, used by the first privacy calculation module to transmit the first calculation result to the second internal port of the target smart contract one based on the second internal port number; and a second sending module to send the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0058] Optionally, in the blockchain-based privacy business processing device provided in the embodiment of the present application, the device also includes: a first determination unit, which is used to send the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, and then, based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; a second sending unit, which is used to transmit the first calculation result to the first internal port of the target smart contract two based on the first internal port number; a calculation unit, which is used for the second privacy computing module to obtain the first calculation result and perform the calculation work to obtain the second calculation result; a second determination unit, which is used to continue to execute the target privacy business ID, and the target smart contract two determines the second internal port number corresponding to the next target smart contract to execute the target privacy business through the target comparison table of the target smart contract two, until the execution of the target privacy business is completed.
[0059] Optionally, in the blockchain-based privacy service processing device provided in an embodiment of the present application, a unique communication interface is provided on each smart contract, wherein the communication interface is used to implement data interaction between smart contracts.
[0060] The blockchain-based privacy service processing device includes a processor and a memory. The above-mentioned acquisition unit 401, allocation unit 402 and execution unit 403 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0061] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the processing of privacy services can be achieved by adjusting the kernel parameters.
[0062] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0063] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the blockchain-based privacy service processing method when running.
[0064] like Figure 5 As shown, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and runnable on the processor. When the processor executes the program, the following steps are implemented: obtaining the target privacy business ID, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business; according to the target privacy business ID, allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; according to the internal port and the business execution order, the target smart contract calls the privacy computing module to execute the target privacy business.
[0065] Optionally, before allocating the internal port generated by the target smart contract to the privacy computing module, communication port and IP address of the target smart contract corresponding to the target privacy business based on the target privacy business ID, the method also includes: sending the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract and the business execution order of each target smart contract for the target privacy business to each target smart contract.
[0066] Optionally, based on the target privacy business ID, the internal port generated by the target smart contract is assigned to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, including: based on the target privacy business ID, the first internal port randomly generated by the target smart contract is assigned to the privacy computing module corresponding to the target smart contract to obtain a first internal port number; based on the target privacy business ID, the second internal port randomly generated by the target smart contract is assigned to the communication port of the target smart contract and the IP address of the target smart contract to obtain a second internal port number; each target smart contract saves the target privacy business ID, the first internal port number, and the second internal port number in the target comparison table of each target smart contract.
[0067] Optionally, based on the internal port and business execution order, the target smart contract calls the privacy computing module to execute the target privacy business, including: based on the business execution order, determining the first target smart contract one that executes the target privacy business; the target smart contract one calls the first privacy computing module corresponding to the target smart contract one to perform computing work and obtain a first computing result; based on the target privacy business ID, the target smart contract one determines the second internal port number corresponding to the second target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one; the first privacy computing module transmits the first computing result to the second internal port of the target smart contract one based on the second internal port number; and sends the first computing result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0068] Optionally, after sending the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, the method also includes: based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; based on the first internal port number, the target smart contract two transmits the first calculation result to the first internal port of the target smart contract two; the second privacy computing module obtains the first calculation result, and performs the calculation work to obtain the second calculation result; continue to execute based on the target privacy business ID, the target smart contract two determines the second internal port number corresponding to the next target smart contract that executes the target privacy business through the target comparison table of the target smart contract two, until the target privacy business is executed.
[0069] Optionally, each smart contract is provided with a unique communication interface, wherein the communication interface is used to implement data exchange between smart contracts. The device in this article can be a server, PC, PAD, mobile phone, etc.
[0070] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: obtaining the target privacy business ID, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business; according to the target privacy business ID, allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; according to the internal port and the business execution order, the target smart contract calls the privacy computing module to execute the target privacy business.
[0071] Optionally, before allocating the internal port generated by the target smart contract to the privacy computing module, communication port and IP address of the target smart contract corresponding to the target privacy business based on the target privacy business ID, the method also includes: sending the ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract and the business execution order of each target smart contract for the target privacy business to each target smart contract.
[0072] Optionally, based on the target privacy business ID, the internal port generated by the target smart contract is assigned to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, including: based on the target privacy business ID, the first internal port randomly generated by the target smart contract is assigned to the privacy computing module corresponding to the target smart contract to obtain a first internal port number; based on the target privacy business ID, the second internal port randomly generated by the target smart contract is assigned to the communication port of the target smart contract and the IP address of the target smart contract to obtain a second internal port number; each target smart contract saves the target privacy business ID, the first internal port number, and the second internal port number in the target comparison table of each target smart contract.
[0073] Optionally, based on the internal port and business execution order, the target smart contract calls the privacy computing module to execute the target privacy business, including: based on the business execution order, determining the first target smart contract one that executes the target privacy business; the target smart contract one calls the first privacy computing module corresponding to the target smart contract one to perform computing work and obtain a first computing result; based on the target privacy business ID, the target smart contract one determines the second internal port number corresponding to the second target smart contract two that executes the target privacy business in the target comparison table of the target smart contract one; the first privacy computing module transmits the first computing result to the second internal port of the target smart contract one based on the second internal port number; and sends the first computing result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one.
[0074] Optionally, after sending the first calculation result and the target privacy business ID to the communication port of the target smart contract two through the communication port of the target smart contract one, the method also includes: based on the ID of the target privacy business, the target smart contract two determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract two, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract two; based on the first internal port number, the target smart contract two transmits the first calculation result to the first internal port of the target smart contract two; the second privacy computing module obtains the first calculation result, and performs the calculation work to obtain the second calculation result; continue to execute based on the target privacy business ID, the target smart contract two determines the second internal port number corresponding to the next target smart contract that executes the target privacy business through the target comparison table of the target smart contract two, until the target privacy business is executed.
[0075] Optionally, each smart contract is provided with a unique communication interface, wherein the communication interface is used to implement data interaction between smart contracts.
[0076] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0077] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0080] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0081] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0082] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0083] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for processing privacy services based on blockchain, characterized in that: The privacy service processing method is used in a blockchain-based privacy service processing system. The privacy service processing system includes multiple smart contracts, wherein the smart contract is deployed on each blockchain node and is configured with a privacy computing module. The smart contract calls the privacy computing module to execute the target privacy service, including: Obtain the target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the execution order of each target smart contract for the target privacy service; Based on the target privacy service ID, assign the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; According to the internal port and the service execution order, the target smart contract calls the privacy computing module to execute the target privacy service; According to the target privacy service ID, the internal port generated by the target smart contract is allocated to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract, including: According to the target privacy service ID, assigning a first internal port randomly generated by the target smart contract to the privacy computing module corresponding to the target smart contract to obtain a first internal port number; Allocating a randomly generated second internal port of the target smart contract to the communication port of the target smart contract and the IP address of the target smart contract based on the target privacy service ID to obtain a second internal port number; Each target smart contract saves the target privacy service ID, the first internal port number, and the second internal port number into the target comparison table of each target smart contract.
2. The method according to claim 1, characterized in that Before allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy service ID, the method further includes: The ID of the target privacy business, the IP addresses of multiple target smart contracts involved in the target privacy business, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy business are sent to each target smart contract.
3. The method according to claim 1, characterized in that Based on the internal port and the service execution order, the target smart contract calls the privacy computing module to execute the target privacy service, including: Determine, based on the business execution order, the first target smart contract to execute the target privacy business; The target smart contract 1 calls the first privacy computing module corresponding to the target smart contract 1 to perform computing work and obtain a first computing result; According to the target privacy service ID, the target smart contract 1 determines, in the target comparison table of the target smart contract 1, a second internal port number corresponding to the second target smart contract 2 that executes the target privacy service; The first privacy computing module transmits the first computing result to the second internal port of the target smart contract according to the second internal port number; The first calculation result and the target privacy service ID are sent to the communication port of the target smart contract 2 through the communication port of the target smart contract 1.
4. The method according to claim 3, characterized in that After sending the first calculation result and the target privacy service ID to the communication port of the target smart contract 2 through the communication port of the target smart contract 1, the method further includes: Based on the ID of the target privacy service, the target smart contract 2 determines the first internal port number corresponding to the second privacy computing module through the target comparison table of the target smart contract 2, wherein the second privacy computing module is the privacy computing module corresponding to the target smart contract 2; According to the first internal port number, the target smart contract 2 transmits the first calculation result to the first internal port of the target smart contract 2; The second privacy computing module obtains the first computing result and performs computing work to obtain a second computing result; Continue to execute the target privacy service ID, and the target smart contract 2 determines the second internal port number corresponding to the next target smart contract that executes the target privacy service through the target comparison table of the target smart contract 2 until the execution of the target privacy service is completed.
5. The method according to claim 2, characterized in that Each smart contract is provided with a unique communication interface, wherein the communication interface is used to implement data interaction between the smart contracts.
6. A blockchain-based privacy service processing device, characterized in that: The privacy service processing device is used in a blockchain-based privacy service processing system. The privacy service processing system includes multiple smart contracts, wherein the smart contracts are deployed on each blockchain node and are configured with a privacy computing module. The smart contracts call the privacy computing module to execute the target privacy service, including: An acquisition unit, configured to acquire a target privacy service ID, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the order in which each target smart contract executes the target privacy service; an allocating unit, configured to allocate, based on the target privacy service ID, an internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract; An execution unit, configured to cause the target smart contract to call the privacy computing module to execute the target privacy service based on the internal port and the service execution order; In which, the allocation unit is also used to allocate the first internal port randomly generated by the target smart contract to the privacy computing module corresponding to the target smart contract based on the target privacy business ID, and obtain a first internal port number; according to the target privacy business ID, allocate the second internal port randomly generated by the target smart contract to the communication port of the target smart contract and the IP address of the target smart contract to obtain a second internal port number; each target smart contract saves the target privacy business ID, the first internal port number and the second internal port number in the target comparison table of each target smart contract.
7. The device according to claim 6, characterized in that The device further comprises: The first sending unit is used to send the ID of the target privacy service, the IP addresses of multiple target smart contracts involved in the target privacy service, the communication port of each target smart contract, and the business execution order of each target smart contract for the target privacy service to each target smart contract before allocating the internal port generated by the target smart contract to the privacy computing module corresponding to the target smart contract, the communication port of the target smart contract, and the IP address of the target smart contract based on the target privacy service ID.
8. A processor, characterized in that: The processor is used to run a program, wherein when the program is run, the method for processing a privacy service based on blockchain as described in any one of claims 1 to 5 is executed.
9. An electronic device, characterized in that: The system comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based privacy business processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data generation method and device based on blockchain network, node and storage medium
CN112015814A
Cross-chain interaction method and device
CN113067838A