Energy equipment data communication method based on block chain

By introducing blockchain technology into the Internet of Things system, the secure registration and identity authentication of energy equipment is solved, the security risks in traditional IoT data communication methods are realized, the secure storage and efficient sharing of energy data are realized, and the system is improved security and management efficiency.

CN119420784AActive Publication Date: 2025-02-11GUANGZHOU RIMSEA TECH CO LTD

Patent Information

Application Number
CN202510012677.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-02-11
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Traditional IoT data communication methods have security risks, including trust issues, data privacy issues and data integrity issues. Especially when multiple home energy equipment manufacturers cooperate, how to use energy data effectively and safely and realize equipment control is an urgent task. Problems to be solved.

Method used

Adopt blockchain-based energy equipment data communication method to register and authenticate energy equipment through blockchain network, and use blockchain immutability and smart contract mechanisms to safely store and share energy data to achieve data Quarantine and privacy protection.

Benefits of technology

Through blockchain technology, the secure storage and efficient sharing of energy data is achieved, the security and management efficiency of data are enhanced, the risk of data being attacked and tampered with is reduced, and the collaboration efficiency and data utilization between IoT devices are improved. value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420784A_ABST
    Figure CN119420784A_ABST
Patent Text Reader

Abstract

The invention provides an energy equipment data communication method based on a block chain, and the method comprises the steps: obtaining energy data of energy equipment which completes registration in a block chain network, and writing the energy data into a sub-chain of the block chain network based on the type of the energy data; the target energy equipment responds to a preset data interaction condition meeting the target control mode, initiates a first identity authentication request to the block chain network to perform first identity authentication, generates a data sharing request for the target type data based on the preset data interaction condition of the target control mode when the first identity authentication is successful, and performs second identity authentication; and when the access is successful, processing the data sharing request for the target type data by a sub-chain matched with the type of the target type data in the block chain network based on an intelligent contract, determining target shared energy data conforming to the access rule, and sharing the target shared energy data to the target energy equipment, therefore, energy data interaction between household energy devices can be realized safely and efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of energy information, and specifically, to a blockchain-based energy equipment data communication method. Background Art

[0002] With the rapid development of IoT technology, more and more home energy devices are connected to the network, forming a huge IoT ecosystem. However, traditional IoT data communication methods have many security risks, including trust issues, data privacy issues, and data integrity issues. In particular, home energy devices often belong to different manufacturers. How to effectively and safely use energy data to control various home energy devices is an urgent problem to be solved. Summary of the invention

[0003] In view of this, the purpose of this application is to provide a blockchain-based energy device data communication method, device, electronic device and medium, which can safely and efficiently store the energy data of household energy devices and realize energy data interaction between household energy devices.

[0004] An energy device data communication method based on blockchain provided in an embodiment of the present application comprises: Obtaining energy data of energy devices registered in the blockchain network, and writing the energy data into a subchain of the blockchain network based on the type of the energy data; wherein different subchains store different types of energy data; The target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; When the first identity authentication succeeds, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; When the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

[0005] In some embodiments, in the energy device data communication method based on blockchain, the target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request, including: The target energy device responds to the preset data interaction condition that meets the target control mode, and initiates a first identity authentication request to the blockchain network; the first identity authentication request includes the first target identity information; The parent chain of the blockchain network verifies the legitimacy of the target energy device based on the matching result of the first target identity information and the pre-stored device identity information; If it is legal, the parent chain of the blockchain network generates a random challenge and sends the random challenge to the target energy device, so that the target energy device uses a pre-stored private key to digitally sign the random challenge and sends the result of the digital signature to the blockchain network; The parent chain of the blockchain network uses the public key of the target energy device to verify the validity of the result of the digital signature. If the signature is valid, the first identity authentication of the target energy device is successful.

[0006] In some embodiments, in the energy device data communication method based on blockchain, the target energy device generates a data sharing request for target type data based on the preset data interaction condition of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication condition; including: The target energy device acquires predefined attribute authentication information of the target energy device; the attribute authentication information is defined based on the attribute of the target energy device and corresponds to the identity authentication condition; Based on the attribute authentication information, the second target identity information of the target device, and the preset data interaction conditions of the target control mode, a data sharing request for the target type data is generated, and the data sharing request is sent to the blockchain network; the preset data interaction conditions of the target control mode are used to determine the shared energy data requested by the data sharing request; The parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device.

[0007] In some embodiments, in the energy device data communication method based on blockchain, the parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device, including: Determine verification scores corresponding to attribute authentication information at different levels; wherein the verification scores of attribute authentication information at different levels are different, and the verification scores are determined based on the degree of influence of the attribute authentication information on identity authentication; Determining a total attribute verification score of the attribute authentication information based on the verification scores corresponding to the attribute authentication information at different levels; Based on the comparison result of the attribute verification total score and the preset attribute security score threshold, and the second target identity information, the target energy device is authenticated for the second identity. In some embodiments, in the energy device data communication method based on blockchain, the subchain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, and determines the target shared energy data that meets the access rules, including: The parent chain of the blockchain network sends the data sharing request for the target type data to the child chain matching the type of the target type data; The smart contract in the subchain matching the type of the target type data determines whether the target energy device has the authority to access the target type data and meets the preset access conditions for accessing the target type data based on the access rules for the target energy device; If all are met, the target shared energy data corresponding to the data sharing request is determined.

[0008] In some embodiments, in the energy device data communication method based on blockchain, sharing the target shared energy data with the target energy device includes: The smart contract in the subchain matching the type of the target type data determines whether the target shared energy data needs to be encrypted based on the type of the target shared energy data and / or the type of the target energy device; If necessary, encrypt the target shared energy data based on a preset first encryption algorithm to obtain the encrypted target shared energy data, and upload the encrypted target shared energy data to the parent chain; The parent chain shares the encrypted target shared energy data with the target energy device, and records the traceability information of the encrypted target shared energy data.

[0009] In some embodiments, in the energy device data communication method based on blockchain, before obtaining energy data of energy devices that have completed registration in the blockchain network, the method further includes: When the energy device is started, a registration request is initiated to the blockchain network; the registration request includes device identity information; The parent chain of the blockchain network processes the device identity information to generate a first hash value of the device identity information; The parent chain of the blockchain network sends a verification request to the business server that pre-stores the device identity information to receive a second hash value generated by the business server processing the device identity information; The parent chain of the blockchain network verifies whether the first hash value and the second hash value are consistent; If they are consistent, the parent chain of the blockchain network determines that the identity authentication of the energy device is successful, completes the registration of the energy device, and stores the device identity information of the energy device.

[0010] In some embodiments, in the energy device data communication method based on blockchain, writing the energy data into a subchain of the blockchain network based on the type of the energy data includes: Encrypting the energy data based on a second encryption algorithm to obtain encrypted energy data; generating a data summary of the encrypted energy data; Based on the type of the energy data, the encrypted energy data and the data summary are uploaded to a subchain of the blockchain network.

[0011] In some embodiments, a blockchain-based energy equipment data processing device is also provided, the device comprising: An acquisition module, used to acquire energy data of energy devices registered in the blockchain network, and write the energy data into a subchain of the blockchain network based on the type of the energy data; wherein different subchains store different types of energy data; A first authentication module is used to initiate a first identity authentication request to the blockchain network when the target energy device responds to the preset data interaction condition that meets the target control mode, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; A second authentication module, configured to, when the first identity authentication succeeds, generate a data sharing request for target type data based on the preset data interaction conditions of the target control mode by the target energy device, and send the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; A processing module is used for, when the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

