CN117395305A - Block chain-based secure computing method, device, equipment and storage medium - Google Patents

Block chain-based secure computing method, device, equipment and storage medium Download PDF

Info

Publication number
CN117395305A
CN117395305A CN202311685704.2A CN202311685704A CN117395305A CN 117395305 A CN117395305 A CN 117395305A CN 202311685704 A CN202311685704 A CN 202311685704A CN 117395305 A CN117395305 A CN 117395305A
Authority
CN
China
Prior art keywords
block
nodes
node
data
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311685704.2A
Other languages
Chinese (zh)
Other versions
CN117395305B (en
Inventor
张翔
余凌
张强
叶炯林
袁灿培
黄永麟
李应球
梁琮源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd
Priority to CN202311685704.2A priority Critical patent/CN117395305B/en
Publication of CN117395305A publication Critical patent/CN117395305A/en
Application granted granted Critical
Publication of CN117395305B publication Critical patent/CN117395305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention belongs to the technical field of blockchains, and discloses a blockchain-based secure computing method, a blockchain-based secure computing device, a blockchain-based secure computing equipment and a storage medium. According to the method, cloud data are obtained according to the data calculation request of the block node, the adjacent block node is determined according to the block node, the cloud data are distributed to the block node and the adjacent block node, the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result, the calculation result is synchronized to the block chain, the data of the block chain are updated, the data with high data quantity and low delay sensitivity are migrated to the edge through the edge and the end, and the burden of the block chain is reduced, so that the data processing efficiency and the safety of the block chain are improved.

Description

Block chain-based secure computing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a blockchain-based secure computing method, apparatus, device, and storage medium.
Background
In the edge calculation of the blockchain, the safety problem of the edge calculation of the blockchain is usually caused by the poor self-expansibility, and the currently adopted method is to disperse the safety strategy and authority to each node so as to avoid centralized control or to avoid data disorder caused by single-point faults.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a safe computing method, device, equipment and storage medium based on a blockchain, and aims to solve the technical problem that the safety is poor when edge computation is performed in the blockchain in the prior art.
To achieve the above object, the present invention provides a blockchain-based secure computing method, the method including the steps of:
acquiring cloud data according to the data calculation request of the block node;
determining adjacent block nodes according to the block nodes;
determining a total number of the block nodes and the neighboring block nodes;
dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and respectively calculating the block nodes and the adjacent block nodes to obtain a plurality of local calculation results consistent with the total number, wherein each block node is allocated with one cloud data block;
summarizing the plurality of local calculation results to obtain calculation results of the cloud data;
and synchronizing the calculation result to the block chain, and updating the data of the block chain.
Optionally, the determining the adjacent block node according to the block node includes:
acquiring a node topological graph of the block chain;
determining the position of the block node in the node topological graph;
determining the position of a block node directly connected with the block node according to the position of the block node in the node topological graph;
calculating the distance between the nodes according to the positions of the block nodes in the node topological graph and the positions of the block nodes directly connected with the block nodes;
and determining adjacent block nodes according to the distance between the nodes.
Optionally, the dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, so that the block nodes and the adjacent block nodes calculate respectively to obtain a plurality of local calculation results consistent with the total number, including:
determining a computing service type according to the cloud data;
determining the number of the calculated service types, and comparing the number of the calculated service types with the number of the adjacent block nodes;
when the number of the calculated service types is smaller than the number of the adjacent block nodes, determining a difference value between the number of the adjacent block nodes and the number of the calculated service types;
determining the data quantity corresponding to the calculation service types, determining a target group according to the difference value, dividing the calculation service types with more data quantity on average according to the target group, binding the target group, and respectively calculating the block node and the adjacent block node to obtain a plurality of local calculation results consistent with the total quantity.
Optionally, the acquiring cloud data according to the data calculation request of the block node includes:
positioning a target block node storing target cloud data according to the data calculation request of the block node;
acquiring target cloud data from the target block node according to the data calculation request;
and homomorphic encryption is carried out on the target cloud data to obtain the cloud data.
Optionally, the synchronizing the calculation result to the blockchain, and updating the data of the blockchain includes:
receiving block synchronization information of the block node;
transmitting state determining information to all block nodes in the block chain according to the block synchronizing information, so that all block nodes broadcast the block state information of the block nodes and output broadcast state information;
receiving the block chain state information processed by all the block nodes according to the broadcast state information;
broadcasting the state information of the block chain in the block chain, comparing the state information of all the block nodes with the state information of all the block nodes according to the state information of the block chain, and updating the state information of all the block nodes into the state information of the block chain when the state information of the block chain is inconsistent with the state information of all the block nodes.
Optionally, the receiving the blockchain status information processed by all blocknodes according to the broadcast status information includes:
generating a state vector table according to the broadcast state information, wherein the state vector table records the current state of each node;
classifying the current states of all nodes in the state vector table according to the state types, and outputting the current state corresponding to the type with the largest number as the blockchain state information.
Optionally, after the step of synchronizing the calculation result to the blockchain and updating the data of the blockchain, the method further includes:
detecting the data capacity of the block chain, and when the data capacity is larger than a preset threshold value, adding a block node in the block chain;
and updating the topological graph of the blockchain according to the newly added blocknodes.
In addition, to achieve the above object, the present invention also proposes a blockchain-based secure computing device, including:
the data acquisition module is used for acquiring cloud data according to the data calculation request of the block node;
the node confirmation module is used for determining adjacent block nodes according to the block nodes;
the data calculation module is used for distributing the cloud data to the block node and the adjacent block node, so that the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result;
and the state synchronization module is used for synchronizing the calculation result to the block chain and updating the data of the block chain.
In addition, to achieve the above object, the present invention also proposes a blockchain-based secure computing device including: a memory, a processor, and a blockchain-based security computing program stored on the memory and executable on the processor, the blockchain-based security computing program configured to implement the steps of the blockchain-based security computing method as described above.
In addition, to achieve the above object, the present invention also proposes a storage medium having stored thereon a blockchain-based security calculation program which, when executed by a processor, implements the steps of the blockchain-based security calculation method as described above.
According to the method, cloud data are obtained according to the data calculation request of the block node, the adjacent block node is determined according to the block node, the cloud data are distributed to the block node and the adjacent block node, the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result, the calculation result is synchronized to the block chain, the data of the block chain are updated, the data with high data quantity and low delay sensitivity are migrated to the edge through the edge and the end, and the burden of the block chain is reduced, so that the data processing efficiency and the safety of the block chain are improved.
Drawings
FIG. 1 is a schematic diagram of the architecture of a blockchain-based secure computing device of a hardware operating environment in accordance with an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a blockchain-based secure computing method of the present invention;
FIG. 3 is a block node topology diagram of an embodiment of a blockchain-based secure computing method of the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a blockchain-based secure computing method of the present invention;
FIG. 5 is a block diagram of a first embodiment of a blockchain-based secure computing device of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a blockchain-based secure computing device in a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the blockchain-based secure computing device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is not limiting of a blockchain-based secure computing device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a blockchain-based security computing program may be included in the memory 1005 as one storage medium.
In the blockchain-based secure computing device shown in fig. 1, the network interface 1004 is primarily used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the blockchain-based security computing device of the present invention may be disposed in the blockchain-based security computing device, and the blockchain-based security computing device invokes the blockchain-based security computing program stored in the memory 1005 through the processor 1001 and executes the blockchain-based security computing method provided by the embodiment of the present invention.
The embodiment of the invention provides a safe computing method based on a block chain, and referring to fig. 2, fig. 2 is a flow diagram of a first embodiment of the safe computing method based on the block chain.
In this embodiment, the blockchain-based secure computing method includes the following steps:
step S10: and acquiring cloud data according to the data calculation request of the block node.
It should be noted that, the execution subject of the embodiment is a secure computing device based on a blockchain, where the secure computing device based on a blockchain has functions of data processing, data communication, program running, and the like, and the secure computing device based on a blockchain may be an integrated controller, a control computer, and other devices with similar functions, and the embodiment is not limited to this.
It will be appreciated that the blockchain is formed by the interconnection of several nodes, the data communication between each node is broadcast throughout the network, and each blocknode is able to record this data communication to form its own ledger, so that the data recorded in the blockchain has a high security.
In a specific implementation, when a certain block node needs to process related data, cloud data stored in other nodes needs to be acquired at this time, the block node needs to access the block node storing the cloud data, and meanwhile, the data is recorded by all the block nodes including the block node itself. After the node storing the target cloud data receives the data calculation request, the cloud data can be sent to the block node sending the data calculation request, and all actions generated in the process can be recorded to form corresponding data information.
Further, the obtaining cloud data according to the data calculation request of the block node includes:
positioning a target block node storing target cloud data according to the data calculation request of the block node;
acquiring target cloud data from the target block node according to the data calculation request;
and homomorphic encryption is carried out on the target cloud data to obtain the cloud data.
In a specific implementation, the data calculation request of the block node is received by other block nodes, the data calculation request is analyzed, when the current data calculation request is not self, the current data calculation request can be discarded and is not reacted, when the analysis and the identification of the access target of the data calculation request is self, the data calculation request can be analyzed, specific information in the data request, such as the data to be accessed, can be determined, and the block node receiving the data calculation request can respond to the request correspondingly, including returning target cloud data or rejecting the data access request. After the block node receiving the data calculation request receives the data calculation request, the corresponding target cloud data can be obtained according to the data calculation request, and homomorphic encryption is carried out on the target cloud data to obtain the cloud data. And the cloud data is sent to the block node for sending the data calculation request, after the block node for receiving the cloud data receives the cloud data, the data can be directly processed in an encrypted state, the obtained data is consistent with the result of the post-decryption processing, the time loss of encryption and decryption of the data can be reduced, and the data damage in the encryption and decryption processes is avoided.
Step S20: and determining adjacent block nodes according to the block nodes.
It should be noted that, the neighboring block node may be understood as a block node directly connected to the current block node, and in the blockchain, since the data is transferred between the nodes due to the decentration, the neighboring block node may be determined according to the communication time between the block nodes.
In a specific implementation, because there is a difference in the distance between the block nodes, when searching for the adjacent block nodes, the detection information can be initiated to the block node directly communicating with the current block node, receipt information of the detection information can be received, and the distance between the adjacent block nodes at the moment is judged according to the receipt information.
Further, the determining the neighboring block node according to the block node includes:
acquiring a node topological graph of the block chain;
determining the position of the block node in the node topological graph;
determining the position of a block node directly connected with the block node according to the position of the block node in the node topological graph;
calculating the distance between the nodes according to the positions of the block nodes in the node topological graph and the positions of the block nodes directly connected with the block nodes;
and determining adjacent block nodes according to the distance between the nodes.
In a specific implementation, referring to fig. 3, fig. 3 is a topology diagram of block nodes, from which a communication relationship between block nodes in a blockchain can be obtained. The reflected connection relationship in the topology map determines the location of the block node directly connected to the block node. Detecting the block nodes at the determined positions, determining whether the block nodes are in a working state or not, recording consumed time after receiving detection feedback of the corresponding block nodes, generating a block node distance table according to the nodes and the consumed time, and determining the distance between the block nodes according to the consumed time, wherein the longer the consumed time is, the longer the distance between the block nodes is. And finally, determining adjacent block nodes according to the distance between the block nodes.
Step S30: and distributing the cloud data to the block node and the adjacent block node, so that the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result.
The steps further include: dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and respectively calculating the block nodes and the adjacent block nodes to obtain a plurality of local calculation results consistent with the total number, wherein each block node is allocated with one cloud data block; and summarizing the plurality of local calculation results to obtain calculation results of the cloud data.
In a specific implementation, after the block node obtains the cloud data, the cloud data can be distributed to the adjacent block nodes, the block nodes and the adjacent block nodes form a plurality of edges, the data processing pressure of a single node can be shared, each block node can calculate according to the cloud data obtained by the block node, and finally, the obtained calculation result is output to the block node for executing the data calculation, so that the final calculation result is obtained.
Further, the dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, so that the block nodes and the adjacent block nodes calculate respectively to obtain a plurality of local calculation results consistent with the total number, including:
determining a computing service type according to the cloud data;
determining the number of the calculated service types, and comparing the number of the calculated service types with the number of the adjacent block nodes;
when the number of the calculated service types is smaller than the number of the adjacent block nodes, determining a difference value between the number of the adjacent block nodes and the number of the calculated service types;
determining the data quantity corresponding to the calculation service types, determining a target group according to the difference value, dividing the calculation service types with more data quantity on average according to the target group, binding the target group, and respectively calculating the block node and the adjacent block node to obtain a plurality of local calculation results consistent with the total quantity.
In a specific implementation, the total number of block nodes and adjacent block nodes can be determined, and the obtained cloud data is divided into cloud data blocks consistent with the total number, for example, the total number of block nodes and adjacent block nodes is 4, then the cloud data can be divided into 4 cloud data blocks, and the 4 cloud data blocks are respectively delivered to the corresponding block nodes for calculation, wherein the size of each cloud data block can be kept consistent, and can also be distinguished. Each block node can calculate according to the cloud data block to obtain a local calculation result when receiving the cloud data block which is responsible for processing, the obtained local calculation result can be transmitted to the block node which initiates the data calculation request after the calculation is finished, and the block node which initiates the data calculation request gathers all the local calculation results to obtain a calculation result of the cloud data.
Step S40: and synchronizing the calculation result to the block chain, and updating the data of the block chain.
In a specific implementation, before broadcasting the calculation result in the blockchain, the data state in the block node of the block node needs to be updated according to the calculation result, after the calculation result of cloud data is calculated by the block node, the current calculation result can be broadcasted, the broadcasting information comprises the state information of the current node, and after receiving the broadcasting information, the other block nodes can update the data state of the block node according to the data state information carried in the broadcasting.
According to the embodiment, cloud data is obtained according to the data calculation request of the block node, the adjacent block node is determined according to the block node, the cloud data is distributed to the block node and the adjacent block node, the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result, the calculation result is synchronized to the block chain, the data of the block chain is updated, the data with high data quantity and low delay sensitivity are migrated to the edge through the edge and the end, and therefore burden of the block chain is reduced, and data processing efficiency and safety of the block chain are improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a second embodiment of a blockchain-based secure computing method according to the present invention.
Based on the first embodiment, the blockchain-based security calculation method of the present embodiment further includes, before the step S10:
step S401: and receiving the block synchronization information of the block node.
Step S402: and sending state determining information to all block nodes in the block chain according to the block synchronizing information, so that all block nodes broadcast the block state information of the block nodes and output broadcast state information.
Step S403: and receiving the block chain state information processed by all the block nodes according to the broadcast state information.
Step S404: broadcasting the state information of the block chain in the block chain, comparing the state information of all the block nodes with the state information of all the block nodes according to the state information of the block chain, and updating the state information of all the block nodes into the state information of the block chain when the state information of the block chain is inconsistent with the state information of all the block nodes.
In a specific implementation, after the block nodes of the data calculation are completed, the block synchronization information can be initiated, the state information of each block node in the block chain is used for sending the state determination information to all nodes in the block chain after the block synchronization information of the block nodes is received, so that each block node in the block chain compares the own block state information with the state information in broadcasting, and simultaneously broadcasts the own state data.
Further, the receiving the blockchain status information processed by all blocknodes according to the broadcast status information includes:
generating a state vector table according to the broadcast state information, wherein the state vector table records the current state of each node;
classifying the current states of all nodes in the state vector table according to the state types, and outputting the current state corresponding to the type with the largest number as the blockchain state information.
It should be noted that the state vector table refers to a vector table that is used by a block node to determine state information in a node in the current blockchain.
In a specific implementation, in an ideal state, after data synchronization is completed, state information in each block node should be kept consistent, but in reality, various factors exist to cause failure of state data synchronization, so that data in the block nodes can not be successfully synchronized, therefore, in order to solve the problem, state data broadcasting can be initiated by the blocks, state information of corresponding blocks is carried in each broadcasting, a state vector table is generated for the broadcasting information and the state information of the corresponding blocks, when the vector table is constructed, the state information synchronized by the block nodes initiating data update is received first, and differences among the state information are determined based on the state information. After one node detects the state information of all other block nodes, the detection result of the state information can be classified, one classification with the largest quantity in the state information is counted, and the current classification is determined as the preliminary state information. Meanwhile, other partition nodes can obtain preliminary state information in the same way, determine block nodes with incomplete state synchronization according to the preliminary state information, and independently initiate forced update information to the block nodes with incomplete state synchronization, so that the data states of the block nodes are updated to be block chain state information.
Further, the step of synchronizing the calculation result to the blockchain, and after updating the blockchain data, further includes:
detecting the data capacity of the block chain, and when the data capacity is larger than a preset threshold value, adding a block node in the block chain;
and updating the topological graph of the blockchain according to the newly added blocknodes.
In a specific implementation, the data capacity of the current blockchain is detected to obtain a detection result, when the data capacity in the detection result is greater than a preset threshold value, it is indicated that the current blockchain may not be suitable for large-scale data operation, and potential safety hazards exist at the moment, so that the current blockchain can be used as a newly added blocknode, and of course, the newly added blocknode can be actively added into the current blockchain even when the data capacity is free. When a newly added block node is added into the block chain, data communication can be established with other block nodes in the block chain, and meanwhile, the newly added block node is used for updating the topological graph of the block chain.
According to the embodiment, after the block nodes complete data calculation, the state information of the block nodes are synchronized, after the synchronization, the state information of each block node in the current block chain can be updated, the consistency of block data is ensured, at the moment, each block node can obtain the state information received by each block node according to broadcast information in a broadcast mode, the information received by each block node is classified, the state information of the current block chain and the block nodes with incomplete state update are determined, corresponding updating measures are carried out, the data in the block chain tend to be consistent, and the safety of the block chain data is ensured.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium is stored with a blockchain-based security calculation program, and the blockchain-based security calculation program realizes the steps of the blockchain-based security calculation method when being executed by a processor.
Referring to FIG. 5, FIG. 5 is a block diagram of a first embodiment of a blockchain-based secure computing device of the present invention.
As shown in fig. 5, a blockchain-based secure computing device according to an embodiment of the present invention includes:
the data acquisition module 10 is configured to acquire cloud data according to a data calculation request of the block node;
a node confirmation module 20, configured to determine a neighboring block node according to the block node;
the data calculation module 30 is configured to allocate the cloud data to the block node and the adjacent block node, so that the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result;
and the state synchronization module 40 is configured to synchronize the calculation result to the blockchain, and update the data of the blockchain.
According to the embodiment, cloud data is obtained according to the data calculation request of the block node, the adjacent block node is determined according to the block node, the cloud data is distributed to the block node and the adjacent block node, the block node and the adjacent block node perform edge calculation on the cloud data to obtain a calculation result, the calculation result is synchronized to the block chain, the data of the block chain is updated, the data with high data quantity and low delay sensitivity are migrated to the edge through the edge and the end, and therefore burden of the block chain is reduced, and data processing efficiency and safety of the block chain are improved.
In one embodiment, the node confirmation module 20 is further configured to obtain a node topology map of the blockchain; determining the position of the block node in the node topological graph; determining the position of a block node directly connected with the block node according to the position of the block node in the node topological graph; calculating the distance between the nodes according to the positions of the block nodes in the node topological graph and the positions of the block nodes directly connected with the block nodes; and determining adjacent block nodes according to the distance between the nodes.
In an embodiment, the data calculation module 30 is further configured to determine a total number of the block nodes and the neighboring block nodes; dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and respectively calculating the block nodes and the adjacent block nodes to obtain a plurality of local calculation results consistent with the total number, wherein each block node is allocated with one cloud data block; and summarizing the plurality of local calculation results to obtain calculation results of the cloud data.
In an embodiment, the data obtaining module 10 is further configured to locate a target block node storing target cloud data according to the data calculation request of the block node; acquiring target cloud data from the target block node according to the data calculation request; and homomorphic encryption is carried out on the target cloud data to obtain the cloud data.
In an embodiment, the state synchronization module 40 is further configured to receive block synchronization information of the block node; transmitting state determining information to all block nodes in the block chain according to the block synchronizing information, so that all block nodes broadcast the block state information of the block nodes and output broadcast state information; receiving the block chain state information processed by all the block nodes according to the broadcast state information; broadcasting the state information of the block chain in the block chain, comparing the state information of all the block nodes with the state information of all the block nodes according to the state information of the block chain, and updating the state information of all the block nodes into the state information of the block chain when the state information of the block chain is inconsistent with the state information of all the block nodes.
In an embodiment, the state synchronization module 40 is further configured to generate a state vector table according to the broadcast state information, where the state vector table records a current state of each node; classifying the current states of all nodes in the state vector table according to the state types, and outputting the current state corresponding to the type with the largest number as the blockchain state information.
In an embodiment, the state synchronization module 40 is further configured to detect a data capacity of the blockchain, and when the data capacity is greater than a preset threshold, it is a newly added blocknode in the blockchain;
and updating the topological graph of the blockchain according to the newly added blocknodes.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily occurring in sequence, but may be performed alternately or alternately with other steps or at least a portion of the other steps or stages.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk) and comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A blockchain-based secure computing method, the blockchain-based secure computing method comprising:
acquiring cloud data according to the data calculation request of the block node;
determining adjacent block nodes according to the block nodes;
determining a total number of the block nodes and the neighboring block nodes;
dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and respectively calculating the block nodes and the adjacent block nodes to obtain a plurality of local calculation results consistent with the total number, wherein each block node is allocated with one cloud data block;
summarizing the plurality of local calculation results to obtain calculation results of the cloud data;
and synchronizing the calculation result to the block chain, and updating the data of the block chain.
2. The method of claim 1, wherein said determining neighboring tile nodes from said tile nodes comprises:
acquiring a node topological graph of the block chain;
determining the position of the block node in the node topological graph;
determining the position of a block node directly connected with the block node according to the position of the block node in the node topological graph;
calculating the distance between the nodes according to the positions of the block nodes in the node topological graph and the positions of the block nodes directly connected with the block nodes;
and determining adjacent block nodes according to the distance between the nodes.
3. The method of claim 1, wherein the dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and calculating the block nodes and the adjacent block nodes respectively, to obtain a plurality of local calculation results consistent with the total number, comprises:
determining a computing service type according to the cloud data;
determining the number of the calculated service types, and comparing the number of the calculated service types with the number of the adjacent block nodes;
when the number of the calculated service types is smaller than the number of the adjacent block nodes, determining a difference value between the number of the adjacent block nodes and the number of the calculated service types;
determining the data quantity corresponding to the calculation service types, determining a target group according to the difference value, dividing the calculation service types with more data quantity on average according to the target group, binding the target group, and respectively calculating the block node and the adjacent block node to obtain a plurality of local calculation results consistent with the total quantity.
4. The method of claim 1, wherein the obtaining cloud data according to the data calculation request of the block node comprises:
positioning a target block node storing target cloud data according to the data calculation request of the block node;
acquiring target cloud data from the target block node according to the data calculation request;
and homomorphic encryption is carried out on the target cloud data to obtain the cloud data.
5. The method of claim 1, wherein synchronizing the computation results to the blockchain, updating data of the blockchain, comprises:
receiving block synchronization information of the block node;
transmitting state determining information to all block nodes in the block chain according to the block synchronizing information, so that all block nodes broadcast the block state information of the block nodes and output broadcast state information;
receiving the block chain state information processed by all the block nodes according to the broadcast state information;
broadcasting the state information of the block chain in the block chain, comparing the state information of all the block nodes with the state information of all the block nodes according to the state information of the block chain, and updating the state information of all the block nodes into the state information of the block chain when the state information of the block chain is inconsistent with the state information of all the block nodes.
6. The method of claim 5, wherein said receiving blockchain status information processed by the all blocknodes in accordance with the broadcast status information comprises:
generating a state vector table according to the broadcast state information, wherein the state vector table records the current state of each node;
classifying the current states of all nodes in the state vector table according to the state types, and outputting the current state corresponding to the type with the largest number as the blockchain state information.
7. The method of claim 1, wherein synchronizing the calculation to the blockchain, after updating the blockchain data, further comprises:
detecting the data capacity of the block chain, and when the data capacity is larger than a preset threshold value, adding a block node in the block chain;
and updating the topological graph of the blockchain according to the newly added blocknodes.
8. A blockchain-based secure computing device for implementing the blockchain-based secure computing method of any of claims 1 to 7, the blockchain-based secure computing device comprising:
the data acquisition module is used for acquiring cloud data according to the data calculation request of the block node;
the node confirmation module is used for determining adjacent block nodes according to the block nodes;
a data calculation module for determining a total number of the block nodes and the neighboring block nodes; dividing the cloud data into cloud data blocks consistent with the adjacent block nodes, and respectively calculating the block nodes and the adjacent block nodes to obtain a plurality of local calculation results consistent with the total number, wherein each block node is allocated with one cloud data block; summarizing the plurality of local calculation results to obtain calculation results of the cloud data;
and the state synchronization module is used for synchronizing the calculation result to the block chain and updating the data of the block chain.
9. A blockchain-based secure computing device, the device comprising: a memory, a processor, and a blockchain-based security computing program stored on the memory and executable on the processor, the blockchain-based security computing program configured to implement the steps of the blockchain-based security computing method of any of claims 1 to 7.
10. A storage medium having stored thereon a blockchain-based security calculation program which when executed by a processor implements the steps of the blockchain-based security calculation method of any of claims 1 to 7.
CN202311685704.2A 2023-12-11 2023-12-11 Block chain-based secure computing method, device, equipment and storage medium Active CN117395305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311685704.2A CN117395305B (en) 2023-12-11 2023-12-11 Block chain-based secure computing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311685704.2A CN117395305B (en) 2023-12-11 2023-12-11 Block chain-based secure computing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117395305A true CN117395305A (en) 2024-01-12
CN117395305B CN117395305B (en) 2024-03-19

