Blockchain-based data supervision method, device, electronic device, storage medium and program product
By optimizing the deployment of light nodes and building park chains and urban chains in the blockchain system, combining whale optimization algorithms and authentication modules, the inefficiency problem of blockchain systems when storing large amounts of device data is solved, and efficient data management and secure transmission are achieved.
Patent Information
- Application Number
- CN202510678788.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-26
AI Technical Summary
Existing blockchain systems are inefficient when storing large amounts of device data, and the demand for storage resources in the park is too high, making it difficult to effectively manage and supervise device data.
By obtaining the communication parameters and influencing factors of the blockchain system, building an objective function, using the whale optimization algorithm to determine the optimal deployment plan for light nodes, combining the blockchain network of the park chain and the city chain, it realizes fine division of equipment data storage and cross-domain communication, and uses authentication modules for cross-chain identity authentication and data supervision.
It alleviates the pressure of storing device data for all nodes in blockchain systems, improves the efficiency of storing large amounts of device data, maximizes the utilization of storage resources, and ensures data processing capabilities and transmission security.
Smart Images

Figure CN120200858B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital information transmission technology, and in particular to a blockchain-based data supervision method, device, electronic device, storage medium and program product. Background Art
[0002] Traditional wireless devices and sensor device deployment usually use the same type of devices to provide signal coverage for the area. Their data density is the same and their working capacity does not change with distance. The sensor site selection model models the sensor network coverage area.
[0003] Typically, a blockchain-based data supervision system uploads the data of regulators and regulated entities to the same blockchain, performs identity management, and uses channels for data isolation.
[0004] All peer nodes in the blockchain are full nodes, and each node records complete blocks. For the blockchain network, peer nodes will synchronize blocks with other peer nodes to ensure that they have the latest status.
[0005] When there are a large number of devices in a park, and each device generates a large amount of data, if all nodes in the blockchain network store complete blocks, the park's storage resource requirements will become a challenge. Summary of the Invention
[0006] The present invention provides a blockchain-based data supervision method, device, electronic device, storage medium and program product, which are used to solve the defect of low efficiency when storing a large amount of device data based on blockchain in the existing technology, and to improve the efficiency of blockchain when storing a large amount of device data.
[0007] In a first aspect, the present invention provides a blockchain-based data supervision method, comprising: obtaining an average communication round-trip delay of a blockchain system, a decibel value of an average transmit-receive power ratio of the blockchain system, a data transmission distance between a light node of the blockchain system and a device node of the blockchain system, a data reception threshold of the blockchain system, a signal strength reception threshold within the blockchain system, a network throughput threshold of the blockchain system, and a light node utilization threshold; the light node is used to collect device data of the device node; constructing an objective function based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, a first influencing factor, and a second influencing factor; determining a constraint set of the objective function based on the data transmission distance, the data reception threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold; solving an optimal solution to the objective function based on the constraint set and a whale optimization algorithm to obtain an optimal deployment plan; obtaining a campus chain of the blockchain system based on the optimal deployment plan, storing device data based on the campus chain, and obtaining a target block header; supervising the target block header based on the city chain, the campus chain, and the authentication module of the blockchain system, wherein the authentication module is used to connect the city root authentication center CA of the city chain and the campus root CA of the campus chain, and the city chain is used to store the target block header;
[0008] The authentication module is constructed based on the following steps: cross-certify the campus root CA and the bridge CA of the authentication module to obtain the campus root certificate and the campus bridge certificate; the campus root certificate is used to authenticate the communication from the bridge CA to the campus root CA, and the campus bridge certificate is used to authenticate the communication from the campus root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; construct a campus proxy certificate, and the campus proxy certificate is used for communication authentication from the campus root CA to the campus proxy end of the campus chain; construct a city proxy certificate, and the city proxy certificate is used for communication authentication from the city root CA to the city proxy end of the city chain; based on the campus root certificate, campus bridge certificate, city root certificate, city bridge certificate, campus proxy certificate and city proxy certificate, obtain the authentication module.
[0009] In one embodiment, the campus chain includes light nodes, campus sorting nodes and full nodes, and stores device data based on the campus chain, including: collecting device data based on the light nodes and sending the device data to the campus sorting nodes; packaging the device data into the blocks of the campus chain based on the campus sorting nodes, and sending the packaged campus chain blocks to the full nodes; storing the packaged campus chain blocks and device index tables in the buffer pool of the campus chain based on the full nodes to complete the storage of the device data, and sending the target block header to the light node for the light node to update the storage data of the campus chain based on the target block header. The device index table includes a mapping relationship between the target block header and the device node.
[0010] In one embodiment, device data is packaged into the blocks of the campus chain based on the campus sorting node, including: sorting the device data based on the IP of the device node, constructing a first Merkle tree based on the hash value of the sorted device data, storing the tree node hash value of the first Merkle tree into the block body of the campus chain, and storing the root node hash value of the first Merkle tree into the block header of the campus chain to package the device data into the blocks of the campus chain.
[0011] In one embodiment, the city chain includes a city agent, a supervisory node and a city sorting node. The city chain, the park chain and the authentication module based on the blockchain system supervise the target block header, including: based on the park agent and the authentication module of the park chain, sending the target block header to the city agent, endorsing the target block header to the supervisory node based on the city agent, and sending the endorsement result and the target block header to the city sorting node; based on the city sorting node, packaging the target block header into the block of the city chain to obtain the packaged city chain block, and sending the packaged city chain block to the supervisory node; based on the endorsement result of the supervisory node and the target block header, checking and storing the packaged city chain block.
[0012] In one embodiment, the target block header is packaged into the block of the city chain based on the city sorting node, including: sorting the target block header based on the city sorting node, constructing a second Merkle tree based on the hash value of the sorted target block header, storing the tree node hash value of the second Merkle tree into the block body of the city chain, and storing the root node hash value of the second Merkle tree into the block header of the city chain, so as to package the target block header into the block of the city chain.
[0013] In a second aspect, the present invention provides a data supervision device based on blockchain, including: a communication optimization module for obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system and the light node utilization threshold; the light node is used to collect device data of the device node; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, an objective function is constructed; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold and the light node utilization threshold, a constraint condition set of the objective function is determined; based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan; the first supervision module is used to obtain the park chain of the blockchain system based on the optimal deployment plan, and obtain the target block header based on the park chain storage device data; the second supervision module is used to obtain the target block header based on the city chain of the blockchain system The city chain, park chain and authentication module supervise the target block header. The authentication module is used to connect the communication between the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is used to store the target block header; the authentication module is constructed based on the following steps: cross-certify the park root CA and the bridge CA of the authentication module to obtain the park root certificate and the park bridge certificate; the park root certificate is used to authenticate the communication from the bridge CA to the park root CA, and the park bridge certificate is used to authenticate the communication from the park root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; construct a park proxy certificate, and the park proxy certificate is used for communication authentication from the park root CA to the park proxy end of the park chain; construct a city proxy certificate, and the city proxy certificate is used for communication authentication from the city root CA to the city proxy end of the city chain; based on the park root certificate, the park bridge certificate, the city root certificate, the city bridge certificate, the park proxy certificate and the city proxy certificate, obtain the authentication module.
[0014] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned blockchain-based data supervision methods.
[0015] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned blockchain-based data supervision methods.
[0016] In a fifth aspect, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned blockchain-based data supervision methods.
[0017] The blockchain-based data supervision method, device, electronic device, storage medium and program product provided by the present invention greatly alleviate the pressure on all nodes in the blockchain system to store device data by obtaining the optimal deployment plan for light nodes, and improve the efficiency of storing a large amount of device data in the blockchain at the same time. By storing device data through the park chain and storing target block headers through the city chain, each park can upload different device data to the chain according to its own needs, maximize the use of the storage resources of the city chain and the park chain, and improve the data processing capacity of the entire blockchain system. The present invention connects the city root CA and the park root CA through the authentication module, realizes cross-domain communication between the city chain and the park chain, and also ensures the data transmission security between the city chain and the park chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is one of the flow charts of the blockchain-based data supervision method provided by the present invention.
[0020] Figure 2 This is the second flow chart of the blockchain-based data supervision method provided by the present invention.
[0021] Figure 3 It is a flow chart of determining the optimal deployment solution provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the block structure of the park chain provided by the present invention.
[0023] Figure 5 It is a schematic diagram of the block structure of the city chain provided by the present invention.
[0024] Figure 6 It is a structural diagram of the light node provided by the present invention.
[0025] Figure 7 It is a structural diagram of the authentication module provided by the present invention.
[0026] Figure 8 This is the third flow chart of the blockchain-based data supervision method provided by the present invention.
[0027] Figure 9 It is a schematic diagram of the communication domain of the light node and the communication domain of the device node provided by the present invention.
[0028] Figure 10 It is a structural diagram of the blockchain-based data supervision device provided by the present invention.
[0029] Figure 11 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0031] The following combination Figures 1-11 The present invention describes the blockchain-based data supervision method, device and electronic device.
[0032] Figure 1 This is one of the flow charts of the data supervision method based on blockchain provided by the present invention, such as Figure 1 As shown, the blockchain-based data supervision method includes steps S100 to S300, and the details of each step are as follows.
[0033] S100: Determine the optimal deployment plan for light nodes of the blockchain system based on factors affecting the communication delay of the blockchain system and the signal strength of the blockchain system; the light nodes are used to collect device data of device nodes of the blockchain system.
[0034] Based on the communication delay of the blockchain system and the signal strength influencing factors of the blockchain system, the optimal deployment plan of the light nodes of the blockchain system is determined, including: obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light nodes of the blockchain system and the device nodes of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; the light nodes are used to collect device data of the device nodes; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, the objective function is constructed; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold, the constraint condition set of the objective function is determined; based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan.
[0035] Traditional wireless device deployment has a single factor impacting it, making it unsuitable for light node deployment. The blockchain system of this invention considers the gradual decrease in light node data processing capacity over distance and the data density of campus sensor networks, using the whale optimization algorithm to determine the most cost-effective light node deployment solution.
[0036] like Figure 2 As shown, the blockchain system of the present invention includes a Whale Optimization Algorithm (WOA) communication optimization module, a blockchain network, and a data verification module. The WOA communication optimization module determines the optimal deployment plan for the campus chain's light nodes, improving the efficiency of wireless device access within the campus. The blockchain network protects key data in the blockchain system from tampering. Full nodes in the campus chain submit block headers to the campus agent, which then packages and uploads them to the city chain for data monitoring. The city agent uses the data verification module to check whether device data has been tampered with.
[0037] The number of device nodes within a campus is enormous, and each generates a large amount of data. If all peer nodes in the blockchain network stored complete blocks, the campus's storage resources would be a challenge. Therefore, the blockchain system of this invention introduces light nodes, which only store block headers locally, saving the campus significant storage costs. Light nodes are responsible for uploading device data to the blockchain, while full nodes in the campus chain are responsible for storing and verifying device data, significantly alleviating the pressure on peer nodes in the blockchain network.
[0038] There are clusters of wireless devices (device nodes) in the park With light node cluster , the number of device nodes is , the number of light nodes is .like Figure 9As shown, the device node With light nodes Wireless communication is used for data transmission, and the signal domains of the two can be abstracted as a sphere centered on the device node. The device node needs to transmit data to the light node via wireless signals. After the light node is on the chain, it needs to return the on-chain results to the device node via wireless signals. Therefore, both the device node and the light node must be within each other's communication domain to ensure normal data transmission and reception. In this case, the device node and the light node are considered to be connected to each other, and communication can be carried out.
[0039] Since wireless devices (device nodes) within the campus are deployed in an uneven distribution, the amount of data required to be uploaded to the link for each wireless device is different, and the signals of light nodes and wireless devices attenuate as the distance between them increases, it is necessary to find the most cost-effective deployment method for light nodes so that wireless device clusters and light node clusters can upload high-quality data to the link.
[0040] Wireless communication quality is measured by a variety of factors, including signal strength, bit error rate, data transmission rate, bandwidth, network latency, wireless signal coverage, and communication connection stability. Network latency is related to data transmission rate and bandwidth. While signal strength does not affect data transmission rate, it can affect bit error rate and communication connection stability, indirectly impacting network latency. For example, poor signal strength increases bit error rate, leading to data retransmissions and overall network latency. Wireless device signal coverage indirectly influences the deployment location of light node clusters within a campus.
[0041] Based on the above background, it is necessary to find the optimal communication delay, wireless signal strength, and deployment location and number of light nodes in the park between the light node cluster and the wireless device cluster.
[0042] like Figure 6 As shown in the figure, the internal structure of a light node consists of four parts: the Software Development Kit (SDK), chaincode, endorsements, and the local ledger. The SDK converts device data into transaction proposals, including the parameters required to invoke the chaincode. Chaincode is the program running on the blockchain. Endorsements are primarily used to verify transaction proposals, simulate transactions, and issue endorsement certificates. The local ledger contains the block header data maintained by the full node.
[0043] S200: Obtain the campus chain of the blockchain system based on the optimal deployment plan, and obtain the target block header based on the campus chain storage device data.
[0044] The campus chain includes light nodes, campus sorting nodes and full nodes, and stores device data based on the campus chain, including: collecting device data based on light nodes and sending the device data to the campus sorting nodes; packaging the device data into the blocks of the campus chain based on the campus sorting nodes, and sending the packaged campus chain blocks to the full nodes; storing the packaged campus chain blocks and device index tables in the buffer pool of the campus chain based on the full nodes to complete the storage of device data, and sending the target block header to the light node for the light node to update the storage data of the campus chain based on the target block header. The device index table includes the mapping relationship between the target block header and the device node.
[0045] The campus chain consists of light nodes, full nodes, and campus ordering nodes. The optimal deployment plan includes the number and location of light nodes. The campus chain is deployed, its data is uploaded to the chain, and the smart contract for reporting data to the chain is deployed. The campus root CA for the campus chain is registered in the authentication module. Each device node is directly connected to an appropriate light node. The device node transmits device data to the light node. The light node's built-in SDK generates a transaction proposal, simulates the transaction, and returns an endorsement result. The light node then incorporates the endorsement into the transaction proposal and sends it to the campus ordering node, completing the on-chain upload of the device data. The campus ordering node sorts the transaction proposals and packages the device data in the transaction proposal into the campus chain block. The packaged campus chain block is then sent to a full peer. The full peer verifies the packaged campus chain block. If it is correct, it updates the status of the campus chain's stored data and places the target block header containing the device data into the buffer pool of the campus proxy on the campus chain. The correspondence between the target block header and the device node is added to the device index table and the target block header is returned to the light node. The light node updates the storage data of the park chain based on the received target block header.
[0046] The present invention collects and chains device data based on light nodes, sorts and packages the device data after being chained based on park sorting nodes, and stores the device data after being chained based on full nodes, thereby realizing a fine division of labor for storing device data in the blockchain system and improving the data processing capability of the blockchain system.
[0047] S300: Based on the city chain, park chain and authentication module of the blockchain system, the target block header is supervised. The authentication module is used to connect the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is used to store the target block header.
[0048] Since each park is only interested in the device data within its own park and does not need to see the data of other parks, supervisory agencies are only concerned with the authenticity of the data and the overall status of each park. Therefore, detailed information about the equipment data within a park is not a priority. If all parks and regulatory agencies were placed on a single blockchain network, the blockchain network would inevitably be extremely large and resource-intensive. Therefore, the blockchain system of the present invention is designed as two blockchain networks: a park chain and a city chain, each of which stores different data according to its needs. The park chain only stores device data, while the city chain only stores the block header data of the park chain. This reduces the storage resources consumed by a single blockchain network and improves the overall data processing capacity of the system. In this scenario, the amount of industrial data generated by each park is enormous. Directly parsing this data at the blockchain network layer would inevitably place a significant burden on the network. Furthermore, since the city chain is primarily concerned with the authenticity of the data within each park, cross-chain parsing is unnecessary. Furthermore, the blockchain system of the present invention incorporates an identity authentication system (authentication module) based on Public Key Infrastructure (PKI) and Hyperledger Fabric Certificate Authority (Fabric CA), enabling rapid integration of heterogeneous park chains into the blockchain system and cross-chain communication.
[0049] The blockchain-based data supervision method provided by the embodiment of the present invention greatly alleviates the pressure on all nodes in the blockchain system to store device data by obtaining the optimal deployment plan for light nodes, and improves the efficiency of storing a large amount of device data in the blockchain at the same time. By storing device data through the park chain and storing target block headers through the city chain, each park can upload different device data to the chain according to its own needs, maximize the use of the storage resources of the city chain and the park chain, and improve the data processing capacity of the entire blockchain system. The present invention connects the city root CA and the park root CA through the authentication module, realizes cross-domain communication between the city chain and the park chain, and also ensures the data transmission security between the city chain and the park chain.
[0050] Based on the above embodiment, the authentication module is constructed based on the following steps: cross-certify the campus root CA and the bridge CA of the authentication module to obtain the campus root certificate and the campus bridge certificate; the campus root certificate is used for authentication of communication from the bridge CA to the campus root CA, and the campus bridge certificate is used for authentication of communication from the campus root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used for authentication of communication from the bridge CA to the city root CA, and the city bridge certificate is used for authentication of communication from the city root CA to the bridge CA; construct a campus proxy certificate, and the campus proxy certificate is used for communication authentication from the campus root CA to the campus proxy end of the campus chain; construct a city proxy certificate, and the city proxy certificate is used for communication authentication from the city root CA to the city proxy end of the city chain; based on the campus root certificate, campus bridge certificate, city root certificate, city bridge certificate, campus proxy certificate and city proxy certificate, obtain the authentication module.
[0051] The campus agent has a built-in buffer pool, device index table, and block header index table. The buffer pool receives target block headers transmitted by the campus full nodes. When the buffer pool is full or reaches a set timeout, all target block headers in the buffer pool are packaged into a transaction proposal. The device index table records the target block headers and device node IP addresses in a key:value format. The block header index table records the transaction hash (the hash value of the target block header) and the target block header list sent to the city chain in a key:value format. The campus agent also runs various device data statistics and management platforms.
[0052] The city client is responsible for packaging transaction proposals, verifying node endorsements, and sending endorsed proposals to the sorting node. The city proxy also runs a data verification module and can also run tampering and alarm platforms.
[0053] like Figure 2 and Figure 7 As shown in the figure, the authentication module performs identity verification for network nodes communicating between the campus chain and the city chain. This module utilizes a bridge-proxy model to address the independent nature of the campus and city chains. While retaining the CAs of different chains, it proposes a Super Fabric CA module to facilitate identity authentication for cross-chain communication. The authentication module is essentially PKI. Using the "bridge-proxy" authentication method of the networked PKI model, a bridge CA is introduced to connect the root CAs of different PKI domains and simultaneously issue cross-certification certificates to each other.
[0054] Cross-certify the campus root CA with the authentication module's bridge CA, and cross-certify the city root CA with the bridge CA, establishing a chain of trust between each campus and city regulatory agency. The cross-certificates between the bridge CA and the campus root CA are the campus root certificate and the campus bridge certificate. The cross-certificates between the bridge CA and the city root CA are the city root certificate and the city bridge certificate.
[0055] The campus root CA authenticates communication with the campus agent in the campus chain using a campus agent certificate. The city root CA authenticates communication with the city agent in the city chain using a city agent certificate.
[0056] In the authentication module, the authentication path from the park agent to the city agent is as follows.
[0057] .
[0058] In the authentication module, the authentication path from the city agent to the park agent is as follows.
[0059] .
[0060] The present invention cross-certifies the park root CA and bridge CA, and cross-certifies the city root CA and bridge CA, thereby opening up the communication between each park chain and the city chain. Each park chain can report different device data according to its own needs.
[0061] Furthermore, the data verification module of the blockchain system is used to verify the data of the blockchain. Figure 2 As shown in the figure, the data verification module sends three different data verification requests to the city agent: one for the city chain block, one for a specific park, and one for the device node in that park. The city agent sends the data verification request to the park agent. After receiving the data verification request, the park client retrieves the target block header to be verified.
[0062] (1) If checking according to a certain block: After the park client receives the data verification request, it retrieves the target block header of the park chain from the block header index table based on the transaction ID.
[0063] (2) If checking by device node: After receiving the request, the park client retrieves the target block header of the park chain from the device index table based on the IP of the device node.
[0064] (3) If checking by park: After receiving the request, the park client retrieves the target block header of the park chain from the full node of the park chain in block order.
[0065] The campus client retrieves the transaction corresponding to the target block header (stored device data) from the full node and obtains the original on-chain data of the device.
[0066] The campus client retrieves the corresponding device data from the device nodes involved in the transaction and calculates the Merkle root hash according to the Merkle tree construction rules.
[0067] Compare the Merkle root hashes to see if they are the same. If they are the same, the device data has not been tampered with; if they are different, the device data has been tampered with. At this time, the original data and the tampered data are sent to the city agent together to issue a warning to the supervisory agency (authentication module).
[0068] Based on the above embodiment, an optimal deployment plan for light nodes in the blockchain system is determined based on the communication delay of the blockchain system and the signal strength influencing factors of the blockchain system, including: obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node and the device node, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; constructing an objective function based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor; determining a constraint set of the objective function based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold; and solving the optimal solution of the objective function based on the constraint set and the whale optimization algorithm to obtain the optimal deployment plan.
[0069] An objective function is constructed based on the average communication round-trip delay, the average transmit-receive power ratio, the first influencing factor and the second influencing factor.
[0070] ;
[0071] in, ;
[0072] ;
[0073] ;
[0074] ;
[0075] ;
[0076] ;
[0077] ;
[0078] ;
[0079] in, is the objective function, The first impact factor is The second impact factor is is the average round-trip delay of the blockchain system, is the decibel value of the average transmit-receive power ratio of the blockchain system, For device node clusters The average delay in sending device data, For light node clusters Average latency in processing device data, For device nodes (wireless devices) The average round-trip delay between sending device data and processing it by the light node cluster. is the number of device nodes, For device nodes Send device data and light node The round-trip latency of processing device data, is the number of light nodes, For light nodes The obtained device node The amount of device data, For device nodes With light nodes The probability of mutual communication, For device nodes With light nodes The data transmission distance between For device nodes The data transmission rate, is the electromagnetic wave transmission rate, For light nodes Data uplink rate, For light nodes its own data processing capabilities, For device nodes The total amount of data that needs to be uploaded to the chain, For light nodes The total amount of data to be sent, For device nodes The communication radius, For light nodes The communication radius, For device nodes The horizontal coordinate, vertical coordinate and Z-axis coordinate, For light nodes The horizontal coordinate, vertical coordinate and Z-axis coordinate, For light nodes The average round-trip delay of sending data while the device node cluster processes the data, For light nodes Send data, while the device node The round-trip latency of processing device data, For device nodes Divide into light nodes The amount of data, For device nodes its own data processing capabilities, For device node clusters Send device data and light node cluster The decibel value of the target average transmit-receive power ratio of received data, For light node clusters Send device data and device node cluster The decibel value of the target average transmit-receive power ratio of received data, For device nodes Send device data, all access The decibel value of the target average transmit-receive power ratio of the light node receiving device data, For device nodes Send device data and light node The decibel value of the target average transmit / receive power ratio of the receiving device data, For device nodes Send device data and light node Receive device data The decibel value of the transmit-receive power ratio, is the number of times, For light nodes The received power of For device nodes The transmission power, For device nodes A constant coefficient that depends on antenna characteristics and average channel loss, is the path loss exponent, For device nodes The antenna far-field reference distance, for Sub-Gaussian random values, For light nodes Send data, all access The decibel value of the target average transmit-receive power ratio of the device node receiving data, For light nodes Send data, while the device node The decibel value of the target average transmit-receive power ratio of received data, For light nodes Send data, while the device node Receive data The decibel value of the transmit-receive power ratio, For device nodes The received power of For light nodes The transmission power, For light nodes A constant coefficient that depends on antenna characteristics and average channel loss, For light nodes The antenna far-field reference distance, for Sub-Gaussian random values.
[0080] The constraint condition set of the objective function is determined based on the data transmission distance, data reception amount threshold, signal strength reception threshold, network throughput threshold and light node utilization threshold.
[0081] If wireless device (device node) With light nodes To be able to communicate with each other, the data transmission distance between the light node and the device node must be less than that of the light node. Communication radius and device nodes The communication radius of , we get the first constraint.
[0082] First constraint:
[0083] in, For device nodes With light nodes The data transmission distance between For device nodes The communication radius, For light nodes communication radius.
[0084] Data reception threshold includes device nodes The maximum amount of data that it can process, and the light node The maximum amount of data that the system can process. Construct the second constraint.
[0085] The second constraint:
[0086] in, For light nodes The obtained device node The amount of device data, For device nodes Divide into light nodes The amount of data, is the number of device nodes, is the number of light nodes, For device nodes The maximum amount of data it can process. For light nodes The maximum amount of data that it can process.
[0087] The signal strength receiving threshold includes the minimum receiving power. The receiving power of the device is not less than the data transmission distance. The minimum received power required by the light node at device node The receiving power of the device is not less than the data transmission distance. The minimum received power required by the device node at . Construct the third constraint.
[0088] The third constraint:
[0089] in, For light nodes The received power of The data transmission distance is The minimum receiving power required by the light node at The data transmission distance is The minimum received power required by the device node at For device nodes The received power of itself.
[0090] The fourth constraint is that the blockchain system's network throughput must be above the network throughput threshold. If the blockchain system's network throughput falls below the network throughput threshold, it indicates network congestion. This can be improved by reducing the data transmission rate or increasing the number of light nodes.
[0091] If the data transmission rate is reduced, WOA needs to start again from 0 to calculate the required number of light nodes and the location of light nodes, which is suitable for situations where the cost of light nodes is high.
[0092] If the number of light nodes is increased, WOA needs to start from the current number of determined light nodes + 1 to calculate the required number of light nodes and the location of the light nodes, which is suitable for situations where the cost of light nodes is not high.
[0093] The fifth constraint is that the utilization rate of each light node in the blockchain system must be less than or equal to the light node utilization threshold. When the light node utilization rate exceeds the light node utilization threshold, it indicates that the number of light nodes should be appropriately increased to alleviate the pressure on the light node cluster to process device data.
[0094] Based on the first, second, third, fourth, and fifth constraints, a constraint set is obtained. Using this constraint set and the Whale Optimization algorithm, the optimal solution to the objective function is found. The specific steps are as follows.
[0095] The maximum number of light nodes in the park chain is determined based on the economic capacity of the park. Figure 3As shown, obtain the current number W of light nodes in the campus chain at the current moment. Compare the current number of light nodes with the maximum number. If W is less than the maximum number, solve the optimal solution of the objective function at the current moment based on the constraint condition set. Obtain the number of light nodes W-1 at the previous moment and the optimal solution of the corresponding objective function at the previous moment. Compare whether the optimal solution at the current moment is better than the optimal solution at the previous moment. If the optimal solution at the current moment is better than the optimal solution at the previous moment, add 1 to the current number of light nodes and obtain the number of light nodes at the next moment. Iterate the optimal solution of the objective function at the next moment according to the above steps until the number of light nodes is equal to the maximum number, terminate the iteration, and obtain the optimal solution of the objective function; or until the optimal solution at the current moment is worse than the optimal solution at the previous moment, terminate the iteration, and obtain the optimal solution of the objective function.
[0096] The present invention combines the whale optimization algorithm with the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the data transmission distance, the data reception threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold to solve the optimal deployment plan, thereby achieving the optimal deployment of light nodes in the park chain, which is conducive to improving the data processing capability of the blockchain system.
[0097] Based on the above embodiment, the device data is packaged into the block of the campus chain based on the campus sorting node, including: sorting the device data based on the IP of the device node, constructing a first Merkle tree based on the hash value of the sorted device data, storing the tree node hash value of the first Merkle tree in the block body of the campus chain, and storing the root node hash value of the first Merkle tree in the block header of the campus chain to package the device data into the block of the campus chain.
[0098] like Figure 4 As shown, the device data is sorted according to the IP of the device node, and the hash value of each device data is obtained in turn according to the sorting result. The first Merkle tree is constructed based on the hash value of all sorted device data. The hash value of each tree node of the first Merkle tree is stored in the Merkle tree hash list in the block body of the park chain (for example, the Merkle tree hash list includes transaction A hash, transaction B hash, transaction C hash, transaction D hash, transaction E hash, etc.), and the root node hash value of the first Merkle tree is stored in the transaction root hash in the block header of the park chain, thereby completing the packaging of the device data into the block of the park chain. As shown Figure 4As shown, the root node hash value of the first Merkle tree is HABCDE. HABCDE = Hash (HABCD + HE). The hash values of the nodes of the first Merkle tree include HA, HB, HC, HD, HE, HAB, HCD, and HABCD. HA is the hash value of device data A, HB is the hash value of device data B, HC is the hash value of device data C, HD is the hash value of device data D, and HE is the hash value of device data E. HAB = Hash (HA + HB). HCD = Hash (HC + HD). HABCD = Hash (HAB + HCD).
[0099] The present invention constructs a first Merkle tree according to the hash value of the device data, thereby improving the efficiency of the blockchain system in packaging data of multiple devices at the same time.
[0100] Based on the above embodiment, the city chain includes a city agent terminal, a supervisory node and a city sorting node. The city chain, the park chain and the authentication module based on the blockchain system supervise the target block header, including: based on the park agent terminal and the authentication module of the park chain, sending the target block header to the city agent terminal, endorsing the target block header to the supervisory node based on the city agent terminal, and sending the endorsement result and the target block header to the city sorting node; based on the city sorting node, packaging the target block header into the block of the city chain to obtain the packaged city chain block, and sending the packaged city chain block to the supervisory node; based on the endorsement result of the supervisory node and the target block header, checking and storing the packaged city chain block.
[0101] Deploy the city chain and the smart contract for the city chain’s data on-chain. Register the city chain’s root CA in the authentication module.
[0102] like Figure 2 and Figure 8 As shown, when the park agent's buffer pool is full, the park agent communicates with the city agent through the authentication module and sends the packaged target block header to the city agent. The packaged target block header includes a block header index table. The city agent receives the packaged target block header and packages a transaction proposal based on it. It then sends the transaction proposal to a supervisory peer for endorsement. The supervisory peer verifies the proposal and simulates a transaction to endorse it. After endorsement is complete, it returns the endorsement result to the city agent. The city agent writes the endorsement result into the transaction proposal (which now includes the endorsement result and the target block header) and sends it to the city sorting node. The city sorting node sorts the transaction proposals containing the endorsement result, packages the sorted transaction proposals into the city chain block, and sends the packaged city chain block to the supervisory peer. The supervisory peer verifies and stores the packaged city chain block and updates the city chain storage data.
[0103] The present invention sorts and packages the target block headers according to the city sorting nodes of the city chain, and only stores the target block headers through the supervision node supervision city chain, which saves storage costs for the city chain.
[0104] Based on the above embodiment, the target block header is packaged into the block of the city chain based on the city sorting node, including: sorting the target block header based on the city sorting node, constructing a second Merkle tree based on the hash value of the sorted target block header, storing the tree node hash value of the second Merkle tree in the block body of the city chain, and storing the root node hash value of the second Merkle tree in the block header of the city chain, so as to package the target block header into the block of the city chain.
[0105] like Figure 5 As shown, the target block headers are sorted, and a second Merkle tree is constructed based on the hash values of all sorted target block headers (the root node hash values of the first Merkle tree). The hash values of each tree node of the second Merkle tree are stored in the Merkle tree hash list in the block body of the city chain (for example, the Merkle tree hash list includes transaction A, transaction B, transaction C, transaction D, transaction E, etc.), and the root node hash value of the second Merkle tree is stored in the transaction root hash in the block header of the city chain, thereby completing the packaging of the target block header into the block of the city chain. Figure 5 As shown, the root node hash value of the second Merkle tree is HABCDE. HABCDE = Hash (HABCD + HE). The hash values of the tree nodes of the second Merkle tree include HA (transaction A), HB (transaction B), HC (transaction C), HD (transaction D), HE (transaction E), HAB, HCD, and HABCD. HA is the hash value of the target block header A, HB is the hash value of the target block header B, HC is the hash value of the target block header C, HD is the hash value of the target block header D, and HE is the hash value of the target block header E. HAB = Hash (HA + HB). HCD = Hash (HC + HD). HABCD = Hash (HAB + HCD).
[0106] The present invention constructs a second Merkle tree according to the hash value of the target block header, thereby improving the efficiency of the blockchain system in packaging multiple target block headers at the same time.
[0107] The blockchain-based data supervision device provided by the present invention is described below. The blockchain-based data supervision device described below and the blockchain-based data supervision method described above can be referenced to each other.
[0108] like Figure 10As shown, a blockchain-based data supervision device includes: a communication optimization module 1001, which is used to obtain the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; the light node is used to collect device data of the device node; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, an objective function is constructed; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold, a constraint condition set of the objective function is determined; based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan.
[0109] The first supervision module 1002 is used to obtain the campus chain of the blockchain system based on the optimal deployment plan, and obtain the target block header based on the campus chain storage device data.
[0110] The second supervision module 1003 is used to supervise the target block header based on the city chain, park chain and authentication module of the blockchain system. The authentication module is used to connect the communication between the city root authentication center CA of the city chain and the park root CA of the park chain, and the city chain is used to store the target block header; the authentication module is constructed based on the following steps: cross-certify the park root CA and the bridge CA of the authentication module to obtain the park root certificate and the park bridge certificate; the park root certificate is used to authenticate the communication from the bridge CA to the park root CA, and the park bridge certificate is used to authenticate the communication from the park root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; construct a park agent certificate, and the park agent certificate is used for communication authentication from the park root CA to the park agent end of the park chain; construct a city agent certificate, and the city agent certificate is used for communication authentication from the city root CA to the city agent end of the city chain; based on the park root certificate, the park bridge certificate, the city root certificate, the city bridge certificate, the park agent certificate and the city agent certificate, obtain the authentication module.
[0111] The blockchain-based data supervision device provided by the embodiment of the present invention greatly alleviates the pressure on all nodes in the blockchain system to store device data by obtaining the optimal deployment plan for light nodes, and improves the efficiency of storing a large amount of device data in the blockchain at the same time. By storing device data through the park chain and storing target block headers through the city chain, each park can upload different device data to the chain according to its own needs, maximize the use of the storage resources of the city chain and the park chain, and improve the data processing capacity of the entire blockchain system. The present invention connects the city root CA and the park root CA through the authentication module, realizes cross-domain communication between the city chain and the park chain, and also ensures the data transmission security between the city chain and the park chain.
[0112] In one embodiment, the campus chain includes light nodes, campus sorting nodes and full nodes. The first supervision module 1002 is used to: collect device data based on the light nodes and send the device data to the campus sorting nodes; package the device data into the blocks of the campus chain based on the campus sorting nodes, and send the packaged campus chain blocks to the full nodes; store the packaged campus chain blocks and device index tables in the buffer pool of the campus chain based on the full nodes to complete the storage of the device data, and send the target block header to the light node for the light node to update the storage data of the campus chain based on the target block header. The device index table includes the mapping relationship between the target block header and the device node.
[0113] In one embodiment, the first supervision module 1002 is used to: sort the device data based on the IP of the device node, construct a first Merkle tree based on the hash value of the sorted device data, store the tree node hash value of the first Merkle tree in the block body of the campus chain, and store the root node hash value of the first Merkle tree in the block header of the campus chain to package the device data into the block of the campus chain.
[0114] In one embodiment, the city chain includes a city agent, a supervisory node and a city sorting node, and the second supervisory module 1003 is used to: based on the park agent and the authentication module of the park chain, send the target block header to the city agent, endorse the target block header to the supervisory node based on the city agent, and send the endorsement result and the target block header to the city sorting node; based on the city sorting node, package the target block header into the block of the city chain to obtain the packaged city chain block, and send the packaged city chain block to the supervisory node; based on the endorsement result of the supervisory node and the target block header, check and store the packaged city chain block.
[0115] In one embodiment, the second supervision module 1003 is used to: sort the target block header based on the city sorting node, construct a second Merkle tree based on the hash value of the sorted target block header, store the tree node hash value of the second Merkle tree in the block body of the city chain, and store the root node hash value of the second Merkle tree in the block header of the city chain to package the target block header into the block of the city chain.
[0116] Figure 11 An example of a physical structure diagram of an electronic device is shown below. Figure 11As shown, the electronic device may include: a processor (processor) 1110 , a communication interface (Communications Interface) 1120 , a memory (memory) 1130 and a communication bus 1140 , wherein the processor 1110 , the communication interface 1120 , and the memory 1130 communicate with each other via the communication bus 1140 . The processor 1110 can call the logic instructions in the memory 1130 to execute the data supervision method based on the blockchain, which includes: obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system and the light node utilization threshold; the light node is used to collect device data of the device node; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, constructing an objective function; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold and the light node utilization threshold, determining the constraint condition set of the objective function; based on the constraint condition set and the whale optimization algorithm, solving the optimal solution of the objective function to obtain the optimal deployment plan; based on the optimal deployment plan, obtaining the park chain of the blockchain system, storing device data based on the park chain, obtaining the target block header; based on the city chain and park chain of the blockchain system, The district chain and authentication module supervise the target block header. The authentication module is used to connect the communication between the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is used to store the target block header; the authentication module is constructed based on the following steps: cross-certify the park root CA and the bridge CA of the authentication module to obtain the park root certificate and the park bridge certificate; the park root certificate is used to authenticate the communication from the bridge CA to the park root CA, and the park bridge certificate is used to authenticate the communication from the park root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; build a park proxy certificate, and the park proxy certificate is used for communication authentication from the park root CA to the park proxy end of the park chain; build a city proxy certificate, and the city proxy certificate is used for communication authentication from the city root CA to the city proxy end of the city chain; based on the park root certificate, the park bridge certificate, the city root certificate, the city bridge certificate, the park proxy certificate and the city proxy certificate, the authentication module is obtained.
[0117] Furthermore, the logic instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0118] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the blockchain-based data supervision method provided by the above methods, the method including: obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system and the light node utilization threshold; the light node is used to collect device data of the device node; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, an objective function is constructed; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold and the light node utilization threshold, a constraint condition set of the objective function is determined; based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan; based on the optimal deployment plan, the campus chain of the blockchain system is obtained, based on the The target block header is obtained by storing device data on the park chain; the target block header is supervised based on the city chain, park chain and authentication module of the blockchain system. The authentication module is used to connect the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is used to store the target block header; the authentication module is constructed based on the following steps: cross-certify the park root CA and the bridge CA of the authentication module to obtain the park root certificate and the park bridge certificate; the park root certificate is used for authentication of communication from the bridge CA to the park root CA, and the park bridge certificate is used for authentication of communication from the park root CA to the bridge CA; The city root CA and bridge CA are cross-certified to obtain the city root certificate and city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; a campus proxy certificate is constructed, and the campus proxy certificate is used to authenticate the communication from the campus root CA to the campus proxy end of the campus chain; a city proxy certificate is constructed, and the city proxy certificate is used to authenticate the communication from the city root CA to the city proxy end of the city chain; based on the campus root certificate, campus bridge certificate, city root certificate, city bridge certificate, campus proxy certificate and city proxy certificate, an authentication module is obtained.
[0119] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the blockchain-based data supervision method provided by the above-mentioned methods, the method comprising: obtaining the average communication round-trip delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception volume threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; the light node is used to collect device data of the device node; based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first influencing factor and the second influencing factor, constructing an objective function; based on the data transmission distance, the data reception volume threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold, determining the constraint condition set of the objective function; based on the constraint condition set and the whale optimization algorithm, solving the optimal solution of the objective function to obtain the optimal deployment plan; based on the optimal deployment plan, obtaining the park chain of the blockchain system, and storing the device data of the park chain to obtain the target park chain. Block header; based on the city chain, park chain and authentication module of the blockchain system, the target block header is supervised, the authentication module is used to connect the communication between the city root authentication center CA of the city chain and the park root CA of the park chain, and the city chain is used to store the target block header; the authentication module is constructed based on the following steps: cross-certify the park root CA and the bridge CA of the authentication module to obtain the park root certificate and the park bridge certificate; the park root certificate is used to authenticate the communication from the bridge CA to the park root CA, and the park bridge certificate is used to authenticate the communication from the park root CA to the bridge CA; cross-certify the city root CA and the bridge CA to obtain the city root certificate and the city bridge certificate; the city root certificate is used to authenticate the communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate the communication from the city root CA to the bridge CA; construct a park proxy certificate, and the park proxy certificate is used for communication authentication from the park root CA to the park proxy end of the park chain; construct a city proxy certificate, and the city proxy certificate is used for communication authentication from the city root CA to the city proxy end of the city chain; based on the park root certificate, the park bridge certificate, the city root certificate, the city bridge certificate, the park proxy certificate and the city proxy certificate, obtain the authentication module.
[0120] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0121] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A data supervision method based on blockchain, characterized in that: include: Obtain the average round-trip communication delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; The light node is used to collect device data of the device node; Constructing an objective function based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first impact factor, and the second impact factor; Determining a constraint set of the objective function based on the data transmission distance, the data reception amount threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold; Based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan; Acquire the park chain of the blockchain system based on the optimal deployment solution, store the device data based on the park chain, and obtain a target block header; Based on the city chain, the park chain and the authentication module of the blockchain system, the target block header is supervised. The authentication module is used to connect the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is used to store the target block header; The authentication module is constructed based on the following steps: Cross-certify the campus root CA and the bridge CA of the authentication module to obtain a campus root certificate and a campus bridge certificate; the campus root certificate is used to authenticate communication from the bridge CA to the campus root CA, and the campus bridge certificate is used to authenticate communication from the campus root CA to the bridge CA; Cross-certify the city root CA and the bridge CA to obtain a city root certificate and a city bridge certificate; the city root certificate is used to authenticate communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate communication from the city root CA to the bridge CA; Constructing a campus proxy certificate, which is used for communication authentication from the campus root CA to the campus proxy end of the campus chain; Constructing a city proxy certificate, which is used for communication authentication from the city root CA to the city proxy end of the city chain; The authentication module is obtained based on the campus root certificate, the campus bridge certificate, the city root certificate, the city bridge certificate, the campus agent certificate and the city agent certificate.
2. The data supervision method based on blockchain according to claim 1 is characterized in that: The campus chain includes the light node, the campus sorting node, and the full node. The storing of the device data based on the campus chain includes: Collecting the device data based on the light node and sending the device data to the park sorting node; Packing the device data into a block of the campus chain based on the campus sorting node, and sending the packaged campus chain block to the full node; Based on the full node, the packaged campus chain block and device index table are stored in the buffer pool of the campus chain to complete the storage of the device data, and the target block header is sent to the light node so that the light node can update the storage data of the campus chain based on the target block header. The device index table includes the mapping relationship between the target block header and the device node.
3. The data supervision method based on blockchain according to claim 2 is characterized in that: Packing the device data into a block of the campus chain based on the campus sorting node includes: The device data is sorted based on the IP of the device node, and a first Merkle tree is constructed based on the hash value of the sorted device data. The hash value of the tree node of the first Merkle tree is stored in the block body of the campus chain, and the hash value of the root node of the first Merkle tree is stored in the block header of the campus chain to package the device data into the block of the campus chain.
4. The data supervision method based on blockchain according to claim 2 is characterized in that: The city chain includes a city agent, a supervision node, and a city sorting node. The city chain, the park chain, and the authentication module based on the blockchain system supervise the target block header, including: Based on the park agent of the park chain and the authentication module, the target block header is sent to the city agent, the target block header is endorsed to the supervisory node based on the city agent, and the endorsement result and the target block header are sent to the city sorting node; Based on the city sorting node, the target block header is packaged into the block of the city chain to obtain a packaged city chain block, and the packaged city chain block is sent to the supervisory node; Based on the endorsement results of the supervisory node and the target block header, the packaged city chain block is checked and stored.
5. The data supervision method based on blockchain according to claim 4 is characterized in that: The step of packaging the target block header into a block of the city chain based on the city sorting node includes: The target block header is sorted based on the city sorting node, and a second Merkle tree is constructed based on the hash value of the sorted target block header. The hash value of the tree node of the second Merkle tree is stored in the block body of the city chain, and the hash value of the root node of the second Merkle tree is stored in the block header of the city chain, so as to package the target block header into the block of the city chain.
6. A data supervision device based on blockchain, characterized in that: include: The communication optimization module is used to obtain the average round-trip communication delay of the blockchain system, the decibel value of the average transmit-receive power ratio of the blockchain system, the data transmission distance between the light node of the blockchain system and the device node of the blockchain system, the data reception threshold of the blockchain system, the signal strength reception threshold within the blockchain system, the network throughput threshold of the blockchain system, and the light node utilization threshold; The light node is used to collect device data of the device node; Constructing an objective function based on the average communication round-trip delay, the decibel value of the average transmit-receive power ratio, the first impact factor, and the second impact factor; Determining a constraint set of the objective function based on the data transmission distance, the data reception amount threshold, the signal strength reception threshold, the network throughput threshold, and the light node utilization threshold; Based on the constraint condition set and the whale optimization algorithm, the optimal solution of the objective function is solved to obtain the optimal deployment plan; A first supervision module is configured to obtain a campus chain of the blockchain system based on the optimal deployment solution, store the device data based on the campus chain, and obtain a target block header; A second supervision module is configured to supervise the target block header based on the city chain, the park chain, and the authentication module of the blockchain system. The authentication module is configured to connect the city root authentication center CA of the city chain and the park root CA of the park chain. The city chain is configured to store the target block header. The authentication module is constructed based on the following steps: cross-authenticating the campus root CA and the bridge CA of the authentication module to obtain a campus root certificate and a campus bridge certificate; The campus root certificate is used for authentication of communications from the bridge CA to the campus root CA, and the campus bridge certificate is used for authentication of communications from the campus root CA to the bridge CA; Cross-certify the city root CA and the bridge CA to obtain a city root certificate and a city bridge certificate; the city root certificate is used to authenticate communication from the bridge CA to the city root CA, and the city bridge certificate is used to authenticate communication from the city root CA to the bridge CA; Constructing a park agent certificate, which is used for communication authentication from the park root CA to the park agent end of the park chain; constructing a city agent certificate, which is used for communication authentication from the city root CA to the city agent end of the city chain; The authentication module is obtained based on the campus root certificate, the campus bridge certificate, the city root certificate, the city bridge certificate, the campus agent certificate and the city agent certificate.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the blockchain-based data supervision method as described in any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blockchain-based data supervision method as described in any one of claims 1 to 5 is implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the blockchain-based data supervision method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
CA cross-domain authentication method and system based on block chain
CN112884476A
Ship trajectory monitoring system based on block chain
CN114157430A