[0012] In some embodiments, an electronic device is also provided, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of the blockchain-based energy device data communication method are performed.

[0013] In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the blockchain-based energy device data communication method are executed.

[0014] The embodiment of the present application provides a blockchain-based energy device data communication method, device, electronic device and medium, which obtains energy data of energy devices that have completed registration in the blockchain network, and writes the energy data into a subchain of the blockchain network based on the type of energy data; wherein different subchains store different types of energy data; The target energy device responds to the preset data interaction conditions that meet the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; when the first identity authentication is successful, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; when the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that meets the access rules, and shares the target shared energy data with the target energy device, using the immutability, transparency and security of the blockchain to ensure the secure transmission and storage of IoT data, store different types of data based on the sub-chain, achieve data isolation and privacy protection, and facilitate the formulation of access rules for each type of energy data according to the characteristics and needs of energy data, thereby improving data management effects and data sharing efficiency, as well as the security of data sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 A flowchart of a blockchain-based energy device data communication method according to an embodiment of the present application is shown; Figure 2 A flow chart of a method for writing energy data into a subchain of a blockchain network based on the type of energy data according to an embodiment of the present application is shown; Figure 3 A flow chart of a method for performing a first identity authentication on a target energy device according to an embodiment of the present application is shown; Figure 4 A flow chart showing a method for the target energy device according to an embodiment of the present application to generate a data sharing request for target type data based on the preset data interaction condition of the target control mode; Figure 5 A flow chart of a method for determining target shared energy data that complies with the access rule according to an embodiment of the present application is shown; Figure 6 A flow chart of a method for sharing the target shared energy data with a target energy device according to an embodiment of the present application is shown; Figure 7 A schematic diagram of the structure of a blockchain-based energy equipment data communication device according to an embodiment of the present application is shown; Figure 8 A schematic structural diagram of an electronic device described in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0017] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0018] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0019] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0020] With the rapid development of IoT technology, more and more home energy devices are connected to the network, forming a huge IoT ecosystem. However, traditional IoT data communication methods have many security risks, including trust issues, data privacy issues, and data integrity issues. In particular, home energy devices often belong to different manufacturers. How to effectively and safely use energy data to control various home energy devices is an urgent problem to be solved.

[0021] In order to solve the data security problem of the Internet of Things, there are currently several main technical solutions: the solution based on security protocols uses security protocols such as TLS / SSL to encrypt data transmission. This solution can improve data security, but it cannot completely solve the trust problem and data integrity problem; The scheme based on identity authentication verifies the identity of the device through an identity authentication mechanism. This scheme can reduce the risk of device attacks, but it cannot effectively solve the problem of data privacy. The scheme based on data encryption encrypts and stores data to prevent data leakage. Although this method can protect data privacy, it cannot solve the problem of data integrity.

[0022] In summary, the above technical solutions have improved the security of IoT data to a certain extent, but there are still the following shortcomings: First, insufficient security: existing technologies cannot completely solve the trust issues, data privacy issues and data integrity issues in the IoT, and there is still a risk of being attacked and tampered with. Second: Inefficiency: These solutions usually add additional computing and storage overhead, reducing the efficiency of the system, especially in large-scale IoT environments, this efficiency problem is more prominent. Third: Lack of scalability: existing technical solutions are difficult to meet the needs of the rapid expansion of the IoT scale, and cannot effectively cope with the growing number of devices and data volume.

[0023] In order to solve these problems, the embodiments of the present application provide a blockchain-based energy device data communication method, device, electronic device and medium, which obtain energy data of energy devices registered in the blockchain network, and write the energy data into a subchain of the blockchain network based on the type of energy data; wherein different subchains store different types of energy data; The target energy device responds to the preset data interaction conditions that meet the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; when the first identity authentication is successful, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; when the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that meets the access rules, and shares the target shared energy data with the target energy device, using the immutability, transparency and security of the blockchain to ensure the secure transmission and storage of IoT data, store different types of data based on the sub-chain, achieve data isolation and privacy protection, and facilitate the formulation of access rules for each type of energy data according to the characteristics and needs of energy data, thereby improving data management effects and data sharing efficiency, as well as the security of data sharing.

[0024] Please refer to Figure 1 , Figure 1 The flowchart of the energy device data communication method based on blockchain described in the embodiment of the present application is shown; Figure 1 As shown, the method includes the following steps S101-S104: S101. Obtain energy data of energy equipment registered in the blockchain network, and write the energy data into a subchain of the blockchain network based on the type of the energy data; wherein different subchains store different types of energy data; S102, the target energy device responds to the preset data interaction condition that meets the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; S103. When the first identity authentication succeeds, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; S104. When the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

[0025] In step S101, energy data of energy equipment registered in the blockchain network is obtained, and the energy data is written into a sub-chain of the blockchain network based on the type of the energy data; wherein different sub-chains store different types of energy data.

[0026] In the embodiment of the present application, the energy device is a household energy device.

[0027] The energy device is, for example, an energy storage device, an electrical device, a power generation device, a transmission device or a hybrid device, wherein the hybrid device is externally treated as a device, which may include a transmission device, a power generation device, an energy storage device and an electrical device, etc. Energy information includes capability information, demand information, supply information, identity information, type information, voltage information, current information, power information, energy information, spatiotemporal attribute information, adjustable attribute information, response time information, etc. Exemplarily, the electrical equipment includes: air conditioners, washing machines, smart home devices, etc.; the power generation equipment includes solar energy equipment, etc.

[0028] In the embodiment of the present application, the blockchain network includes a parent chain and a child chain, wherein the parent chain is the backbone of the system, and its main responsibilities include: global consensus: ensuring the security and consistency of the blockchain network through the POW (Proof of Work) consensus mechanism; identity authentication: managing the registration and identity authentication of devices to ensure the legitimacy of access devices; transaction verification: verifying the authenticity and integrity of all uploaded transactions and data; data traceability: recording the source and destination of data to ensure the traceability and transparency of data.

[0029] Subchains process specific types of data and application logic, and their responsibilities include: Data classification: storing data on different subchains according to data types (such as temperature, power, switch status, etc.) to improve the efficiency of data management; Data encryption: using the AES encryption algorithm to encrypt data to ensure data confidentiality; Smart contracts: running smart contracts related to specific data types to achieve automated processing and sharing of data.

[0030] The subchain adopts local consensus, which ensures the consistency and security of data through a simplified consensus mechanism (Practical Byzantine Fault Tolerance) within the subchain.

[0031] In the embodiment of the present application, before obtaining the energy data of the energy device that has completed registration in the blockchain network, the method further includes: When the energy device is started, a registration request is initiated to the blockchain network; the registration request includes device identity information; The parent chain of the blockchain network processes the device identity information to generate a first hash value of the device identity information; The parent chain of the blockchain network sends a verification request to the business server that pre-stores the device identity information to receive a second hash value generated by the business server processing the device identity information; The parent chain of the blockchain network verifies whether the first hash value and the second hash value are consistent; If they are consistent, the parent chain of the blockchain network determines that the identity authentication of the energy device is successful, completes the registration of the energy device, and stores the device identity information of the energy device.

[0032] As an IoT device, energy equipment must register with the blockchain network and obtain a unique identity before accessing the blockchain network, and compare and verify it with the data pre-stored in the cloud.