Family

ID=89463410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311685704.2A Active CN117395305B (en) 2023-12-11 2023-12-11 Block chain-based secure computing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117395305B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064579A (en) * 2019-12-11 2020-04-24 北京金汤科技有限公司 Block chain-based secure multi-party computing method, system and storage medium
CN112184219A (en) * 2020-09-22 2021-01-05 远光软件股份有限公司 Secure multiparty computing method, electronic device and storage medium
US20210120018A1 (en) * 2019-10-22 2021-04-22 Insolar Technologies GmbH Systems and methods for reaching consensus in a decentralized network
WO2023020233A1 (en) * 2021-08-18 2023-02-23 腾讯科技(深圳)有限公司 Blockchain-based data processing method, apparatus and device, and storage medium
CN116915379A (en) * 2023-08-10 2023-10-20 重庆邮电大学 Block chain privacy protection method and system based on homomorphic encryption algorithm and zero knowledge proof protocol

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210120018A1 (en) * 2019-10-22 2021-04-22 Insolar Technologies GmbH Systems and methods for reaching consensus in a decentralized network
CN111064579A (en) * 2019-12-11 2020-04-24 北京金汤科技有限公司 Block chain-based secure multi-party computing method, system and storage medium
CN112184219A (en) * 2020-09-22 2021-01-05 远光软件股份有限公司 Secure multiparty computing method, electronic device and storage medium
WO2023020233A1 (en) * 2021-08-18 2023-02-23 腾讯科技(深圳)有限公司 Blockchain-based data processing method, apparatus and device, and storage medium
CN116915379A (en) * 2023-08-10 2023-10-20 重庆邮电大学 Block chain privacy protection method and system based on homomorphic encryption algorithm and zero knowledge proof protocol

