Blockchain-based anti-counterfeiting and traceability method and system for electric energy metering data of a charging machine
By binding the identifier code to the electricity metering data on the blockchain and using the Merkle tree to achieve multi-level traceability, the security and traceability issues in the process of transmitting electricity metering data in the charger are solved, and the authenticity of the data and its safe and reliable transmission are realized.
Patent Information
- Application Number
- CN202111277445.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In existing technologies, the transmission of charger energy metering data suffers from low security, high cost, and the inability to achieve multi-level traceability. In particular, the encryption method cannot effectively utilize the correspondence between the data and the platform.
By constructing identification codes for chargers, electricity meters, distribution areas, and management platforms on the blockchain, and combining them with electricity metering data, multi-level traceability is achieved using Merkle trees, and the authenticity of the data is verified by identifying the identification codes.
It enables secure and reliable transmission and traceability of electricity metering data across multiple levels, ensuring the authenticity of the data, reducing costs, and improving the security and efficiency of transmission.
Smart Images

Figure CN113919854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of charger electric energy data management, and particularly relates to a charger electric energy metering data anti-fake traceability method and system based on a blockchain. BACKGROUND
[0002] With the rapid development of industry and power systems, the demand for power load is increasing, and the management of electric energy metering data is becoming more and more important. The charger electric energy meter is a metering device for electric energy metering. The metering data of each electric energy meter needs to be continuously transmitted to the upper level, such as the metering data of each electric energy meter being transmitted to the transformer area, and the metering data of the transformer area being transmitted to the management platform (such as the marketing platform) and the like. The electric energy metering needs to ensure the accuracy and reliability of the data in the transmission process, and in order to ensure that the accurate electric energy value is transmitted to the settlement electric energy meter, a value traceability chain needs to be established to ensure the accuracy and reliability of the value.
[0003] At present, a standard quantity transmission system has been established to enable the metering data to be transmitted according to a unified standard, but the electric energy metering data may still be destroyed or tampered with during transmission, and the safety and reliability of data transmission is not high. In order to solve the safety problem of electric energy metering data transmission, the existing technology usually realizes anti-fake by using encryption and verification, that is, the sender first encrypts the metering data to be transmitted according to a certain encryption method, and the receiver first decrypts the encrypted metering data according to the decryption method corresponding to the encryption method, and judges the authenticity of the data by verifying whether it passes. However, the above-mentioned encryption method of electric energy metering data to improve the transmission safety will have the following problems:
[0004] (1) The use of encryption method needs to perform data encryption and decryption operations at the sender and the receiver, which is not only complex and requires high cost, but also still has transmission reliability problems.
[0005] (2) There is a corresponding relationship between the charger electric energy meter, the transformer area, the management platform (marketing platform) and the data. In the encryption method, only the encryption is realized according to the encryption algorithm, and the corresponding relationship between the data and the platform cannot be fully utilized to realize the identification of the authenticity of the electric energy metering data, so the corresponding relationship between the data and the platform cannot be identified in practice;
[0006] (3) In the transmission process of electric energy metering data, only the transmission node information and time information can be transmitted to one layer, and multi-level transmission traceability cannot be realized.
[0007] Therefore, it is urgent to provide a charger electric energy metering data anti-fake traceability method to improve the safety and reliability and efficiency of anti-fake and traceability. SUMMARY
[0008] The technical problem to be solved by the present application is that, in view of the technical problems existing in the prior art, the present application provides a charging machine electric energy metering data anti-fake traceability method and system based on a block chain, which has the advantages of simple implementation method, strong flexibility, multi-level transfer traceability, high safety and reliability.
[0009] To solve the above technical problems, the technical solution provided by the present application is:
[0010] A charging machine electric energy metering data anti-fake traceability method based on a block chain, comprising the following steps:
[0011] S01. Obtain information of all charging machine electric energy meters in a specified area, and generate a first identification code of the charging machine electric energy meter according to the obtained information, and write the first identification code and the electric energy metering data of the charging machine electric energy meter into a block chain after combination;
[0012] S02. Generate a second identification code of the current area according to the first identification code of all charging machine electric energy meters in the current area, and write the second identification code and the electric energy metering data of the current area into the block chain after combination;
[0013] S03. Generate a third identification code of the current management platform according to the second identification code of all areas in the specified management platform, and write the third identification code into the block chain;
[0014] S04. In the transmission process of the electric energy metering data of the charging machine electric energy meter, obtain the transmission node information by identifying the identification code and write it into the block chain;
[0015] S05. When the electric energy metering data is obtained, identify the authenticity of the data according to the identification code.
[0016] Further, the step S01 comprises the following steps:
[0017] S101. Generate a pseudo-random sequence using a random number generator, and extract part of the binary code from the pseudo-random sequence;
[0018] S102. Perform XOR operation on the obtained information of the charging machine electric energy meter and the extracted binary code to generate the first identification code of the charging machine electric energy meter;
[0019] S103. Combine the first identification code and the electric energy metering data of the charging machine electric energy meter to form a new sequence, and write it into the merkle tree of the block chain.
[0020] Further, the step S02 comprises the following steps:
[0021] S201. Perform bitwise XOR operation on the first identification code of all charging machine electric energy meters in the current area to generate the second identification code;
[0022] S202. Combine the second identification code with the power metering data of the current substation to form a new sequence, and write the new sequence as a first tree root value to the merkle tree of the blockchain.
[0023] Further, the step S03 comprises:
[0024] S301. Perform a bitwise XOR operation on the second identification codes of all substations in the designated management platform to generate the third identification code of the current management platform.
[0025] S302. Write the third identification code as a second tree root value to the merkle tree of the blockchain.
[0026] Further, after the step S03, the step S04 further comprises:
[0027] According to the third identification codes within the required supervision range, generate a fourth identification code, and write the fourth identification code to the blockchain.
[0028] Further, the third identification codes of each management platform within the required supervision range are specifically subjected to a bitwise XOR operation to generate the fourth identification code, and the fourth identification code is written as a third tree root value to the merkle tree of the blockchain.
[0029] Further, the step S05 comprises:
[0030] S501. Read the third identification and the second identification of the substation from the power metering data, perform an XOR check on the read third identification and the second identification of the substation, and determine whether the currently obtained power metering data belongs to the designated management platform according to the check result.
[0031] S502. Read the second identification of the substation and the first identification of the charger power meter from the power metering data, perform an XOR check on the read second identification and the first identification, and determine whether the currently obtained power metering data belongs to the current substation according to the check result.
[0032] Further, before the step S501, the step further comprises reading a fourth identification code and a third identification code of a management platform from the power metering data, performing an XOR check on the read fourth identification code and the third identification code, and determining whether the currently obtained power metering data belongs to the current supervision range according to the check result.
[0033] A blockchain-based charger power metering data anti-counterfeiting and traceability system, comprising:
[0034] The first write control module is used for acquiring information of all electric energy meters of charging machines in a specified area, and generating a first identification code of the electric energy meter of the charging machine according to the acquired information, and writing the first identification code and electric energy metering data of the charging machine into a blockchain after combination;
[0035] The second write control module is used for generating a second identification code of a current area according to the first identification code of all electric energy meters of charging machines in the current area, and writing the second identification code and electric energy metering data of the current area into the blockchain after combination;
[0036] The third write control module is used for generating a third identification code of a current management platform according to the second identification code of all areas in the specified management platform, and writing the third identification code into the blockchain;
[0037] The fourth write control module is used for acquiring transmission node information and writing into the blockchain by identifying the identification code in the transmission process of the electric energy metering data of the charging machine;
[0038] The identification module is used for identifying the authenticity of the data according to the identification code when the electric energy metering data is acquired.
[0039] A computer device includes a processor and a memory, the memory is used for storing a computer program, the processor is used for executing the computer program, and the processor is used for executing the computer program to perform the above method.
[0040] Compared with the prior art, the advantages of the present application are that:
[0041] 1、The present application constructs the identification codes corresponding to the electric energy meter of the charging machine, the area and the management platform in sequence, and writes the identification codes and the corresponding electric energy metering data into the blockchain, records the transmission node information and writes into the blockchain by identifying the identification code of the transmission node device in the transmission process of the electric energy metering data, and then identifies the authenticity of the electric energy metering data according to the identification code, so that the electric energy metering data can be managed in a layered manner among the electric energy meter of the charging machine, the area, the management platform and the supervision agency, each electric energy meter of the charging machine and the area are bound, and the area and the management platform are bound, so that multi-level transmission traceability can be realized, and the safety and reliability of the authenticity identification and traceability of the electric energy metering data in the blockchain can be ensured.
[0042] 2、The present application further generates a pseudo-random sequence by a random number generator by reading the charging machine electric energy meter code, synthesizes the first identification code of the charging machine electric energy meter, and then binds with the area, the management platform and the upper level platform of the management platform in sequence to generate the second, third and fourth identification codes, and writes into the merkle tree and stores into the blockchain, so that the layered merkle tree management can be realized, and the accurate authenticity identification and traceability of the electric energy metering data in the blockchain can be effectively ensured. Attached Figure Description
[0043] Figure 1 This is a schematic diagram illustrating the implementation process of the blockchain-based anti-counterfeiting and traceability method for charger energy metering data in this embodiment.
[0044] Figure 2 This is a schematic diagram of the implementation process for generating the first identifier code in this embodiment.
[0045] Figure 3 This is a schematic diagram of the implementation process for generating the second identifier code in this embodiment.
[0046] Figure 4 This is a schematic diagram illustrating the process of generating the third identifier code in this embodiment.
[0047] Figure 5 This is a detailed flowchart illustrating the process of implementing anti-counterfeiting and traceability of electrical energy metering data in a specific embodiment of the present invention. Detailed Implementation
[0048] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.
[0049] like Figure 1 As shown, the steps of the blockchain-based anti-counterfeiting and traceability method for charger energy metering data in this embodiment include:
[0050] S01. Obtain information on all charger energy meters within the designated area, generate a first identification code for the charger energy meter based on the obtained information, and write the first identification code and the energy metering data of the charger energy meter into the blockchain.
[0051] S02. Generate a second identifier for the current distribution area based on the first identifier of all charging energy meters in the current distribution area, and write the second identifier with the energy metering data of the current distribution area into the blockchain;
[0052] S03. Generate a third identifier for the current management platform based on the second identifiers of all areas within the designated management platform, and write the third identifier into the blockchain;
[0053] S04. During the transmission of electricity metering data of the charger, the transmission node information is obtained by identifying the identification code and written into the blockchain;
[0054] S05. When obtaining electricity metering data, verify the authenticity of the data based on the identification code.
[0055] The embodiment constructs the identification codes corresponding to the charger electric energy meter, the transformer area and the management platform in sequence, and writes the identification codes and the corresponding electric energy measurement data into the block chain. In the electric energy measurement data transmission process, the transmission node information is recorded by identifying the identification codes of the transmission node devices and written into the block chain. Then, the authenticity of the electric energy measurement data can be identified according to the identification codes. The electric energy measurement data can be managed in a layered manner among the charger electric energy meter, the transformer area, the management platform and the supervision agency by combining the block chain, so that each charger electric energy meter is bound to the transformer area, and the transformer area is bound to the management platform. The multi-level transmission traceability can be realized, the authenticity identification and traceability safety of the electric energy measurement data in the block chain can be ensured, the electric energy measurement data transmission safety problem can be solved, and the safety test of the electric energy measurement data transmission and storage can be further facilitated.
[0056] The electric energy measurement data of the charger electric energy meter specifically includes a time tag, voltage, current, instantaneous power, cumulative electric quantity, electric energy meter access mode, electric energy meter network address and the like.
[0057] The charger can be various types of chargers such as a vehicle-mounted charger. The charger electric energy meter has an electric energy measurement function and can transmit electric energy measurement data.
[0058] As shown in Figure 2 The step S01 in the embodiment includes the following steps:
[0059] S101. A pseudo-random sequence is generated using a random number generator, and part of the binary code is intercepted from the pseudo-random sequence.
[0060] S102. The information of the charger electric energy meter obtained is subjected to an exclusive OR operation with the intercepted binary code to generate a first identification code of the charger electric energy meter.
[0061] S103. The first identification code is combined with the electric energy measurement data of the charger electric energy meter to form a new sequence, and written into the merkle tree of the block chain.
[0062] The embodiment records each charger electric energy meter and electric energy measurement data through the block chain. If the charger electric energy meter or the electric energy measurement data is fake, the corresponding identification code cannot be obtained in the block chain, so that each charger electric energy meter is not counterfeited, and the electric energy measurement data of each charger electric energy meter can be traced.
[0063] The information of the above charging machine electric energy meter is the code of the charging machine electric energy meter, that is, by reading the code of the charging machine electric energy meter, a pseudo-random sequence generated by a random number generator is synthesized with the first identification code of the charging machine electric energy meter, and then the electric energy metering data is written into the merkle tree of the block chain together, so as to realize the management of the electric energy metering data of the transformer area and the electric energy meter based on the block chain merkle tree, and the transformer area and the charging machine electric energy meter are bound, so as to facilitate the traceability of the electric energy metering data.
[0064] The code of the above charging machine electric energy meter can be a two-dimensional code, a bar code or an RFID code, and can also be other codes suitable for being printed or attached to the charging machine electric energy meter. For example, the charging machine electric energy meter is marked with ASCII code, and 10-bit ASCII code can mark 1024 charging machine electric energy meters without repetition; other numbers, symbols or letters can also be used as the identification code of each charging machine electric energy meter.
[0065] In a specific application embodiment, when the first identification code of the charging machine electric energy meter is generated, the code of the charging machine electric energy meter is read first, the decimal number length of the code is M, and the binary number length corresponding to the code is N; a random number generator is constructed by using a rand function, and a pseudo-random sequence generated by the random number generator in real time is denoted as r_X; a continuous binary code with a length of N bits is intercepted from r_X, and is denoted as a random binary code r_N; wherein the interception rule of the i-th random binary code r_N(i) is:
[0066] r_N(i)={r_X((i+N)N)+1,r_X((i+N)N)+2,r_X((i+N)N)+3,...,r_X((i+N)N)+N} (2)
[0067] Wherein, i is a positive integer;
[0068] The binary code of the charging machine electric energy meter is subjected to bitwise XOR operation with the above-mentioned random binary code r_N, and the operation result is denoted as the first identification code S_1 of the charging machine electric energy meter. The first identification code S_1 of the charging machine electric energy meter and the electric energy metering data of the charging machine electric energy meter are combined into a new sequence, and are written into the merkle tree of the block chain. The combination rule of the first identification code S_1 of the charging machine electric energy meter and the electric energy metering data of the charging machine electric energy meter is that the first identification code of the charging machine electric energy meter is in front and the electric energy metering data is in back.
[0069] As shown in Figure 3 The step S02 in the embodiment includes:
[0070] S201. Perform bitwise XOR operation on the first identification codes of all charging machine electric energy meters in the current transformer area to generate a second identification code;
[0071] S202. Combine the second identification code with the electric energy metering data of the current substation to form a new sequence, and write the first tree root value into the merkle tree of the block chain.
[0072] In this embodiment, the first identification codes S_1 of all chargers in a substation are subjected to bitwise XOR operation to generate a second identification code S_2 of the substation. The second identification code S_2 of the substation and the electric energy metering data of the total meter are combined into a new sequence, and the first tree root value is written into the merkle tree of the block chain. The rule of combining the second identification code S_2 of the substation and the electric energy metering data of the total meter is that the second identification code S_2 of the substation is in the front and the electric energy metering data of the total meter is in the back.
[0073] As shown in Figure 4 , the step S03 of this embodiment includes the following steps:
[0074] S301. Perform bitwise XOR operation on the second identification codes of all substations in the designated management platform to generate a third identification code of the current management platform.
[0075] S302. Write the third identification code as the second tree root value into the merkle tree of the block chain.
[0076] In a specific application embodiment, the management platform is a power grid marketing platform. The second identification codes S_2 of all substations corresponding to the marketing platform are subjected to bitwise XOR operation to generate a third identification code S_3 of the marketing platform. The third identification code S_3 of the marketing platform is written as the second tree root value into the merkle tree of the block chain, so as to realize the management of the marketing platform and the electric energy metering data based on the block chain merkle tree. It can be understood that the above management platform can also be other platforms except the marketing platform. The platform is connected with multiple substations, and the binding between the upper management platform corresponding to the multiple substations and the substations can be realized, so as to facilitate the traceability of the electric energy metering data.
[0077] After the step S03 of this embodiment, the step S04 also includes the following steps:
[0078] According to the multiple third identification codes in the required supervision range, a fourth identification code is generated, and the fourth identification code is written into the block chain.
[0079] After the step S03 of generating the third identification code S_3 of the management platform and writing it into the merkle tree of the block chain, the identification code of the upper level of the management platform is further generated, and the identification code is written into the block chain to realize the binding between the management platform and the upper level.
[0080] The third identification code of each management platform in the required regulatory scope is subjected to bitwise XOR operation in this embodiment to generate a fourth identification code, and the fourth identification code is written as the third tree root value in the merkle tree of the block chain, so as to bind the management platform with the previous level platform, thereby facilitating the traceability of the electric energy metering data. The previous level platform of the management platform can be a regulatory agency that regulates multiple management platforms.
[0081] In a specific application embodiment, the third identification codes S_3 of all power grid marketing platforms of the regulatory agency are subjected to bitwise XOR operation to generate a fourth identification code S_4 of the regulatory agency, and the fourth identification code S_4 of the regulatory agency is written as the third tree root value in the merkle tree of the block chain.
[0082] In the electric energy metering data transmission process at the transmission node, including but not limited to the charger electric energy meter, the transformer area, the power grid company marketing platform and the regulatory agency, etc., the identification code on each transmission node is identified, the transmission node information and the time are recorded, and the transmission node information and the time information are written in the block chain, so as to identify the authenticity of the electric energy metering data according to the identification code. When the user and the regulatory personnel obtain the electric energy metering data, the authenticity of the electric energy metering data can be identified according to the identification code by obtaining the identification code.
[0083] The step S05 of this embodiment specifically includes:
[0084] S501. The third identification of the management platform and the second identification of the transformer area are read from the electric energy metering data, and the third identification and the second identification are subjected to XOR check, and whether the currently obtained electric energy metering data belongs to the specified management platform is determined according to the check result;
[0085] S502. The second identification of the transformer area and the first identification of the charger electric energy meter are read from the electric energy metering data, and the second identification and the first identification are subjected to XOR check, and whether the currently obtained electric energy metering data belongs to the current transformer area is determined according to the check result.
[0086] When the authenticity identification and traceability of the electric energy metering data are obtained, the third identification and the second identification are read from the electric energy metering data in the reverse order of the identification code generation, and the XOR check is performed to determine whether the currently obtained electric energy metering data belongs to the current management platform. If the check is passed, it is determined that the electric energy metering data belongs to the current management platform, and if the check is not passed, it is determined that the electric energy metering data does not belong to the current management platform. Then, the second identification and the first identification are read from the electric energy metering data, and the XOR check is performed to determine whether the currently obtained electric energy metering data belongs to the current transformer area. If the check is passed, it is determined that the electric energy metering data belongs to the current transformer area, and if the check is not passed, it is determined that the electric energy metering data does not belong to the current transformer area.
[0087] Before step S501, the fourth identification code and the third identification code of the management platform are read from the electric energy metering data, and the fourth identification code and the third identification code are subjected to XOR verification, and whether the current acquired electric energy metering data belongs to the current supervision range is determined according to the verification result. That is, the fourth identification code and the third identification code are acquired from the electric energy metering data, subjected to XOR verification, and it is determined whether the acquired electric energy metering data belongs to the current supervision range. If the verification passes, it is determined that the electric energy metering data belongs to the current supervision range, and if the verification does not pass, it is determined that the electric energy metering data does not belong to the current supervision range.
[0088] It can be understood that further, the binding of the upper level platform on the management platform can be introduced, that is, the fourth identification of all supervision platforms is subjected to XOR operation to obtain the identification of the upper level platform of the supervision platform, and the identification is written into the merkle tree and stored in the block chain again to bind the supervision platform and the upper level, and even more levels of platform binding can be further introduced.
[0089] In a specific application embodiment, the detailed steps of step S5 include:
[0090] The fourth identification code S_4 of the supervision agency and the third identification code S_3 of the marketing platform are read, the acquired fourth identification code S_4 and the third identification code S_3 are subjected to XOR verification, and it is determined whether the electric energy metering data read by the marketing platform belongs to the supervision agency;
[0091] The third identification code S_3 of the marketing platform and the second identification code S_2 of the transformer area are read, the acquired third identification code S_3 and the second identification code S_2 are subjected to XOR verification, and it is determined whether the electric energy metering data read by the transformer area belongs to the marketing platform;
[0092] The second identification code S_2 of the transformer area and the first identification code S_1 of the electric energy meter of the charging machine are read, the acquired second identification code S_2 and the first identification code S_1 are subjected to XOR verification, and it is determined whether the electric energy metering data read by the electric energy meter of the charging machine belongs to the current transformer area;
[0093] After the electric energy metering data is written into the block chain, the electric energy metering data is shared in the block chain, and the electric energy metering data is acquired by identifying the fourth identification code S_4 of the supervision agency, the third identification code S_3 of the marketing platform of the power grid company, the second identification code S_2 of the transformer area, and the first identification code S_1 of the electric energy meter of the charging machine.
[0094] The embodiment reads the electric energy meter code of the charging machine, generates a pseudo-random sequence by a random number generator, synthesizes the first identification code of the electric energy meter of the charging machine, and then sequentially binds with the transformer area, the management platform and the upper level platform of the management platform to generate the second, third and fourth identification codes, writes into the merkle tree and stores into the block chain, so that the layered merkle tree management is realized, and the authenticity and traceability of the electric energy measurement data in the block chain are ensured.
[0095] As shown in Figure 5 the detailed steps of the electric energy measurement data anti-forgery traceability of the charging machine in the specific application embodiment of the application are as follows:
[0096] Step 1-1, read the electric energy meter code of the vehicle-mounted charging machine, set the decimal number length of the code as M, and record the binary number length corresponding to the code as N;
[0097] Step 1-2, use the rand function to construct a random number generator, and record the pseudo-random sequence generated by the random number generator in real time as r_X, and a continuous binary code with a length of N bits is intercepted from r_X, and is recorded as a random binary code r_N; wherein the interception rule of the i-th random binary code r_N(i) is:
[0098] r_N(i)={r_X((i+N)N)+1,r_X((i+N)N)+2,r_X((i+N)N)+3,...,r_X((i+N)N)+N}
[0099] Wherein, i is a positive integer;
[0100] Step 1-3, the binary code of the electric energy meter of the charging machine in step 1-1 is subjected to bitwise XOR operation with the random binary code r_N intercepted in real time in step 1-2, and the operation result is recorded as the first identification code S_1 of the electric energy meter of the charging machine, and the first identification code S_1 of the electric energy meter of the charging machine and the electric energy measurement data of the electric energy meter of the charging machine are combined into a new sequence, and written into the merkle tree of the block chain, wherein the combination rule of the first identification code S_1 of the electric energy meter of the charging machine and the electric energy measurement data of the electric energy meter of the charging machine is that the first identification code of the electric energy meter of the charging machine is in front, and the electric energy measurement data is behind;
[0101] Step 1-4, the first identification code S_1 of all electric energy meters of the charging machine in one transformer area is subjected to bitwise XOR operation to generate the second identification code S_2 of the transformer area, and the second identification code S_2 of the transformer area and the electric energy measurement data of the transformer total meter are combined into a new sequence, and written into the merkle tree of the block chain as the first tree root value, wherein the combination rule of the second identification code S_2 of the transformer area and the electric energy measurement data of the transformer total meter is that the second identification code of the transformer area is in front, and the electric energy measurement data of the transformer total meter is behind;
[0102] Step 1-5, the second identification code S_2 of all the stations of the marketing platform is subjected to bitwise XOR operation to generate a third identification code S_3 of the marketing platform, and the third identification code S_3 of the marketing platform is written into the merkle tree of the block chain as a second tree root value;
[0103] Step 1-6, the third identification code S_3 of all the marketing platforms of the regulatory agency is subjected to bitwise XOR operation to generate a fourth identification code S_4 of the regulatory agency, and the fourth identification code S_4 of the regulatory agency is written into the merkle tree of the block chain as a third tree root value;
[0104] By writing the electric energy metering data into the block chain along with the charger electric energy meter, it is convenient for the regulatory agency to obtain the electric energy metering data, and at the same time, because the electric energy metering data written into the block chain can be shared, when the regulatory agency identifies the charger electric energy meter, the station or the marketing platform, etc., the electric energy metering data can be obtained, which facilitates the user and the regulatory agency to view to realize the traceability of the electric energy metering data.
[0105] Step 1-7, in the transmission process of the electric energy metering data in the transmission node, wherein the transmission node includes but is not limited to the charger electric energy meter, the station, the marketing platform of the power grid company and the regulatory agency, by identifying the identification code on each transmission node, recording the transmission node information and the time, and writing the transmission node information and the time information into the block chain, and according to the identification of the identification code, the authenticity of the electric energy metering data is identified;
[0106] Step 1-8, after obtaining the electric energy metering data, the authenticity of the electric energy metering data is identified according to the identification code:
[0107] By reading the fourth identification code S_4 of the regulatory agency, the third identification code S_3 of the marketing platform, the second identification code S_2 of the station and the first identification code S_1 of the charger electric energy meter, the corresponding XOR check is carried out:
[0108] By reading the fourth identification code S_4 of the regulatory agency and the third identification code S_3 of the marketing platform, the fourth identification code S_4 and the third identification code S_3 obtained are subjected to XOR check to determine whether the electric energy metering data read by the marketing platform belongs to the regulatory agency;
[0109] By reading the third identification code S_3 of the marketing platform and the second identification code S_2 of the station, the third identification code S_3 and the second identification code S_2 obtained are subjected to XOR check to determine whether the electric energy metering data read by the station belongs to the marketing platform of the power grid company;
[0110] By reading the second identification code S_2 of the area and reading the first identification code S_1 of the charger electric energy meter, the acquired second identification code S_2 and the first identification code S_1 are subjected to XOR check to determine whether the electric energy measurement data read by the charger electric energy meter belongs to the current area;
[0111] Determining whether the read electric energy measurement data belongs to the regulatory agency or the marketing platform or the area or the charger electric energy meter can ensure the authenticity of the electric energy measurement data.
[0112] The embodiment of the blockchain-based charger electric energy measurement data anti-fake traceability system comprises:
[0113] The first writing control module is used for acquiring information of all charger electric energy meters in a specified area, and generating a first identification code of the charger electric energy meter according to the acquired information, and writing the first identification code and the electric energy measurement data of the charger electric energy meter into the blockchain after combination;
[0114] The second writing control module is used for generating a second identification code of the current area according to the first identification codes of all charger electric energy meters in the current area, and writing the second identification code and the electric energy measurement data of the current area into the blockchain after combination;
[0115] The third writing control module is used for generating a third identification code of the current management platform according to the second identification codes of all areas in the specified management platform, and writing the third identification code into the blockchain;
[0116] The fourth writing control module is used for acquiring transmission node information by identifying the identification code during the transmission process of the electric energy measurement data of the charger electric energy meter, and writing the transmission node information into the blockchain;
[0117] The authentication module is used for authenticating the authenticity of the data according to the identification code when the electric energy measurement data is acquired.
[0118] The blockchain-based charger electric energy measurement data anti-fake traceability system of the embodiment corresponds to the above-mentioned blockchain-based charger electric energy measurement data anti-fake traceability method, and will not be described one by one here.
[0119] The embodiment also provides a computer device comprising a processor and a memory, the memory is used for storing a computer program, and the processor is used for executing the computer program, and the processor is used for executing the computer program to execute the above-mentioned method.
[0120] The above is only the preferred embodiment of the present application, and does not limit the present application in any form. Although the present application has been disclosed as above with the preferred embodiment, it is not intended to limit the present application. Therefore, any simple modification, equivalent change and modification made to the above-mentioned embodiment without departing from the technical solution of the present application, and according to the technical essence of the present application, should fall within the protection scope of the technical solution of the present application.
Claims
1. A method for anti-counterfeiting and traceability of electric energy metering data of a charging machine based on a blockchain, characterized by the following steps Comprise: S01. Obtain the information of all charging machine electric energy meters in the specified station area, and generate the first identification code of the charging machine electric energy meter by performing XOR operation on the obtained information and the part of binary code intercepted from the pseudo-random sequence, combine the first identification code with the electric energy metering data of the charging machine electric energy meter, and write it into the blockchain; S02. Perform bitwise XOR operation on the first identification code of all charging machine electric energy meters in the current station area to generate the second identification code of the current station area, combine the second identification code with the electric energy metering data of the current station area, and write it into the blockchain; S03. Perform bitwise XOR operation on the second identification code of all station areas in the specified management platform to generate the third identification code of the current management platform, and write the third identification code into the blockchain; S04. In the transmission process of the electric energy metering data of the charging machine electric energy meter, obtain the transmission node information by identifying the identification code and write it into the blockchain; S05. When the electric energy metering data is obtained, perform XOR verification according to the identification code to identify the authenticity of the data. 2.The blockchain-based anti-fake and traceable method for metering data of electric energy of a charging machine according to claim 1, characterized in that, The steps of S01 include: S101. Use a random number generator to generate a pseudo-random sequence, and intercept part of the binary code from the pseudo-random sequence; S102. Perform XOR operation on the information of the charging machine electric energy meter obtained and the binary code intercepted to generate the first identification code of the charging machine electric energy meter; S103. Combine the first identification code with the electric energy metering data of the charging machine electric energy meter to form a new sequence, and write it into the merkle tree of the blockchain. 3.The blockchain-based anti-fake and traceable method for metering data of electric energy of a charging machine according to claim 1, characterized in that, The steps of S02 include: S201. Perform bitwise XOR operation on the first identification code of all charging machine electric energy meters in the current station area to generate the second identification code; S202. Combine the second identification code with the electric energy metering data of the current station area to form a new sequence, and write it into the merkle tree of the blockchain as the first tree root value. 4.The blockchain-based anti-fake and traceable method for metering data of electric energy of a charging machine according to claim 1, characterized in that, The steps of S03 include: S301. Perform bitwise XOR operation on the second identification code of all station areas in the specified management platform to generate the third identification code of the current management platform; S302. Write the third identification code as the second tree root value into the merkle tree of the blockchain. 5.The blockchain-based anti-fake and traceable method for metering data of electric energy of a charging machine according to any one of claims 1-4, characterized in that, After S03, S04 also includes: Generate a fourth identification code according to a plurality of third identification codes within the required supervision range, and write the fourth identification code into the blockchain. 6.The blockchain-based anti-fake traceability method for charging machine electrical energy metering data according to claim 5, characterized in that, Specifically, perform bitwise XOR operation on the third identification codes of each management platform within the required supervision range to generate the fourth identification code, and write the fourth identification code as the third tree root value into the merkle tree of the blockchain. 7.The blockchain-based anti-fake and traceable method for metering data of electric energy of a charging machine according to any one of claims 1-4, characterized in that, S05 includes: S501. Read the third identification code and the second identification code of the station area from the electric energy metering data, perform XOR verification on the read third identification code and the second identification code of the station area, and determine whether the currently obtained electric energy metering data belongs to the specified management platform according to the verification result; S502. Reading the second identification code of the area and the first identification code of the charger electric energy meter from the electric energy metering data, performing XOR check on the read second identification code and the first identification code, and determining whether the current acquired electric energy metering data belongs to the current area according to the check result. 8.The blockchain-based anti-fake traceability method for charging machine electrical energy metering data according to claim 7, characterized in that, The S501 further comprises reading a fourth identification code and the third identification code of the management platform from the electric energy metering data, performing XOR check on the read fourth identification code and the third identification code, and determining whether the current acquired electric energy metering data belongs to the current supervision range according to the check result. 9.A blockchain-based anti-fake traceability system for electric energy metering data of a charger, characterized in that, The method comprises: a first write control module, configured to acquire information of all charger electric energy meters in a specified area, and perform XOR operation on the acquired information and part of binary code intercepted from a pseudo-random sequence to generate a first identification code of the charger electric energy meter, and write the first identification code and electric energy metering data of the charger electric energy meter into a blockchain after combination; a second write control module, configured to perform bitwise XOR operation on the first identification code of all charger electric energy meters in the current area to generate a second identification code of the current area, and write the second identification code and electric energy metering data of the current area into the blockchain after combination; a third write control module, configured to perform bitwise XOR operation on the second identification codes of all areas in a specified management platform to generate a third identification code of the current management platform, and write the third identification code into the blockchain; a fourth write control module, configured to acquire transmission node information and write into the blockchain by identifying the identification code in the transmission process of the electric energy metering data of the charger electric energy meter; a pseudo-authentication module, configured to perform XOR check according to the identification code to authenticate the data authenticity when the electric energy metering data is acquired.
10. A computer apparatus comprising a processor and a memory for storing a computer program, the processor being configured to execute the computer program, characterized in that, The processor is configured to execute the computer program to perform the method of any one of claims 1-8.
Citation Information
Patent Citations
Method and device for accurately verifying transformer area household-transformer relationship
CN110084718A
Distributed file storage method and device based on block chain
CN113094350A