[0033] When an energy device is started, such as a smart temperature control device, a registration request will be initiated to the blockchain network. The registration request contains device identity information, which can also be referred to as device attribute information, basic information, etc. The device identity information includes the device model, manufacturer information, and unique identification code.

[0034] The registration request may be issued by the energy device itself, by other energy devices that interact with the energy device, or by a client. For example, the registration request of the smart temperature control device may be issued by the smart temperature control device itself, by a gateway connected to the smart temperature control device, or by a client of the smart temperature control device (specifically, a mobile phone or other terminal with client software installed) to the blockchain.

[0035] After receiving the registration request, the blockchain network will send the information provided by the device to the cloud business server for verification; specifically, in an embodiment of the present application, the parent chain of the blockchain network generates a verification request based on at least part of the device identity information and sends the verification request to the business server.

[0036] The business server may be a cloud server (referred to as the cloud); the business server may be an independent home energy equipment management platform, or may be a server of an equipment manufacturer.

[0037] In the cloud, the business server queries the device information of the energy device from the pre-stored device identity information based on the verification information, and generates a second hash value in combination with the SHA-256 encryption algorithm.

[0038] The parent chain of the blockchain network uses the SHA-256 encryption algorithm to perform a hash operation on the received device identity information to generate a unique first hash value.

[0039] After the parent chain of the blockchain network receives the second hash value returned by the business server, it compares it with the first hash value of the device identity information. If the two are consistent, the verification is passed, the registration of the energy device is completed, and the device identity information of the energy device is stored.

[0040] If the first hash value and the second hash value are inconsistent, the verification fails.

[0041] In the device registration process described in the embodiment of the present application, the blockchain network can verify whether the device identity information provided by the device is consistent with the backup identity information recorded by the business server, thereby ensuring the validity and authenticity of the device identity; at the same time, the irreversibility and uniqueness of the SHA-256 encryption algorithm are utilized to ensure the security and integrity of the identity data.

[0042] SHA-256 encryption algorithm description: SHA-256 is a secure hash algorithm and the successor to the SHA-1 algorithm, with higher security, faster speed, and stronger collision resistance.

[0043] The SHA-256 algorithm uses iterative compression to convert input data of any length into output data of fixed length (256 bits). The specific steps of the SHA-256 algorithm are as follows: Preprocessing: pad the input data into 512-bit blocks; Initialization: Initialize eight 32-bit registers, called working variables; Compression: Split each 512-bit block into 16 32-bit words and perform a series of nonlinear operations on them and the working variables; Output: Connect the final 8 working variables to form 256 bits of output data.

[0044] The SHA-256 algorithm has the following security features: Collision: It is difficult to find two different input data with the same hash value; Preimage: It is difficult to find an input data whose hash value is the specified value; Second preimage property: It is very difficult to find a second input data that hashes to the same hash as a given input data.

[0045] The mathematical formula of the SHA-256 algorithm is as follows: H = H0 || H1 || H2 || H3 || H4 || H5 || H6 || H7; H(n) = H(n-1) + Σ(n) + K(n) + W(n); Σ(n) = Ch(n) + Maj(n); Ch(n) = (H(n-1) ∧ H(n-2)) ⊕ (~H(n-1) ∧ H(n-3)); Maj(n) = (H(n-1) ∧ H(n-2)) ⊕ (H(n-1) ∧ H(n-3)) ⊕ (H(n-2) ∧ H(n-3)); K(n) = [K0, K1, ……, K63]; W(n) = [W0, W1, …, W15]; W(n) = W(n-16) + σ1(W(n-14)) + W(n-7) + σ0(W(n-2)); σ0(x) = (x>>7) ⊕ (x>>18) ⊕ (x>>3); σ1(x) = (x>>17) ⊕ (x>>19) ⊕ (x>>10).

[0046] Among them, H: represents the final hash value (or digest, hash value) generated by the SHA-256 algorithm after processing the input message; H0, H1, H2, H3, H4, H5, H6, H7 are the initial hash values ​​(or hash initial values) used in the SHA-256 algorithm; the n in the formula H(n-1) + Σ(n) + K(n) + W(n) refers to the current iteration step or round. In the SHA-256 algorithm, the message data is divided into multiple 512-bit blocks, and each block is further divided into multiple 32-bit words. In each iteration of the compression function, a series of complex nonlinear operations are performed, which will update the current hash value.

[0047] Specifically, n refers to the nth round of iteration. In each round of iteration, the current hash value H(n) is calculated, which depends on the hash value H(n-1) of the previous round, the message word W(n) of the current round, the constant K(n), and some intermediate values ​​Σ(n) calculated from the message word.

[0048] The intermediate value Σ(n) is determined based on the selection function Ch(n) and the majority function Maj(n).

[0049] In the formula Ch(n) = (H(n-1) ∧ H(n-2)) ⊕ (~H(n-1) ∧ H(n-3)) , the symbol ~ represents the bitwise inversion operation; specifically, (H(n-1) ∧ H(n-2)) : bitwise AND operation, which means performing an AND operation on each bit of (H(n-1) ∧ H(n-2)) ; ~H(n-1) : bitwise inversion operation, which means reversing each bit of ~H(n-1), that is, 0 becomes 1, and 1 becomes 0; (~H(n-1) ∧ H(n-3)) : first perform a bitwise inversion operation on ~H(n-1), and then perform a bitwise AND operation on the result and H(n-3); (H(n-1) ∧ H(n-2)) ⊕ (~H(n-1) ∧ H(n-3)) Perform a bitwise XOR operation on the results of the above two parts.

[0050] The following are examples of bitwise operations: Assume the following 32-bit binary numbers: H(n-1) = 11001010, H(n-1) = 10101100, H(n-1) = 11110000; ~H(n-1) = 00110101 (invert each bit in H(n-1)); (H(n-1) ∧ H(n-2)) = 10001000; (~H(n-1) ∧ H(n-3)) = 00110000; (H(n-1) ∧ H(n-2)) ⊕ (~H(n-1) ∧ H(n-3)) = 10001000 ⊕00110000 = 10111000; Therefore, the result of Ch(n) is the result of the bitwise operation.

[0051] This operation is used in the SHA-256 algorithm to generate complex bit-level obfuscation, increasing the security of the hash function.

[0052] K(n) = [K0, K1, …, K63] in the formula is a set of 64 fixed constants, which are used for compression function operations in each round (from 0 to 63); K(n) represents the constant array; K0, K1, …, K63 represent the constants in the constant array; these constants are part of the SHA-256 algorithm and are used to increase the complexity and security of the algorithm.

[0053] The W(n) = [W0, W1, …, W15] in the formula represents the initial message word obtained directly from the message block.

[0054] The function definitions in the mathematical formula of the above SHA-256 algorithm are summarized as follows: H represents the final hash value; H(n) represents the initial hash value; H0, H1, ..., H7 all represent specific initial hash values; Σ(n) represents the intermediate value; Ch(n) represents the selection function; Maj(n) represents the majority function; K(n) represents the constant array; K0, K1, ..., K63 all represent the constants in the constant array; W(n) represents the message word array; W0, W1, ..., W15 represent the message words in the message word array; σ0(x) represents the first cyclic shift function; σ1(x) represents the second cyclic shift function, and x represents the variables in the first cyclic shift function and the second cyclic shift function.

[0055] The SHA-256 algorithm is a secure, reliable, and efficient hash algorithm with a wide range of application scenarios. During the registration process of home energy devices, the use of the SHA-256 algorithm can effectively verify the authenticity and validity of the device identity and ensure the security of the IoT system.

[0056] During the operation of energy equipment, the energy data of registered energy equipment needs to be uploaded to the chain. In order to ensure the encryption of energy data, the energy data needs to be encrypted.

[0057] Specifically, in an embodiment of the present application, the energy data is written into a sub-chain of the blockchain network that matches its type based on the type of the energy data, so that at least one type of energy data (such as temperature, power, switch status, etc.) is stored in different sub-chains to improve the efficiency of data management.

[0058] In the present application, please refer to Figure 2 , Figure 2 A flow chart of a method for writing energy data into a subchain of a blockchain network based on the type of energy data described in an embodiment of the present application is shown; Figure 2 As shown, the energy data is written into the subchain of the blockchain network based on the type of the energy data, including the following steps S201-S203: S201, encrypting the energy data based on a second encryption algorithm to obtain encrypted energy data; S202, generating a data summary of the encrypted energy data; S203. Based on the type of the energy data, the encrypted energy data and data summary are uploaded to a subchain of the blockchain network.

[0059] That is to say, the home energy device encrypts the collected energy data and generates a data summary to ensure the confidentiality and integrity of the energy data.

[0060] The energy data is encrypted based on a second encryption algorithm to obtain encrypted energy data, as follows: after the household energy device collects data and obtains various types of data (such as temperature, power, switch status, etc.), the energy device selects an encryption key, which is a key obtained through a security protocol exchange.

[0061] Finally, an encryption algorithm is used to encrypt the collected data. For example, in an embodiment of the present application, the home energy device may use AES (Advanced Encryption Standard) to encrypt the energy data to ensure the confidentiality of the energy data.

[0062] Generate a data summary of the encrypted energy data, specifically as follows: Apply the SHA-256 hash algorithm to the encrypted energy data to generate a hash value of the energy data. This hash value is also called a data summary.

[0063] In an embodiment of the present application, the generated data summary is stored together with the encrypted energy data in a subchain matching the data type, so as to subsequently verify the integrity of the data.

[0064] AES (Advanced Encryption Standard) is a symmetric encryption algorithm used to encrypt and decrypt data. The following describes the formula and principle of the AES encryption algorithm.

[0065] The formula of the AES encryption algorithm is as follows: Encryption process: ciphertext = AES (plaintext, key); Decryption process: plaintext = AES (ciphertext, key).

[0066] The principle of the AES encryption algorithm is as follows: The AES algorithm uses a block cipher to divide the plaintext data into fixed-length data blocks, and then converts each data block into a corresponding ciphertext data block through a series of encryption operations. The decryption operation is the reverse process of the encryption operation, converting the ciphertext data block back to the plaintext data block.

[0067] The AES algorithm uses a Substitution-Permutation Network (SPN) structure, which mainly includes the following steps: Key Expansion: Generates a series of round keys based on the input key for subsequent round function operations; Initial Round: XOR the plaintext data block with the first round key; Multi-round encryption (Rounds): multiple rounds of iterative operations are used, each round includes four steps: byte substitution (SubBytes), row shift (ShiftRows), column confusion (MixColumns) and round key addition (AddRoundKey); Final Round: The final round does not include the column obfuscation step; Ciphertext generation: After multiple rounds of encryption, the ciphertext data block is obtained.

[0068] Exemplarily, the energy data encryption process in the embodiment of the present application is as follows: Assume that the temperature data collected by a home energy device is 25°C and is encrypted using the AES encryption algorithm. The encryption process is as follows: Plain text: 25°C; Key: pre-stored encryption key; The device performs AES encryption on the plain text data to obtain the corresponding cipher text data, for example: 0x3F7A2B9E65D12F8C…….

[0069] Exemplarily, the specific process of generating the data summary of the encrypted energy data is as follows: Apply the SHA-256 hash algorithm to the encrypted energy data to generate a hash value (data summary) of the energy data. Exemplarily, the generated hash value is: 0x9A457FACBE8216D3…

[0070] Based on the type of the energy data, the encrypted energy data and data summary are uploaded to the blockchain network and the sub-chain that matches the type of the energy data, so that the encrypted data and data summary are uploaded to the blockchain network to ensure the immutability and transparency of the data.

[0071] Based on the type of energy data, the encrypted energy data and data summary are uploaded to the subchain of the blockchain network. The specific process of uploading data to the blockchain is described below: Prepare transaction data: Prepare the encrypted energy data and its corresponding data summary for uploading to the blockchain network.

[0072] Create a transaction: Package the prepared encrypted energy data and data summary into a transaction format; in some blockchain systems, transaction fees may be required.

[0073] Broadcast transaction: Broadcast the created transaction to the nodes in the blockchain network.

[0074] Transaction verification: The verification nodes in the blockchain network verify the received transactions to ensure that they comply with the network's rules and consensus mechanism. Verification includes checking the validity of the transaction, the integrity of the data, and related signatures.

[0075] Packaging transactions: Once a transaction is verified, the verification node packages it into a new block.

[0076] Block confirmation: A new block is added to the sub-chain of the blockchain, which contains the above transaction data. At this point, the data has been successfully uploaded to the chain.

[0077] Block synchronization: The nodes of the sub-chain in the entire blockchain network synchronize the new blocks to ensure that all nodes of the sub-chain contain the latest data.

[0078] The following is an example of the process of uploading energy data to the chain.

[0079] Prepare transaction data: Assume that the home energy device collects temperature data of 25°C, and has encrypted the energy data and generated a data summary.

[0080] Create transaction: Pack the encrypted energy data and data summary into a transaction format and include other necessary device information, such as sender address, receiver address, etc.

[0081] Broadcast transaction: Broadcast the created transaction to the nodes in the blockchain network.

[0082] Transaction verification: After receiving a transaction, the verification node in the blockchain network will verify the validity of the transaction, the integrity of the data, and other relevant information.

[0083] Packaging transactions: Once a transaction is verified, the verification node packages it into a new block.

[0084] Block confirmation: A new block is added to the sub-chain of the blockchain and contains the above transaction data, and the type of energy data in the sub-chain and the transaction data matches.

[0085] Block synchronization: The nodes of the subchain in the blockchain network synchronize new blocks to ensure that all nodes of the subchain contain the latest data of their corresponding data types. The main function of the subchain is to formulate different operating rules for different devices and application scenarios, such as transaction fees, verification processes, etc., to meet specific business needs and achieve low-latency and efficient operation without the parent chain.

[0086] The data in the child chain will be synchronized to the parent chain for backup, but the parent chain does not participate in the specific execution of the plan.

[0087] Through this process, the energy data collected by household energy devices has been successfully uploaded to the chain, thus ensuring the data’s immutability and transparency.

[0088] In step S102, the target energy device responds to the preset data interaction conditions that meet the target control mode and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request.

[0089] The target control mode is the operating mode of the target energy device; for example, electricity price priority mode, task priority mode, fine control mode, simple control mode, etc.; taking the smart drum washing machine as an example, in the electricity saving mode, the historical electricity price data in the blockchain is obtained to predict when the electricity price meets the requirements, so as to start when the electricity price is lower; in the task priority mode, the electricity price will not be considered and it will be started directly.

[0090] It should be noted that the target control mode can be for a single energy device or for an energy system composed of multiple energy devices, for example, an energy system composed of a solar power generation system (including batteries), multiple electrical devices, and household switches.

[0091] The preset data interaction conditions are preset conditions for triggering the target energy device to obtain energy data. For example, when a smart drum washing machine is started, the power consumption data and historical electricity price data of the smart drum washing machine must be obtained to determine whether the operation strategy of the drum washing machine is immediate drive or delayed start (for example, starting at 10 pm when the electricity price is lower).

[0092] Pre-configure the preset data interaction conditions for each energy device in each control mode; the preset data interaction conditions in different control modes can be the same or different.

[0093] Pre-configure the data type of the data required by the energy device corresponding to each preset data interaction condition in each control mode. The data type corresponding to the same preset data interaction condition in different control modes of the energy device can be the same or different; the data type corresponding to different preset data interaction conditions in the same control mode of the energy device can be the same or different.

[0094] That is to say, the target control mode and the preset data interaction conditions under the target control mode jointly determine what type of data the energy device needs to obtain from the blockchain at this time.

[0095] For example, for an energy system consisting of a solar power generation system (including batteries), multiple electrical appliances, and household switches, in the fine control mode, when the preset data interaction condition of starting the drum washing machine is triggered, four energy data items need to be obtained, namely, the power consumption of the drum washing machine, historical electricity prices, solar power generation, and battery storage capacity. In the simple control mode, when the preset data interaction condition of starting the drum washing machine is triggered, only the historical electricity price data needs to be obtained.

[0096] It should be noted that the target control mode, the preset data interaction conditions of the target control mode and the data type required by the corresponding energy equipment are configured according to the specific energy equipment in the home and user needs, and this application does not describe this in detail.

[0097] The target energy device responds to the preset data interaction conditions that meet the target control mode, which means that the data on the blockchain needs to be shared. Before the IoT device interacts with the data, it needs to perform the first identity authentication through the identity authentication mechanism on the blockchain network.

[0098] Identity authentication can also be called identity verification.

[0099] Identity authentication plays a vital role in the data communication of home energy devices, ensuring the security and credibility of the communication. The blockchain-based identity authentication mechanism takes advantage of the immutability and security of blockchain to provide a reliable authentication method for home energy devices.

[0100] Please refer to Figure 3 , Figure 3 A flow chart of a method for performing a first identity authentication on a target energy device according to an embodiment of the present application is shown; the target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request, including the following steps S301-S303: S301, the target energy device responds to the preset data interaction condition that meets the target control mode, and initiates a first identity authentication request to the blockchain network; the first identity authentication request includes the first target identity information; S302, the parent chain of the blockchain network verifies the legitimacy of the target energy device based on the matching result of the first target identity information and the pre-stored device identity information; S303. If it is legal, the parent chain of the blockchain network generates a random challenge and sends the random challenge to the target energy device, so that the target energy device uses a pre-stored private key to digitally sign the random challenge and sends the result of the digital signature to the blockchain network; S304. The parent chain of the blockchain network uses the public key of the target energy device to verify the validity of the result of the digital signature. If the signature is valid, the first identity authentication of the target energy device is successful.

[0101] It should be noted that the interaction between the home energy device and the blockchain includes data uploading and data downloading. When uploading data, in some embodiments, it is also necessary to initiate a first identity authentication request to the blockchain network for identity verification.

[0102] The first target identity information is at least part of the device identity information that the home energy device needs to register with the blockchain network before accessing the network.

[0103] The principle of the first identity authentication is as follows: before each home energy device is connected to the network, it needs to register its own identity information with the blockchain network. This information may include device ID, public key, certificate, etc. The registered identity information will be stored in the distributed ledger of the blockchain to ensure that all nodes can access and verify this information. When the home energy device sends data (such as the first identity authentication request), it will use its own private key to digitally sign the data to prove that the source of the data is legal and credible. The receiver will use the sender's public key to verify the validity of the digital signature, and can query the identity information on the blockchain to confirm the legitimacy of the device.

[0104] The following details the process by which a home energy device needs to perform the first identity authentication to the blockchain network: Device initiates authentication request: The home energy device sends an identity authentication request to the blockchain network in order to exchange data with other devices; Verify identity information: The parent chain of the blockchain network queries the identity information of the home energy device stored on the blockchain, such as device ID and public key, and verifies its legitimacy; Generate Challenge: The parent blockchain of the blockchain network generates a random challenge and sends it to the home energy device; Device responds to the challenge: The home energy device digitally signs the challenge using its own private key and sends the signature result to the blockchain network; Verify the signature: The parent chain of the blockchain network uses the public key of the home energy device to verify the validity of the signature. If the signature is valid, the authentication is successful and the home energy device can start exchanging data.

[0105] Through the above steps, the home energy device is successfully authenticated through the blockchain-based identity authentication mechanism, ensuring the security and credibility of data exchange.

[0106] In step S103, when the first identity authentication is successful, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions.

[0107] When the first identity authentication is successful, the target energy device sends a data sharing request, requesting to share the data in the blockchain network.

[0108] Specifically, energy devices can achieve secure data sharing through smart contracts to ensure the security and legitimacy of data. Data sharing is one of the important mechanisms for data exchange and cooperation between IoT devices. Through smart contracts, devices can share data securely to ensure the security and legitimacy of data.

[0109] The principles of data sharing are as follows: A smart contract is an automated contract executed on a blockchain that contains predefined rules and conditions that ensure the security and legality of data sharing.

[0110] Smart contracts can define which devices have access to shared data and under what conditions they can access the data. Only devices that meet these conditions can obtain the shared data.

[0111] During the data sharing process, encryption algorithms can be used to encrypt data to ensure the confidentiality of the data. Only devices with decryption keys can decrypt and access the data.

[0112] Please refer to Figure 4 , Figure 4 A flow chart of a method for generating a data sharing request for target type data based on the preset data interaction conditions of the target control mode according to an embodiment of the present application is shown; the target energy device generates a data sharing request for target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; comprising the following steps S401-S403: S401, the target energy device obtains predefined attribute authentication information of the target energy device; the attribute authentication information is defined based on the attribute of the target energy device and corresponds to the identity authentication condition; S402, based on the attribute authentication information and the second target identity information of the target device and the preset data interaction condition of the target control mode, generate a data sharing request for the target type data, and send the data sharing request to the blockchain network; the preset data interaction condition of the target control mode is used to determine the shared energy data requested by the data sharing request; S403. The parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device.

[0113] The attributes of the target energy device include network attributes, time attributes, geographic location attributes, etc. The home energy device is installed in the home, sends requests through the gateway in the home, and is located in a fixed location. Some home energy devices trigger the preset data interaction condition of reaching a preset time, that is, this type of home energy device will only send data sharing requests at a fixed time point.

[0114] Therefore, based on these specific attributes of the energy device, the identity authentication conditions in the smart contract can be configured, and the corresponding attribute authentication information can be pre-defined in the energy device.

[0115] In this way, the generated data sharing request includes not only the second target identity information of the target device, but also these specially defined attribute authentication information. The smart contract of the parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on the pre-configured identity authentication conditions. If the attribute authentication information and the second target identity information both meet the corresponding identity authentication conditions, the target energy device has passed the verification and can share data.

[0116] In the embodiment of the present application, based on the specific attribute characteristics of the home energy device, such as the fixed location and the fixed gateway, identity authentication conditions for the specific attribute characteristics are configured in the smart contract of the parent chain to further ensure the reliability of the identity authentication.

[0117] Specifically, in the embodiment of the present application, when authentication is performed in combination with attribute authentication information, a scoring mechanism is used to verify to ensure the security of the device, and the second identity authentication is successful when the score reaches a preset security score.

[0118] Specifically, in some embodiments, in the energy device data communication method based on blockchain, the parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device, including: Determine verification scores corresponding to attribute authentication information at different levels; wherein the verification scores of attribute authentication information at different levels are different, and the verification scores are determined based on the degree of influence of the attribute authentication information on identity authentication; Determining a total attribute verification score of the attribute authentication information based on the verification scores corresponding to the attribute authentication information at different levels; Based on the comparison result of the attribute verification total score and the preset attribute security score threshold, as well as the second target identity information, a second identity authentication is performed on the target energy device.

[0119] For example, the first level is the device type, which is the basic level and accounts for 50 points out of 100 points; the second level is the geographical location attribute, which is divided into cities, provinces, etc., and the scores of different regional affiliations decrease in sequence; the third level is the network attribute, internal LAN>home network>public network, and the scores decrease in sequence.

[0120] In an embodiment of the present application, the data sharing request is a request initiated by the target energy device to the smart contract of the blockchain network, requesting access to specific data; the data sharing request generally includes the second target identity information of the target energy device and the purpose of accessing the data.

[0121] The target energy device generates a data sharing request for target type data based on the preset data interaction conditions of the target control mode. Specifically, based on the pre-configured data acquisition rules corresponding to the preset data interaction conditions based on the target control mode, a data sharing request for target type data is generated, and the data sharing request can determine the type and data content to be accessed.

[0122] In step S104, when the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

[0123] In the present application, please refer to Figure 5 , Figure 5 A flow chart of a method for determining target shared energy data that complies with the access rules described in an embodiment of the present application is shown; specifically, the subchain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, and determines the target shared energy data that complies with the access rules, including the following steps S501-S503: S501, the parent chain of the blockchain network sends the data sharing request for the target type data to the child chain that matches the type of the target type data; S502, the smart contract in the subchain matching the type of the target type data determines whether the target energy device has the authority to access the target type data and meets the preset access conditions for accessing the target type data based on the access rules for the target energy device; S503: If all conditions are met, determine the target shared energy data corresponding to the data sharing request.

[0124] The smart contract of the sub-chain can define access rules, thereby defining which energy devices have the right to access the data shared in the sub-chain and under what conditions the data can be accessed. Only devices that meet these conditions can obtain the data shared in the sub-chain.

[0125] The target shared energy data may be real-time data, historical data or data in other forms.

[0126] Based on this, the access rules are used to define whether the target energy device has the authority to access each type of data in the sub-chain, and under what conditions the data can be accessed.

[0127] The access rules include the authority of the energy device to each type of data in the sub-chain, and the corresponding preset access conditions.

[0128] Different types of data are stored in different sub-chains. The smart contract in each sub-chain determines whether the energy device has the authority to access the target type data in the sub-chain and whether it meets the preset access conditions for accessing the target type data. Only when these two conditions are met can the target shared energy data corresponding to the data sharing request in the sub-chain be obtained, thereby improving the management of energy data by storing different types of data in different sub-chains, and the efficiency of smart contract verification of the identity and authority of energy devices.

[0129] Please refer to Figure 6 , Figure 6 A flow chart of a method for sharing the target shared energy data with the target energy device according to an embodiment of the present application is shown; in the energy device data communication method based on blockchain, sharing the target shared energy data with the target energy device includes the following steps S601-S603: S601, the smart contract in the subchain that matches the type of the target type data determines whether the target shared energy data needs to be encrypted based on the type of the target shared energy data and / or the type of the target energy device; S602: if necessary, encrypt the target shared energy data based on a preset first encryption algorithm to obtain the encrypted target shared energy data, and upload the encrypted target shared energy data to the parent chain; S603: The parent chain shares the encrypted target shared energy data with the target energy device, and records the traceability information of the encrypted target shared energy data.

[0130] If the target shared energy data needs to be transmitted encrypted, the smart contract in the sub-chain will encrypt the data and send the encrypted target shared energy data to the target energy device. Only devices with decryption keys can decrypt the data, further ensuring data security.

[0131] In the embodiment of the present application, whether the target shared energy data needs to be encrypted may be determined based on the type of the target shared energy data and / or the type of the target energy device.

[0132] The encrypted traceability information of the target shared energy data is the source and destination of the target shared energy data.

[0133] In this way, the source and destination of data can be traced through the blockchain network to ensure the traceability and authenticity of the data, and especially to ensure data security, privacy and compliance.

[0134] The following example illustrates the specific steps of data sharing when a home energy device needs to share its collected power data with other devices: Target energy device requests data sharing: The target energy device initiates a data sharing request to the smart contract of the parent chain, requesting access to power data in order to share data with other devices. Exemplarily, the target energy device is a smart home control system.

[0135] Smart contract verification request: After receiving the request, the parent chain’s smart contract first verifies the identity of the target energy device, and the child chain’s smart contract verifies the target energy device’s authority to the requested data. After confirming that the device is legitimate, proceed to the next step.

[0136] Data encryption: If the power data needs to be encrypted, the smart contract will use an encryption algorithm to encrypt the power data and send the encrypted data to the device.

[0137] Data sharing: Smart contracts send encrypted power data to home energy devices based on predefined rules. This data can include real-time power usage or historical power statistics.

[0138] Data usage: After receiving the shared power data, home energy devices can process and use it according to their own needs. For example, smart home control systems can optimize energy utilization based on power data and achieve intelligent energy management.

[0139] Through the data sharing mechanism of smart contracts, home energy devices can safely share data with other devices to achieve data security and legality, thereby improving the collaboration efficiency and data utilization value between IoT devices.

[0140] Data sharing between home energy devices based on blockchain not only ensures the authenticity and integrity of the data, but also enables data traceability. The principle of data traceability is as follows: The immutability of blockchain: Blockchain is a distributed database in which data is linked together in the form of blocks, each of which contains the hash value of the previous block. This structure makes it impossible to tamper with or delete data once it is written to the blockchain.

[0141] Storage of data records: On the blockchain, all data transactions are recorded in blocks and are open and transparent. This means that anyone can view the history of data transactions, thereby tracing the source of the data.

[0142] The following describes the steps of data tracing in detail.

[0143] Data recording: After collecting and processing energy data, home energy devices record the energy data on the blockchain. Each data transaction is written into a new block and linked to the previous block.

[0144] Data Verification: Once data is recorded on the blockchain, other devices or users can verify the authenticity and integrity of the data. They can access the data history through the blockchain network to see where the data came from and where it went.

[0145] Data traceability: Through the blockchain network, the source and destination of data can be traced. In other words, it is possible to see which device the data was generated from, what processing and transmission processes it went through, and where it finally arrived.

[0146] For example, a household energy device collects electricity data for a period of time and records the data on the blockchain. The following are the specific steps for data tracing: Data recording: The home energy device records the collected power data on the blockchain, forming a new data transaction. This data transaction contains the value of the power data, timestamp and other information, and is written into a new block.