Also Published As

Publication number Publication date
CN117395305B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN110049087B (en) Credibility verification method, system, device and equipment of alliance chain
EP3800589A1 (en) Task processing method and apparatus
CN113672937B (en) Block chain link point
EP3258653A1 (en) Message pushing method and device
EP3937053A1 (en) Methods and apparatuses for transferring transaction based on dedicated blockchain node device
CN110046901B (en) Credibility verification method, system, device and equipment of alliance chain
CN108650333B (en) Method, medium, device and system for distributing node load in block chain system
CN106658665A (en) Method and apparatus for establishing wireless connection
CN112615905A (en) Method, device and equipment for scheduling block chain fragments and storage medium
JP2020013349A (en) History management method, history management device, and history management system
CN106407002A (en) Data processing task execution method and device
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
JP2020013347A (en) History management method and history management device
CN105636030A (en) Method and device for sharing access point
CN106331060B (en) WIFI-based deployment and control method and system
CN111405021A (en) Data transmission method, device, equipment and storage medium of peer-to-peer node
CN117395305B (en) Block chain-based secure computing method, device, equipment and storage medium
CN113342893B (en) Node synchronization method and device based on block chain, storage medium and server
US10200864B2 (en) Method and device for managing wireless access point
CN112235376A (en) Electric vehicle information monitoring method and device and electric vehicle management system
WO2019140644A1 (en) Data processing method, apparatus and system, mobile device and storage medium
CN106028303B (en) Intelligent device discovery method and device
CN111866845B (en) Data transmission method, device, equipment and computer readable storage medium
CN112383642A (en) Internet of things equipment data interaction method and device
CN111464395A (en) Method and device for creating block chain and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant