An Energy Data Security Sharing Method, Device, Electronic Device and Storage Medium Based on Data Sidechain
By utilizing encrypted access control of ciphertext policies and attribute sets in the energy data link, the poor security and privacy of energy data during the flow process is solved, and the encrypted storage and fine-grained sharing of data is realized, which improves the security and privacy protection of user data.
Patent Information
- Application Number
- CN202211147214.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-09-21
AI Technical Summary
In the energy and electricity Internet, there are problems such as many intermediate flow nodes, opaque data, and poor security and privacy in the process of energy data flow, so user privacy cannot be effectively protected.
Through a data side chain-based method, the plaintext data is encrypted using the ciphertext strategy, and the attribute set is embedded in the user key, so as to realize the attribute-level encryption access control, and realize the data encryption storage and fine-grained sharing of distributed databases.
It realizes the security of user data, ensuring the privacy protection and fine-grained management of access control during the flow process.
Smart Images

Figure CN115567266B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a method and device for securely sharing energy data based on a data side chain. Background Art
[0002] With the rapid development of the energy and power internet grid, energy and power data is experiencing a massive increase. Energy platforms can analyze this data to provide valuable services. However, this also raises a series of issues, such as the numerous intermediate transfer nodes, data opacity, and poor security and privacy in the current energy and power internet. When a user's identity information is stored in their own energy storage device and has access rights, these rights are controlled by the user and released when the user participates in transactions. In the traditional centralized model, user information is collected and stored by the power plant. A leak can expose users' personal information, and fine-grained electricity usage data can also reveal users' electricity usage data, making user privacy inadequately protected. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method and device for secure sharing of energy data based on a data side chain.
[0004] According to one aspect of an embodiment of the present application, a method for securely sharing energy data based on a data side chain is provided, which is applied to a target energy router in an energy data chain, wherein the target energy router is any energy router in the energy data chain, and the method further includes:
[0005] Obtaining original ciphertext data sent by a target user, and decrypting the target ciphertext data to obtain plaintext content carrying energy data, wherein the target user is a user with a binding relationship with the target routing node;
[0006] Obtaining a ciphertext policy and a ciphertext attribute set corresponding to the original ciphertext data, wherein the ciphertext policy includes a specified access structure for the target ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure;
[0007] Encrypting the ciphertext policy and the plaintext content to obtain target ciphertext data, and embedding the ciphertext attribute set into a user key;
[0008] The target ciphertext data is shared with the energy data chain, so that other energy routers in the energy data chain obtain the user key according to their own attributes and use the user key to access the target ciphertext data.
[0009] Furthermore, decrypting the target ciphertext data to obtain the plaintext content carrying the energy data includes:
[0010] Obtaining a private key of the target energy router;
[0011] The original ciphertext data is decrypted using the private key to obtain the plaintext content carrying the energy data.
[0012] Furthermore, the obtaining of the private key of the target energy router includes:
[0013] Sending a first key acquisition request to a registration device, so that the registration device generates a master key pair according to the first key acquisition request, and sends the master key pair to the target energy router, wherein the master key pair includes: a master public key and a master private key;
[0014] The master key pair sent by the registration device is received, and a public key and a private key of the target energy router are generated by using a random number and a master public key and a master private key in the master key pair respectively.
[0015] Furthermore, encrypting the ciphertext policy and the plaintext content to obtain target ciphertext data includes:
[0016] Sending a second key acquisition request to the key distribution device, so that the key distribution device generates a system public key and a system secret key according to the security factor and attribute space of the key distribution device, generates a user secret key according to the system public key, the system secret key, and the ciphertext attribute set, and sends the system public key to the target energy router, wherein the user secret key is used to decrypt the ciphertext data encrypted by the system secret key;
[0017] Receive the system public key issued by the key distribution device, use the system public key to encrypt the ciphertext policy and the plaintext content, and obtain the target ciphertext data.
[0018] Furthermore, the method further comprises:
[0019] Acquire energy data to be traded and a transaction object, and generate a private transaction request based on the transaction energy data and the transaction object;
[0020] Sending the private transaction request to the energy trading platform, so that the energy trading platform authenticates the identity information of the target energy router based on the private transaction request, and if the authentication is successful, the regulatory node on the energy data chain and the transaction object are included in the transaction related party information corresponding to the private transaction request, and the transaction related party information is sent to the target energy router;
[0021] receiving transaction-related party information sent by the energy trading platform, and sending a status confirmation request to a supervisory node indicated by the transaction-related party information, wherein the status confirmation request is used to confirm the status of the transaction object;
[0022] The transaction status fed back by the supervisory node based on the status confirmation request is received, and when it is determined that the transaction status of the transaction object is normal, a transaction is initiated to the transaction object.
[0023] Furthermore, the method further comprises:
[0024] receiving an energy router joining request, wherein the energy router joining request carries identity information of an energy router to be joined;
[0025] Sending the identity information of the energy router to be added to the genesis node of the energy data chain, so that the genesis node writes the identity information of the energy router to be added into the member list;
[0026] Based on the identity information of the energy router to be added, the accumulated value corresponding to the energy router in the energy data chain is calculated, and the accumulated value is broadcast in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, it is confirmed that the energy router to be added has joined the energy data chain.
[0027] Furthermore, the method further comprises:
[0028] receiving an energy router exit request, wherein the energy router exit request carries identity information of the energy router to be exited;
[0029] Detecting whether the energy router to be exited currently exists in the energy data chain;
[0030] If the energy data chain to be exited exists in the energy data chain, sending the identity information of the energy router to be exited to the genesis node of the energy data chain, so that the genesis node deletes the identity information of the energy router to be exited from the member list;
[0031] Based on the identity information of the energy router to be added or exited, the accumulated value corresponding to the energy router in the energy data chain is calculated, and the accumulated value is broadcast in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, it is confirmed that the energy router to be exited has exited the energy data chain.
[0032] According to another aspect of the embodiments of the present application, there is also provided an energy data security sharing device based on a data side chain, comprising:
[0033] a first acquisition module, configured to acquire original ciphertext data sent by a target user and decrypt the target ciphertext data to obtain plaintext content, wherein the target user is a user having a binding relationship with the target routing node;
[0034] a second acquisition module, configured to acquire a ciphertext policy and a ciphertext attribute set corresponding to the original ciphertext data, wherein the ciphertext policy includes a specified access structure for the target ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure;
[0035] An encryption module, configured to encrypt the ciphertext policy and the plaintext content to obtain target ciphertext data, and embed the ciphertext attribute set into a user key;
[0036] The sharing module is used to share the target ciphertext data to the energy data chain, so that other energy routers in the energy data chain can obtain the user key according to their own attributes and use the user key to access the target ciphertext data.
[0037] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0038] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.
[0039] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0040] The above-mentioned technical solution provided by the embodiment of the present application has the following advantages over the existing technology: the method provided by the embodiment of the present application utilizes a ciphertext strategy and an attribute set, encrypts the plaintext data using the ciphertext strategy, and embeds the attribute set into the user key, thereby realizing attribute-level encryption access control, thereby realizing data encryption storage and fine-grained sharing of a distributed database, making user data more secure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0043] Figure 1 A flowchart of a method for securely sharing energy data based on a data side chain provided in an embodiment of the present application;
[0044] Figure 2 A block diagram of an apparatus for a method for securely sharing energy data based on a data side chain provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions 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. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0048] The present invention provides a method and apparatus for securely sharing energy data based on a data sidechain. The method provided by the present invention can be applied to any desired electronic device, such as a server or terminal. For ease of description, the method is not specifically limited here and will be referred to as an electronic device.
[0049] According to one aspect of the embodiments of the present application, a method embodiment of a method for securely sharing energy data based on a data side chain is provided. Figure 1 A flowchart of a method for securely sharing energy data based on a data side chain is provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0050] Step S11, obtaining the original ciphertext data sent by the target user, and decrypting the target ciphertext data to obtain the plaintext content carrying the energy data, wherein the target user is a user with a binding relationship with the target routing node.
[0051] The method provided in the embodiment of the present application is applied to a target energy router in an energy data chain. The target energy router is any energy router in the energy data chain. It should be noted that each energy router in the energy data chain is associated with a user in a region.
[0052] In this embodiment of the present application, when a target user needs to trade energy data, they need to write the energy data into plain text and encrypt it to obtain the target ciphertext data. When the target energy router receives the target ciphertext data, it will decrypt the target ciphertext data to obtain the plain text content carrying the energy data.
[0053] The process of decrypting the target ciphertext data includes: obtaining the private key of the target energy router; decrypting the original ciphertext data using the private key to obtain the plaintext content containing the energy data. Specifically, obtaining the private key of the target energy router includes: sending a first key acquisition request to the registration device, so that the registration device generates a master key pair based on the first key acquisition request and sends the master key pair to the target energy router. The master key pair includes: a master public key MPU and a master private key MPR; receiving the master key pair sent by the registration device, and using a random number a with the master public key MPU and the master private key MPR in the master key pair to generate the public key and private key of the target energy router. For example, the public key generation formula is: PUer = f(MPU, a), and the private key generation formula is: PRer = f(MPU, a), where f is the master key generation key function.
[0054] In addition, when a user first joins the energy data chain, he needs to register. After receiving the user's registration information, the registration device will check the authenticity of the user's identity and then pass the public key PU of the energy router to the energy data chain. ER Sent to the user. The user according to Sec = PRuser (hash (PU user , PU ER )) calculates its own secret value Sec, which can represent its affiliation with a certain area. At the same time, the user uses his public key PUuser Send it to the registration device, and then the registration device will transfer the user's (Sec, PU user ) is sent to the Energy Router ER. The Energy Router ER uses a Merkle tree to calculate the hash value of all users in the area. After the user completes registration, energy data transactions are conducted directly on the Energy Router.
[0055] Step S12: Obtain the ciphertext policy and ciphertext attribute set corresponding to the original ciphertext data. The ciphertext policy includes a specified access structure of the target ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure.
[0056] In an embodiment of the present application, after obtaining the original ciphertext data, the target energy router can also prompt the target user to upload a ciphertext policy and a ciphertext attribute set. The ciphertext policy includes a specified access structure for the target ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure. For example, if the target ciphertext data includes a three-level structure of A, B, and C, attribute a can access all three levels of the structure, attribute b can only access the second level of the structure B and C, and attribute c can only access the first level of the structure C, and all other attributes are inaccessible.
[0057] Step S13: encrypt the ciphertext policy and the plaintext content to obtain target ciphertext data, and embed the ciphertext attribute set into the user key.
[0058] In an embodiment of the present application, encrypting the ciphertext policy and plaintext content to obtain target ciphertext data includes: sending a second key acquisition request to a key distribution device, causing the key distribution device to generate a system public key PSK and a system secret key MSK based on the key distribution device's security factor and attribute space; and generating a user secret key USK based on the system public key PSK, the system secret key MSK, and the ciphertext attribute set K, using the generation formula: KeyGen(PSK, MSK, K) → USK. The system public key is then sent to the target energy router, where the user secret key is used to decrypt the ciphertext data encrypted with the system key. The target energy router receives the system public key sent by the key distribution device and encrypts the ciphertext policy Kcp and plaintext content T using the system public key PSK to obtain target ciphertext data CT. The encryption algorithm is: Encrypt(PSK, T, Kcp) → CT.
[0059] In step S14, the target ciphertext data is shared with the energy data chain, so that other energy routers in the energy data chain can obtain the user key according to their own attributes and use the user key to access the target ciphertext data.
[0060] In an embodiment of the present application, the target energy router shares the securely encrypted target ciphertext data with the energy data chain, so that other energy routers in the energy data chain can access it according to their own attributes. At the same time, the target ciphertext data will also be stored in the blockchain associated with the energy data chain. Specifically, the timestamp corresponding to the target ciphertext data is first obtained, the timestamp is used to query the corresponding target block, and the energy data is written to the target block. Among them, each block in the blockchain records the energy data of all energy routers in a certain time period. These data are calculated through hash and form a new block in the form of a Merkle tree. A timestamp is added to the block header and connected in order, so that the data can be traced, thereby increasing the difficulty of information forgery and ensuring the credibility of the data. The block header mainly contains the sequence number of the current block, the hash value of the previous block, the hash value of the current block, the timestamp of block production, the address of the block generator, and the signature of the block generator on the hash value of the current block.
[0061] It should be noted that Ciphertext-Policy ABE embeds the ciphertext policy into the ciphertext and the attributes into the user key. The ciphertext corresponds to an access structure, and the key corresponds to an attribute set. Decryption is possible only if the attributes in the attribute set can satisfy this access structure. Since the policy is embedded in the ciphertext, this means that the target user (data owner) can set a policy to decide which energy routers with which attributes can access the ciphertext data. When the attributes of other energy routers do not match the attributes in the attribute set, the user key cannot be obtained, that is, the energy router cannot access the ciphertext data. This is equivalent to performing an encrypted access control on the data with a granularity that can be refined to the attribute level, thereby realizing encrypted storage and fine-grained sharing of data in a distributed database.
[0062] The method provided in the embodiment of the present application utilizes a ciphertext strategy and an attribute set, encrypts plaintext data using the ciphertext strategy, and embeds the attribute set into the user key, thereby realizing attribute-level encryption access control, thereby realizing data encryption storage and fine-grained sharing in a distributed database, making user data more secure.
[0063] In the embodiment of the present application, the method further includes the following steps A1-A4:
[0064] Step A1: Obtain energy data to be traded and a transaction object, and generate a private transaction request based on the transaction energy data and the transaction object.
[0065] Step A2: Send a private transaction request to the energy trading platform so that the energy trading platform authenticates the identity information of the target energy router based on the private transaction request. If the authentication is successful, the regulatory node and transaction object on the energy data chain are included in the transaction-related party information corresponding to the private transaction request, and the transaction-related party information is sent to the target energy router.
[0066] Step A3: Receive transaction-related party information sent by the energy trading platform, and send a status confirmation request to the supervision node indicated by the transaction-related party information, wherein the status confirmation request is used to confirm the status of the transaction object.
[0067] Step A4: Receive the transaction status fed back by the supervisory node based on the status confirmation request, and initiate a transaction with the transaction object if it is determined that the transaction status of the transaction object is normal.
[0068] In this embodiment of the present application, when Energy Router A initiates a private transaction with Energy Router B, Energy Router A initiates the private transaction request through the energy trading platform. After verifying Energy Router A's identity, it obtains Energy Router A's personal information for the transaction. Energy routers on the network synchronize to this transaction, verify that the transaction is valid and legal, and then add the supervisory node and Energy Router B as parties to the transaction. The three contract ledgers of Energy Router A, Energy Router B, and the supervisory node can all record the complete status of the corresponding energy routers. When Energy Router C transacts with Energy Router A or Energy Router B, Energy Router C cannot determine the private status of Energy Router A or Energy Router B. Energy Router C queries the Energy Router A and Energy Router B status ledgers maintained by the supervisory node for the complete status of Energy Router A and Energy Router B to determine whether the transaction can be initiated.
[0069] Furthermore, when multiple transactions are occurring simultaneously, each node can only view its own transactions. The final transaction results of other nodes' private transactions can be obtained by querying the supervisory node. Based on the proof provided by the supervisory node, all nodes in the blockchain can verify the transaction and update their node status.
[0070] In the embodiment of the present application, the method further includes the following steps B1-B3:
[0071] Step B1: receiving an energy router joining request, wherein the energy router joining request carries identity information of an energy router to be joined.
[0072] Step B2: sending the identity information of the energy router to be added to the genesis node of the energy data chain, so that the genesis node writes the identity information of the energy router to be added into the member list.
[0073] Step B3: Calculate the accumulated value corresponding to the energy router in the energy data chain based on the identity information of the energy router to be added, and broadcast the accumulated value in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, the energy router to be added is confirmed to join the energy data chain.
[0074] In the embodiment of the present application, when the target energy router monitors that a new energy router has requested to join the energy data link, the (ID, PU ER , MerkleRoot) value will be written into the member list first.
[0075] At this point, the target energy router calculates the new accumulated value and its own witness (Z new ,w,aux Add )=Add(k,Z old , hash(ID, Merkle)). At the same time, the new accumulated value Z is broadcast to the energy data chain. new , other nodes verify whether the new accumulated value is correct. If it is correct, it confirms that the new energy router has joined successfully. Then, the new energy router's (ID, PU ER ,MerkleRoot,aux,w) will be written into the genesis node of the energy data chain. If it is incorrect, the energy router will be discarded. The remaining energy routers update their own witness w i '←Upd(k,hash(ID,MerkleRoot),w i ,aux Add ).
[0076] In the embodiment of the present application, the method further includes the following steps C1-C4:
[0077] Step C1: receiving an energy router exit request, wherein the energy router exit request carries the identity information of the energy router to be exited;
[0078] Step C2: Detect whether the energy router to be exited currently exists in the energy data chain;
[0079] Step C3: If the energy data chain to be exited exists in the energy data chain, send the identity information of the energy router to be exited to the genesis node of the energy data chain, so that the genesis node deletes the identity information of the energy router to be exited from the member list;
[0080] Step C4, based on the identity information of the energy router to be added or exited, the accumulated value corresponding to the energy router in the energy data chain is calculated, and the accumulated value is broadcast in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, it is confirmed that the energy router to be exited has exited the energy data chain.
[0081] In the embodiment of the present application, when the target energy router monitors that a certain energy router has exited the energy chain, it first calculates Ver(k, hash(ID, MerkleRoot), w, z) = 1 to verify whether the node is in the energy data chain. If the verification is successful, the node is deleted and (Z new ,aux Del )←Del(k,Z old , hash(ID, MerkleRoot)), recalculate the accumulated value. Then broadcast the new accumulated value to the energy data chain. All energy routers verify Z new If the accumulated value is updated correctly, the witness of each energy router is updated at the same time, otherwise it terminates.
[0082] Figure 2 This is a block diagram of an energy data security sharing device based on a data side chain provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 2 As shown, the device includes:
[0083] A first acquisition module 21 is configured to acquire original ciphertext data sent by a target user and decrypt the target ciphertext data to obtain plaintext content, wherein the target user is a user that has a binding relationship with the target routing node;
[0084] A second acquisition module 22 is configured to acquire a ciphertext policy and a ciphertext attribute set corresponding to the original ciphertext data, wherein the ciphertext policy includes a specified access structure for the target ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure;
[0085] The encryption module 23 encrypts the ciphertext policy and the plaintext content to obtain the target ciphertext data, and embeds the ciphertext attribute set into the user key;
[0086] The sharing module 24 is used to share the target ciphertext data to the energy data chain, so that other energy routers in the energy data chain can obtain the user key according to their own attributes and use the user key to access the target ciphertext data.
[0087] In the embodiment of the present application, the first acquisition module 21 is used to obtain the private key of the target energy router; and use the private key to decrypt the original ciphertext data to obtain the plaintext content carrying the energy data.
[0088] In an embodiment of the present application, the first acquisition module 21 is used to send a first key acquisition request to the registration device, so that the registration device generates a master key pair according to the first key acquisition request, and sends the master key pair to the target energy router, where the master key pair includes: a master public key and a master private key; receive the master key pair sent by the registration device, and use a random number and the master public key and the master private key in the master key pair to generate the public key and private key of the target energy router.
[0089] In an embodiment of the present application, the encryption module 23 is used to send a second key acquisition request to the key distribution device, so that the key distribution device generates a system public key and a system key according to the security factor and attribute space of the key distribution device, generates a user key according to the system public key, the system key and the ciphertext attribute set, and sends the system public key to the target energy router, wherein the user key is used to decrypt the ciphertext data encrypted by the system key; and receives the system public key sent by the key distribution device.
[0090] In an embodiment of the present application, a transaction processing module is used to obtain energy data and transaction objects to be traded, and generate a private transaction request based on the traded energy data and transaction objects; send the private transaction request to the energy trading platform so that the energy trading platform authenticates the identity information of the target energy router based on the private transaction request, and if the authentication is successful, the supervisory node and transaction object on the energy data chain are included in the transaction-related party information corresponding to the private transaction request, and the transaction-related party information is sent to the target energy router; receive the transaction-related party information sent by the energy trading platform, and send a status confirmation request to the supervisory node indicated by the transaction-related party information, wherein the status confirmation request is used to confirm the status of the transaction object; receive the transaction status fed back by the supervisory node based on the status confirmation request, and initiate a transaction to the transaction object when it is determined that the transaction status of the transaction object is normal.
[0091] In an embodiment of the present application, the device also includes: a processing module, used to receive an energy router joining request, wherein the energy router joining request carries the identity information of the energy router to be joined; sending the identity information of the energy router to be joined to the genesis node of the energy data chain, so that the genesis node writes the identity information of the energy router to be joined into the member list; calculating the accumulated value corresponding to the energy router in the energy data chain based on the identity information of the energy router to be joined, and broadcasting the accumulated value in the energy data chain, so that other energy routers in the energy data chain verify the accumulated value, and if the verification is successful, confirming that the energy router to be joined has joined the energy data chain.
[0092] In an embodiment of the present application, a processing module is used to receive an energy router exit request, wherein the energy router exit request carries the identity information of the energy router to be exited; detect whether the energy router to be exited currently exists in the energy data chain; if the energy data chain to be exited exists in the energy data chain, send the identity information of the energy router to be exited to the genesis node of the energy data chain, so that the genesis node deletes the identity information of the energy router to be exited from the member list; calculate the accumulated value corresponding to the energy router in the energy data chain based on the identity information of the energy router to be exited, and broadcast the accumulated value in the energy data chain, so that other energy routers in the energy data chain verify the accumulated value, and if the verification is successful, confirm that the energy router to be exited has exited the energy data chain.
[0093] The present application also provides an electronic device, such as Figure 3 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0094] Memory 1503, used for storing computer programs;
[0095] The processor 1501 is configured to implement the steps of the above embodiment when executing the computer program stored in the memory 1503 .
[0096] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0097] The communication interface is used for communication between the above terminal and other devices.
[0098] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0099] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0100] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the energy data sharing method based on the data link described in any of the above embodiments.
[0101] In another embodiment provided by the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the energy data sharing method based on the data link as described in any one of the above embodiments.
[0102] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive SolidState Disk).
[0103] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the scope of protection of the present application.
[0104] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims
1. A method for securely sharing energy data based on a data side chain, applied to a target energy router in an energy data chain, wherein the target energy router is any energy router in the energy data chain, characterized in that: The method further comprises: Obtaining original ciphertext data sent by a target user, and decrypting the original ciphertext data to obtain plaintext content carrying energy data, wherein the target user has a binding relationship with the target energy router; Obtaining a ciphertext policy and a ciphertext attribute set corresponding to the original ciphertext data, wherein the ciphertext policy includes a specified access structure for the original ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure; Encrypting the ciphertext policy and the plaintext content to obtain target ciphertext data; Sharing the target ciphertext data to the energy data chain, so that other energy routers in the energy data chain obtain user keys according to their own attributes and use the user keys to access the target ciphertext data; The encrypting of the ciphertext policy and the plaintext content to obtain the target ciphertext data includes: sending a second key acquisition request to a key distribution device, so that the key distribution device generates a system public key and a system secret key according to the security factor and attribute space of the key distribution device, generates a user key according to the system public key, the system secret key and the ciphertext attribute set, and sends the system public key to the target energy router; receiving the system public key sent by the key distribution device, and using the system public key to encrypt the ciphertext policy and the plaintext content to obtain the target ciphertext data.
2. The method according to claim 1, characterized in that Decrypting the original ciphertext data to obtain plaintext content carrying energy data includes: Obtaining a private key of the target energy router; The original ciphertext data is decrypted using the private key to obtain the plaintext content carrying the energy data.
3. The method according to claim 2, characterized in that The obtaining of the private key of the target energy router includes: Sending a first key acquisition request to a registration device, so that the registration device generates a master key pair according to the first key acquisition request, and sends the master key pair to the target energy router, wherein the master key pair includes: a master public key and a master private key; The master key pair sent by the registration device is received, and a public key and a private key of the target energy router are generated by using a random number and a master public key and a master private key in the master key pair respectively.
4. The method according to claim 1, wherein The method further comprises: Acquire energy data to be traded and a transaction object, and generate a private transaction request based on the energy data to be traded and the transaction object; Sending the private transaction request to the energy trading platform, so that the energy trading platform authenticates the identity information of the target energy router based on the private transaction request, and if the authentication is successful, the regulatory node on the energy data chain and the transaction object are included in the transaction related party information corresponding to the private transaction request, and the transaction related party information is sent to the target energy router; receiving transaction-related party information sent by the energy trading platform, and sending a status confirmation request to a supervisory node indicated by the transaction-related party information, wherein the status confirmation request is used to confirm the status of the transaction object; The transaction status fed back by the supervisory node based on the status confirmation request is received, and when it is determined that the transaction status of the transaction object is normal, a transaction is initiated to the transaction object.
5. The method according to claim 1, wherein The method further comprises: receiving an energy router joining request, wherein the energy router joining request carries identity information of an energy router to be joined; Sending the identity information of the energy router to be added to the genesis node of the energy data chain, so that the genesis node writes the identity information of the energy router to be added into the member list; Based on the identity information of the energy router to be added, the accumulated value corresponding to the energy router in the energy data chain is calculated, and the accumulated value is broadcast in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, it is confirmed that the energy router to be added has joined the energy data chain.
6. The method according to claim 1, characterized in that The method further comprises: receiving an energy router exit request, wherein the energy router exit request carries identity information of the energy router to be exited; Detecting whether the energy router to be exited currently exists in the energy data chain; If the energy router to be exited exists in the energy data chain, sending the identity information of the energy router to be exited to the genesis node of the energy data chain, so that the genesis node deletes the identity information of the energy router to be exited from the member list; Based on the identity information of the energy router to be exited, the accumulated value corresponding to the energy router in the energy data chain is calculated, and the accumulated value is broadcast in the energy data chain so that other energy routers in the energy data chain can verify the accumulated value. If the verification is successful, it is confirmed that the energy router to be exited has exited the energy data chain.
7. An energy data security sharing device based on data side chain, characterized in that: include: a first acquisition module, configured to acquire original ciphertext data sent by a target user and decrypt the original ciphertext data to obtain plaintext content, wherein the target user has a binding relationship with the target energy router; a second acquisition module, configured to acquire a ciphertext policy and a ciphertext attribute set corresponding to the original ciphertext data, wherein the ciphertext policy includes a specified access structure for the original ciphertext data, and the ciphertext attribute set includes at least one attribute that satisfies the specified access structure; An encryption module, configured to encrypt the ciphertext policy and the plaintext content to obtain target ciphertext data; a sharing module, configured to share the target ciphertext data to the energy data chain, so that other energy routers in the energy data chain can obtain a user key according to their own attributes and use the user key to access the target ciphertext data; The encryption module is specifically used to send a second key acquisition request to the key distribution device, so that the key distribution device generates a system public key and a system secret key according to the security factor and attribute space of the key distribution device, generates a user key according to the system public key, the system secret key and the ciphertext attribute set, and sends the system public key to the target energy router; receives the system public key sent by the key distribution device, and uses the system public key to encrypt the ciphertext policy and the plaintext content to obtain the target ciphertext data.
8. A storage medium, characterized in that: The storage medium includes a stored program, wherein the method according to any one of claims 1 to 7 is executed when the program is executed.
9. An electronic device, characterized in that: The system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: Memory for storing computer programs; A processor, configured to execute the method according to any one of claims 1 to 7 by running a program stored in a memory.
Citation Information
Patent Citations
Traceable and privacy-protected data sharing method based on mobile crowd sensing
CN113179270A
Block chain privacy data access control method and system
CN114679271A