[0147] Data Verification: Other devices or users can verify the authenticity and integrity of the data transaction through the blockchain network. They can view the hash value of the transaction and the link to the previous block to ensure that the data has not been tampered with.

[0148] Data traceability: Through the blockchain network, other devices or users can trace the source and destination of the data transaction, so that they can see which home energy device the transaction was initiated from, what processing and transmission processes it went through, and finally it was recorded on the blockchain.

[0149] Through data traceability, the source and destination of data collected by home energy devices can be traced, and the authenticity and integrity of the data can be guaranteed. This provides strong support for data security, privacy and compliance, and enhances users' trust and reliability in IoT data.

[0150] The blockchain-based energy device data communication method described in the embodiment of the present application first initiates a first identity authentication request directly to the blockchain network for a first identity authentication when the energy device performs data interaction, and then performs a second identity authentication based on the data sharing request sent by the target energy device. The security of data sharing is guaranteed through multi-level identity authentication.

[0151] Secondly, when performing a second identity authentication based on the data sharing request sent by the target energy device, identity authentication is performed based on the network attributes unique to the home energy device, the geographic location attributes, or the time attributes determined by the preset data interaction conditions of the target control mode, further ensuring the legitimacy of the identity of the home energy device sharing the data.

[0152] Finally, when this application shares data, specific energy data is encrypted as needed, which further ensures the security of data sharing while taking into account the efficiency of data sharing.

[0153] It is particularly important to explain that in the embodiment of the present application, different types of data are stored on different sub-chains, and the target data type corresponding to the preset data interaction conditions of the target control mode generates a data sharing request for the target type data; then, based on the smart contract of the sub-chain, it is detected whether the target energy device's authority to the target type data is legal, and only the target energy devices with legal authority are allowed to share the target type energy data, so that data is efficiently shared at the granularity of the data type and permission management is performed during sharing, thereby improving the precision and flexibility of data sharing.

[0154] Based on the same inventive concept, the embodiments of the present application also provide a blockchain-based energy device data communication device corresponding to the blockchain-based energy device data communication method. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned blockchain-based energy device data communication method in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0155] Please refer to Figure 7 , Figure 7 The schematic diagram of the structure of the energy equipment data communication device based on blockchain described in the embodiment of the present application is shown; specifically, the device includes: The acquisition module 701 is used to acquire energy data of energy devices registered in the blockchain network, and write the energy data into a subchain of the blockchain network based on the type of the energy data; different subchains store different types of energy data; The first authentication module 702 is used to initiate a first identity authentication request to the blockchain network when the target energy device responds to the preset data interaction condition that meets the target control mode, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; The second authentication module 703 is used for, when the first identity authentication succeeds, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; Processing module 704 is used to, when the second identity authentication is successful, process the data sharing request for the target type data in the sub-chain in the blockchain network that matches the type of the target type data based on the access rules for the target energy device in the smart contract, determine the target shared energy data that complies with the access rules, and share the target shared energy data with the target energy device.

[0156] In some embodiments, in the energy device data communication device based on blockchain, the first authentication module, when the target energy device responds to the preset data interaction condition that satisfies the target control mode, initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request, is specifically used to: The target energy device responds to the preset data interaction condition that meets the target control mode, and initiates a first identity authentication request to the blockchain network; the first identity authentication request includes the first target identity information; The parent chain of the blockchain network verifies the legitimacy of the target energy device based on the matching result of the first target identity information and the pre-stored device identity information; If it is legal, the parent chain of the blockchain network generates a random challenge and sends the random challenge to the target energy device, so that the target energy device uses a pre-stored private key to digitally sign the random challenge and sends the result of the digital signature to the blockchain network; The parent chain of the blockchain network uses the public key of the target energy device to verify the validity of the result of the digital signature. If the signature is valid, the first identity authentication of the target energy device is successful.

[0157] In some embodiments, in the energy device data communication device based on blockchain, the second identity authentication module, when the target energy device generates a data sharing request for target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions, is specifically used to: The target energy device acquires predefined attribute authentication information of the target energy device; the attribute authentication information is defined based on the attribute of the target energy device and corresponds to the identity authentication condition; Based on the attribute authentication information, the second target identity information of the target device, and the preset data interaction conditions of the target control mode, a data sharing request for the target type data is generated, and the data sharing request is sent to the blockchain network; the preset data interaction conditions of the target control mode are used to determine the shared energy data requested by the data sharing request; The parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device.

[0158] In some embodiments, in the energy device data communication device based on blockchain, the second identity authentication module, when the parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on the pre-configured identity authentication conditions and performs the second identity authentication on the target energy device, is specifically used to: Determine verification scores corresponding to attribute authentication information at different levels; wherein the verification scores of attribute authentication information at different levels are different, and the verification scores are determined based on the degree of influence of the attribute authentication information on identity authentication; Determining a total attribute verification score of the attribute authentication information based on the verification scores corresponding to the attribute authentication information at different levels; Based on the comparison result of the attribute verification total score and the preset attribute security score threshold, as well as the second target identity information, a second identity authentication is performed on the target energy device.

[0159] In some embodiments, in the blockchain-based energy device data communication device, the processing module, in the blockchain network, processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract in the subchain matching the type of the target type data, and determines the target shared energy data that meets the access rules, specifically for: The parent chain of the blockchain network sends the data sharing request for the target type data to the child chain matching the type of the target type data; The smart contract in the subchain matching the type of the target type data determines whether the target energy device has the authority to access the target type data and meets the preset access conditions for accessing the target type data based on the access rules for the target energy device; If all are met, the target shared energy data corresponding to the data sharing request is determined.

[0160] In some embodiments, the processing module in the blockchain-based energy device data communication device is specifically used to share the target shared energy data with the target energy device: The smart contract in the subchain matching the type of the target type data determines whether the target shared energy data needs to be encrypted based on the type of the target shared energy data and / or the type of the target energy device; If necessary, encrypt the target shared energy data based on a preset first encryption algorithm to obtain the encrypted target shared energy data, and upload the encrypted target shared energy data to the parent chain; The parent chain shares the encrypted target shared energy data with the target energy device, and records the traceability information of the encrypted target shared energy data.

[0161] In some embodiments, in the blockchain-based energy equipment data communication device, the device further includes: A registration module, used to initiate a registration request to the blockchain network when the energy device is started before obtaining energy data of the energy device that has completed registration in the blockchain network; the registration request includes device identity information; The parent chain of the blockchain network processes the device identity information to generate a first hash value of the device identity information; The parent chain of the blockchain network sends a verification request to the business server that pre-stores the device identity information to receive a second hash value generated by the business server processing the device identity information; The parent chain of the blockchain network verifies whether the first hash value and the second hash value are consistent; If they are consistent, the parent chain of the blockchain network determines that the identity authentication of the energy device is successful, completes the registration of the energy device, and stores the device identity information of the energy device.

[0162] In some embodiments, in the energy device data communication device based on blockchain, the acquisition module, when writing the energy data into the subchain of the blockchain network based on the type of energy data, is specifically used to: Encrypting the energy data based on a second encryption algorithm to obtain encrypted energy data; generating a data summary of the encrypted energy data; Based on the type of the energy data, the encrypted energy data and the data summary are uploaded to a subchain of the blockchain network.

[0163] Based on the same inventive concept, an electronic device corresponding to the blockchain-based energy device data communication method is also provided in the embodiments of the present application. Since the principle of solving the problem by the electronic device in the embodiments of the present application is similar to the above-mentioned blockchain-based energy device data communication method in the embodiments of the present application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0164] Please refer to Figure 8 , Figure 8 A schematic diagram of the structure of the electronic device described in an embodiment of the present application is shown; the electronic device 800 includes: a processor 802, a memory 801 and a bus, the memory 801 stores machine-readable instructions executable by the processor 802, and when the electronic device 800 is running, the processor 802 communicates with the memory 801 through the bus, and when the machine-readable instructions are executed by the processor 802, the steps of the blockchain-based energy device data communication method are executed.

[0165] Based on the same inventive concept, a computer-readable storage medium corresponding to the blockchain-based energy device data communication method is also provided in the embodiments of the present application. Since the principle of solving the problem by the computer-readable storage medium in the embodiments of the present application is similar to the above-mentioned blockchain-based energy device data communication method in the embodiments of the present application, the implementation of a computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0166] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, executes the steps of the energy device data communication method based on blockchain.

[0167] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0168] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0170] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0171] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A blockchain-based energy equipment data communication method, characterized in that: The method comprises: Obtaining energy data of energy devices registered in the blockchain network, and writing the energy data into a subchain of the blockchain network based on the type of the energy data; wherein different subchains store different types of energy data; The target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; When the first identity authentication succeeds, the target energy device generates a data sharing request for the target type data based on the preset data interaction conditions of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; When the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

2. The energy equipment data communication method based on blockchain according to claim 1 is characterized in that: The target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request, including: The target energy device responds to the preset data interaction condition that satisfies the target control mode, and initiates a first identity authentication request to the blockchain network; the first identity authentication request includes the first target identity information; The parent chain of the blockchain network verifies the legitimacy of the target energy device based on the matching result of the first target identity information and the pre-stored device identity information; If it is legal, the parent chain of the blockchain network generates a random challenge and sends the random challenge to the target energy device, so that the target energy device uses a pre-stored private key to digitally sign the random challenge and sends the result of the digital signature to the blockchain network; The parent chain of the blockchain network uses the public key of the target energy device to verify the validity of the result of the digital signature. If the signature is valid, the first identity authentication of the target energy device is successful.

3. The energy equipment data communication method based on blockchain according to claim 1 or 2, characterized in that: The target energy device generates a data sharing request for target type data based on the preset data interaction condition of the target control mode, and sends the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication condition; including: The target energy device acquires predefined attribute authentication information of the target energy device; the attribute authentication information is defined based on the attribute of the target energy device and corresponds to the identity authentication condition; Based on the attribute authentication information, the second target identity information of the target device, and the preset data interaction conditions of the target control mode, a data sharing request for the target type data is generated, and the data sharing request is sent to the blockchain network; the preset data interaction conditions of the target control mode are used to determine the shared energy data requested by the data sharing request; The parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on pre-configured identity authentication conditions, and performs a second identity authentication on the target energy device.

4. The energy equipment data communication method based on blockchain according to claim 3 is characterized in that: The parent chain of the blockchain network verifies the attribute authentication information and the second target identity information based on the pre-configured identity authentication conditions, and performs the second identity authentication on the target energy device, including: Determine verification scores corresponding to attribute authentication information at different levels; wherein the verification scores of attribute authentication information at different levels are different, and the verification scores are determined based on the degree of influence of the attribute authentication information on identity authentication; Determining a total attribute verification score of the attribute authentication information based on the verification scores corresponding to the attribute authentication information at different levels; Based on the comparison result of the attribute verification total score and the preset attribute security score threshold, as well as the second target identity information, a second identity authentication is performed on the target energy device.

5. The energy equipment data communication method based on blockchain according to claim 3 is characterized in that: The subchain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, and determines the target shared energy data that meets the access rules, including: The parent chain of the blockchain network sends the data sharing request for the target type data to the child chain matching the type of the target type data; The smart contract in the subchain matching the type of the target type data determines whether the target energy device has the authority to access the target type data and meets the preset access conditions for accessing the target type data based on the access rules for the target energy device; If all are met, the target shared energy data corresponding to the data sharing request is determined.

6. The energy equipment data communication method based on blockchain according to claim 5 is characterized in that: Sharing the target shared energy data to the target energy device includes: The smart contract in the subchain matching the type of the target type data determines whether the target shared energy data needs to be encrypted based on the type of the target shared energy data and / or the type of the target energy device; If necessary, encrypt the target shared energy data based on a preset first encryption algorithm to obtain the encrypted target shared energy data, and upload the encrypted target shared energy data to the parent chain; The parent chain shares the encrypted target shared energy data with the target energy device, and records the traceability information of the encrypted target shared energy data.

7. The energy equipment data communication method based on blockchain according to claim 1 is characterized in that: Before obtaining the energy data of the energy equipment registered in the blockchain network, the method further includes: When the energy device is started, a registration request is initiated to the blockchain network; the registration request includes device identity information; The parent chain of the blockchain network processes the device identity information to generate a first hash value of the device identity information; The parent chain of the blockchain network sends a verification request to the business server that pre-stores the device identity information to receive a second hash value generated by the business server processing the device identity information; The parent chain of the blockchain network verifies whether the first hash value and the second hash value are consistent; If they are consistent, the parent chain of the blockchain network determines that the identity authentication of the energy device is successful, completes the registration of the energy device, and stores the device identity information of the energy device.

8. The energy equipment data communication method based on blockchain according to claim 1 is characterized in that: The step of writing the energy data into a subchain of the blockchain network based on the type of the energy data includes: Encrypting the energy data based on a second encryption algorithm to obtain encrypted energy data; generating a data summary of the encrypted energy data; Based on the type of the energy data, the encrypted energy data and the data summary are uploaded to a subchain of the blockchain network.

9. A blockchain-based energy equipment data processing device, characterized in that: The device comprises: An acquisition module, used to acquire energy data of energy devices registered in the blockchain network, and write the energy data into a subchain of the blockchain network based on the type of the energy data; wherein different subchains store different types of energy data; A first authentication module is used to initiate a first identity authentication request to the blockchain network when the target energy device responds to the preset data interaction condition that meets the target control mode, so that the parent chain of the blockchain network performs a first identity authentication on the target energy device based on the first identity authentication request; A second authentication module, configured to, when the first identity authentication succeeds, generate a data sharing request for target type data based on the preset data interaction conditions of the target control mode by the target energy device, and send the data sharing request to the blockchain network, so that the parent chain of the blockchain network performs a second identity authentication on the target energy device based on the data sharing request and the pre-configured identity authentication conditions; A processing module is used for, when the second identity authentication is successful, the sub-chain in the blockchain network that matches the type of the target type data processes the data sharing request for the target type data based on the access rules for the target energy device in the smart contract, determines the target shared energy data that complies with the access rules, and shares the target shared energy data with the target energy device.

10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the blockchain-based energy device data communication method as described in any one of claims 1 to 8 are performed.

Citation Information

Patent Citations

  • Data processing method and device, equipment, medium and computer program product

    CN113569279A

  • Building networking data management method based on block chain multi-chain and attribute encryption

    CN115459901A

  • Network security access method and device, equipment and storage medium

    CN118555120A

  • Internet of Things data sharing method, system and device based on block chain and medium

    CN118631818A

  • Trust-varied relationship between blockchain networks

    US20210328770A1

Cited By

  • Blockchain-based data communication method for energy devices

    WO2026145384A1