A blockchain-based management method and system for smart meters
By introducing blockchain technology into the smart meter management system, meter data is divided into two block systems for authentication and encapsulation, which solves the problems of low reliability of power data and untimely identification of power consumption anomalies, and realizes the reliable and accurate storage of power data.
Patent Information
- Application Number
- CN202611623179.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing smart meter management systems suffer from low reliability of power data and an inability to detect abnormal electricity usage in a timely manner due to limitations in meter installation locations and instances of electricity theft or leakage by some users.
A blockchain-based smart meter management system is adopted, dividing the system into two block systems: a second block system on the user side and a first block system on the administrator side. When certain conditions are met, the second smart meter processes electricity data using a first private key and uploads it to the second block system. The first smart meter authenticates the data and, upon successful authentication, performs secondary encapsulation before uploading it to the first block system.
This improved the effectiveness and accuracy of power data, reduced the upload of invalid data, saved storage pressure, and ensured the reliability and timeliness of power data.
Smart Images

Figure CN123122789A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data management technology, and in particular relates to a management method and system for smart meters based on blockchain. Background Technology
[0002] To better track each household's electricity consumption, an individual electricity meter is typically installed for each household. However, with the continuous increase in population, the number of individual electricity meters installed for each household has also increased. Therefore, how to effectively manage the electricity meters of each household has become a key factor affecting electricity consumption statistics.
[0003] Current methods for managing electricity data typically rely on manual data collection. However, this approach is labor-intensive and has been gradually replaced by smart meters capable of online reporting. Smart meters can connect to the internet via wired or wireless connections and upload the collected meter data to a server, thus reducing the manual labor required to query meters. However, due to limitations in meter installation locations and instances of electricity theft or leakage by some users, the reliability of electricity data uploaded by smart meters is relatively low, and they cannot promptly detect abnormal electricity usage. Summary of the Invention
[0004] This application provides a blockchain-based smart meter management method and system, which can solve the problems of existing power data management technologies being limited by different meter installation locations and some users stealing or leaking electricity, resulting in low reliability of power data uploaded by smart meters and the inability to detect abnormal electricity consumption in a timely manner.
[0005] In a first aspect, embodiments of this application provide a blockchain-based smart meter management method, applied to a smart meter management system; the smart meter management system includes a first block system and a second block system; the first block system includes multiple first smart meters and a management terminal; the second block system includes at least one first smart meter and multiple second smart meters; the first smart meters are deployed on the transmission line nodes of the multiple second smart meters in the second block system; The management method includes: When the conditions for uploading power data are met, the second smart meter obtains the first private key and the first public key of the second block system where the second smart meter is located; the first public key is determined based on the first historical data of the first smart meter connected to the second smart meter; the first private key is determined based on the second historical data of each second smart meter in the second block system; the upload conditions are used to instruct all second smart meters in the second block system to upload power data; The second smart meter processes the first power data using the first private key to obtain the first block data, and then uploads the first block data to the second block system; The first smart meter authenticates the first block data based on the first public key, and obtains a second private key and a second public key after successful authentication; the second public key is determined by the management terminal based on the third historical data of the first block system; the second private key is determined based on the fourth historical data of each of the first smart meters in the first block system; The first smart meter processes the first block data using the second private key to obtain the second block data, and then uploads the second block data to the first block system.
[0006] In one possible implementation of the first aspect, the first smart meter authenticates the first block data based on the first public key, and obtains a second private key and a second public key after successful authentication, including: The first smart meter uses the first public key to decode the first block data uploaded by each of the second smart meters in the second block system to obtain the first power data of each of the second smart meters; The first smart meter determines the data confidence level corresponding to all the first block data based on the data deviation between the second power data of the first smart meter and the sum of all the first power data; the data confidence level is negatively correlated with the data deviation. If the confidence level of the data is greater than or equal to the confidence level threshold, then the authentication of the first block of data is successful. If the data confidence level is less than the confidence level threshold, then based on the first timestamp corresponding to when the upload condition is met, multiple operation records of each of the second smart meters are obtained respectively. For any second smart meter, the first smart meter determines the anomaly identification result of the second smart meter based on the multiple operation records of the second smart meter; The first smart meter sends anomaly repair information to the management terminal based on the anomaly identification results of each of the second smart meters.
[0007] In one possible implementation of the first aspect, the first smart meter, for any second smart meter, determines the anomaly identification result of the second smart meter based on the plurality of operating records of the second smart meter, including: For any given operation record, the first smart meter determines the meter reading difference of the operation record based on the operation record and other operation records adjacent to it. The first smart meter determines the anomaly coefficient of the operation record based on the difference in readings of each of the meters; If the first smart meter detects any of the aforementioned abnormal coefficients that are greater than a preset abnormal level, it identifies the operating record corresponding to the abnormal coefficient as an abnormal record and generates an abnormal identification result for the abnormal record.
[0008] In one possible implementation of the first aspect, the second smart meter, upon meeting the conditions for uploading electricity data, obtains the first private key and the first public key of the second block system where the second smart meter resides, including: The second smart meter acquires multiple third block data uploaded at a second timestamp in the second block system; the second timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each third block data is uploaded by the second smart meter in the second block system; The second smart meter decodes each of the third block data according to the third public key corresponding to the second timestamp to obtain the second historical data corresponding to each of the third block data; The second smart meter combines the second historical data sequentially according to the number of each second smart meter in the second block system to obtain the first historical sequence; The second smart meter processes the first historical sequence using a preset hash algorithm to obtain the first private key.
[0009] In one possible implementation of the first aspect, the first smart meter authenticates the first block data based on the first public key, and obtains a second private key and a second public key after successful authentication, including: The first smart meter acquires multiple fourth block data uploaded at a third timestamp in the first block system; the third timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each fourth block data is uploaded by the first smart meter in the first block system; The first smart meter decodes each of the fourth block data according to the fourth public key corresponding to the third timestamp, and obtains the fourth historical data corresponding to each of the fourth block data; The first smart meter combines the fourth historical data in sequence according to the number of each first smart meter in the first block system to obtain the second historical sequence; The first smart meter processes the second historical sequence using a preset hash algorithm to obtain the second private key.
[0010] In one possible implementation of the first aspect, the second smart meter includes a triggering unit, an authentication unit, and a processing unit; the method further includes: When the upload conditions are not met, the second smart meter is in a low-power mode; in the low-power mode, the authentication unit is in a sleep state and the processing unit is in a first working state; in the first working state, the processing unit performs meter recording operations. The second smart meter determines whether the upload conditions are met at the current time through the trigger unit, and switches to block writing mode when the trigger unit identifies that the upload conditions are met; in the block writing mode, the authentication unit is in a wake-up state and the processing unit is in a second working state; in the second working state, the processing unit performs block data processing operations; After the second smart meter processes the first power data using the first private key to obtain the first block data and uploads the first block data to the second block system, the process further includes: The second smart meter switches from the block write mode to the low-energy mode.
[0011] One possible implementation of the first aspect also includes: The management terminal decodes the second block data based on the first public key and the second public key of the second block system to determine the reporting time information of each second smart meter; the reporting time information includes the upload time of at least one piece of the first block data uploaded by the second smart meter; The management terminal matches the reported time information with preset meter abnormality conditions to determine the abnormality level of the second smart meter. If the management terminal detects that the anomaly level is greater than a preset anomaly threshold, it generates a repair prompt message for the second smart meter.
[0012] In one possible implementation of the first aspect, the management terminal matches the reported time information with preset meter anomaly conditions to determine the anomaly level of the second smart meter, including: The management terminal determines the upload time difference between any two second smart meters in the second block system based on the various upload times in the upload time information. Based on all the aforementioned upload time differences, determine the upload interval variance of the second block system; For any second smart meter, the anomaly level corresponding to the second smart meter is determined based on at least one upload time difference of the second smart meter and the upload interval variance.
[0013] Secondly, embodiments of this application provide a smart meter management system; the smart meter management system includes a first block system and a second block system; the first block system includes multiple first smart meters and a management terminal; the second block system includes at least one first smart meter and multiple second smart meters; the first smart meters are deployed at the transmission line nodes of the multiple second smart meters in the second block system; The second smart meter is used to obtain a first private key and a first public key of the second block system where the second smart meter is located, provided that the conditions for uploading power data are met. The first public key is determined based on the first historical data of the first smart meter connected to the second smart meter. The first private key is determined based on the second historical data of each second smart meter in the second block system. The upload conditions are used to instruct all second smart meters in the second block system to upload power data. The second smart meter is used to process the first power data using the first private key to obtain the first block data, and upload the first block data to the second block system; The first smart meter is used to authenticate the first block data based on the first public key, and obtain a second private key and a second public key after successful authentication; the second public key is determined by the management terminal based on the third historical data of the first block system; the second private key is determined based on the fourth historical data of each of the first smart meters in the first block system. The first smart meter is used to process the first block data using the second private key to obtain the second block data, and then upload the second block data to the first block system.
[0014] In one possible implementation of the second aspect, the second smart meter includes a triggering unit, an authentication unit, and a processing unit; The second smart meter is configured to operate in a low-energy mode when the upload conditions are not met. In the low-energy mode, the authentication unit is in a sleep state, and the processing unit is in a first working state. In the first working state, the processing unit performs meter recording operations. The second smart meter is used to determine whether the upload condition is met at the current time through the triggering unit, and to switch to block writing mode when the triggering unit identifies that the upload condition is met; in the block writing mode, the authentication unit is in a wake-up state and the processing unit is in a second working state; in the second working state, the processing unit performs block data processing operations; In the second smart meter, after processing the first power data using the first private key to obtain the first block data and uploading the first block data to the second block system, the system further includes: The second smart meter is used to switch from the block write mode to the low-energy mode.
[0015] The beneficial effects of this application embodiment compared to the prior art are as follows: The smart meter management system can be divided into two block systems: a second block system comprising multiple second smart meters and first smart meters deployed on the user side, and a first block system comprising multiple first smart meters and a management terminal deployed on the administrator side. The second smart meters can collect user meter data and, upon detecting that the conditions for uploading power data are met, process the first power data using a first private key in the second block system to obtain first block data, which is then uploaded to the second block system. In other words, the collected power data is stored through the second block system. To authenticate the validity of this power data, the first smart meters in the second block system can decode the first block data using a first public key to obtain the power data, authenticate the power data, and, after successful authentication, re-encapsulate the first block system to obtain second block data, which is then uploaded to the first block system. This improves the validity and accuracy of the power data stored in the first block system. Compared with existing smart meter management systems, this application embodiment does not directly upload the electricity data collected by the user side to the administrator side for storage. Instead, it first authenticates and verifies the data through the first smart meter in the second block system, and then uploads it to the first block system after the authentication and verification are passed. This not only enables reliable storage of electricity data, but also avoids uploading invalid electricity data to the first block system, saving storage pressure on the first block system and improving the reliability of electricity data in the first block system. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the architecture of a smart meter management system provided in an embodiment of this application; Figure 2 This is an interactive flowchart of a blockchain-based smart meter management method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the format of the first power data provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the specific implementation of S203 of a blockchain-based smart meter management method provided in the second embodiment of this application. Figure 5 This is a schematic diagram of a power transmission line node provided in an embodiment of this application; Figure 6 This is a flowchart illustrating the specific implementation of a blockchain-based smart meter management method S201 provided in the third embodiment of this application. Figure 7 This is a flowchart illustrating the specific implementation of S203 of a blockchain-based smart meter management method provided in the fourth embodiment of this application. Figure 8 This is a flowchart illustrating the interaction between modules in the second smart meter in a blockchain-based smart meter management method provided in the fifth embodiment of this application. Figure 9 This is a flowchart illustrating a specific implementation of a blockchain-based smart meter management method provided in the sixth embodiment of this application. Detailed Implementation
[0018] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0019] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0020] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0021] To better track each household's electricity consumption, an individual electricity meter is typically installed for each household. However, with the continuous increase in population, the number of individual electricity meters installed for each household has also increased. Therefore, how to effectively manage the electricity meters of each household has become a key factor affecting electricity consumption statistics.
[0022] Current electricity data management technology typically involves installing smart meters. These smart meters send their collected meter readings (i.e., electricity data) to a server via the internet. For example, smart meters can package their collected readings into electricity data at a fixed time each month and send it to the server. The server can then receive the electricity data from each smart meter to calculate the electricity bill for each user, thus enabling statistical analysis of each user's electricity consumption. In areas with insufficient power supply, measures such as installing additional power supply equipment or repairing malfunctioning equipment can be taken to ensure the electricity safety of every household. However, due to the inability to guarantee the stability of each smart meter's operating status and the reliability of the installation environment, abnormal readings may occur when smart meters collect electricity data. This can lead to discrepancies between the uploaded electricity data and the actual electricity data, affecting the accuracy of subsequent power supply statistics.
[0023] On the other hand, due to improper installation of some smart meters or user-intentioned modifications, the readings of these smart meters may not match the actual user situation, potentially indicating electricity theft or leakage. If the server directly relies on the smart meter's power consumption data for electricity usage statistics, it may fail to identify these situations in a timely manner, reducing the timeliness of anomaly detection.
[0024] It is evident that existing power data management technologies are limited by the different installation locations of electricity meters and the existence of electricity theft and leakage by some users. As a result, the power data uploaded by smart meters has low reliability and cannot detect abnormal power consumption in a timely manner.
[0025] To address the aforementioned problems in the existing technology, this application provides a blockchain-based smart meter management method applied to a smart meter management system. The smart meter management system can be divided into two block systems: a second block system comprising multiple second smart meters and first smart meters deployed on the user side, and a first block system comprising multiple first smart meters and a management terminal deployed on the administrator side. The second smart meters can collect user meter data, and upon detecting that the power data upload conditions are met, process the first power data using a first private key in the second block system to obtain first block data, which is then uploaded to the second block system. In other words, the collected power data is saved through the second block system. To authenticate the validity of the power data, the first smart meter in the second block system can decode the first block data using the first public key to obtain the power data, authenticate the power data, and then re-encapsulate the first block system to obtain the second block data. This second block data is then uploaded to the first block system, thereby improving the validity and accuracy of the power data stored in the first block system. Compared to existing smart meter management systems, this embodiment does not directly upload the power data collected from the user side to the administrator side for storage. Instead, it first authenticates and verifies the data through the first smart meter in the second block system, and only uploads it to the first block system after successful authentication. This not only ensures reliable storage of power data but also avoids uploading invalid power data to the first block system, saving storage pressure on the first block system and improving the reliability of the power data within it.
[0026] For example, Figure 1 A schematic diagram of the architecture of a smart meter management system according to an embodiment of this application is shown. See also Figure 1 As shown, the management system of the smart meter includes a first block system 10 and at least one second block system 20.
[0027] The second block system 20 includes a first smart meter 21 and at least one second smart meter 22. In some implementations, the second block system 20 may include two or more first smart meters 21, and the number of first smart meters 21 included in the second block system 20 is not limited here.
[0028] The aforementioned second smart meter 22 can specifically be a smart meter installed on the user's side. The second smart meter 22 can collect the user's corresponding power data and then determine the user's power consumption.
[0029] Specifically, the first smart meter 21 can be installed in a location with high reliability, and the first smart meter 21 can be deployed on the transmission line nodes of multiple second smart meters 22 in the second block system. That is, the power supplied to each user corresponding to the second smart meter 22 needs to pass through the transmission line where the first smart meter 21 is located.
[0030] For example, a residential building is used as an example of a second block system 20. The residential building includes multiple households, and each household can install an independent second smart meter 22. The second smart meter can then be used to collect statistics on the household's electricity consumption. The second smart meter 22 can generate corresponding power data based on the household's power consumption and then upload the power data to the aforementioned second block system 20.
[0031] The first smart meter 21 can be installed at the power transmission line node that supplies electricity to each household in the residential building. Specifically, the electricity supplied to each household must pass through the power transmission line node where the first smart meter 21 is located. The first smart meter 21 can be installed in the substation of the residential building. Since the power supply from the substation is relatively stable, and its working environment is generally indoors, not exposed outdoors or in a location easily touched by residents, the first smart meter 21 has high operational stability. Consequently, the reliability and accuracy of the electricity data it collects are also high, making it a device for authenticating the legality of all electricity data within the residential building.
[0032] Meanwhile, since the first smart meter 21 is installed in a substation, which can be equipped with an Optical Network Unit (ONU), this ONU can serve as the junction point for the optical fibers of all residents in the building. Through this ONU, the fiber optic connections can reach the district or city-level Optical Line Terminal (OLT), meaning the network communication quality of the first smart meter 21 is high. The first smart meter 21 can communicate with each of the second smart meters 22 through the constructed inter-building local area network, thereby building a second block system corresponding to the building without occupying internet access network resources. Furthermore, the first smart meter 21 can upload successfully authenticated second block data to the first block system. Due to the high network communication quality of the first smart meter 21, the probability of packet loss for its uploaded second block data is low, and the transmission speed is fast, thereby improving the data transmission efficiency of the smart meter management system and reducing the waiting time required for power data collection.
[0033] The first block system 10 includes multiple first smart meters 21 in the second block systems 20 and a management terminal 11. Each of the first smart meters 21 can access the Internet, thereby enabling interconnection between the first smart meters 21.
[0034] The aforementioned management terminal 11 can be deployed on the administrator's side, such as in a power grid computer room, or it can be a power grid server. It collects electricity data from each user within its jurisdiction and then performs electricity consumption statistics based on this data, such as obtaining electricity consumption data for each user, and implementing subsequent operations such as electricity billing. The management terminal 11 can also communicate with each of the first smart meters 21 in the first block system 10 via the Internet, i.e., it can obtain the second block data uploaded by each of the first smart meters 21.
[0035] In this embodiment, the management terminal 11 can be a computer, a laptop, or a server. The specific device type of the management terminal can be set according to the actual situation.
[0036] In some implementations, since the first smart meter 21 is a node device in the second block system 20 and also a node device in the first block system 10, the first smart meter 21 needs to store block data in the first block system 10 and block data in the second block system 20 at the same time. Therefore, the storage pressure of the first smart meter 21 is relatively large. Thus, each first smart meter 21 can be equipped with a corresponding external storage module to improve the storage capacity of the first smart meter 21.
[0037] In combination with the above Figure 1 A schematic diagram of the framework of the smart meter management system is provided. Figure 2 This document illustrates an interactive flowchart of a blockchain-based smart meter management method provided in an embodiment of this application. Specifically, it describes how to store and upload electricity data collected by the smart meter to the blockchain using a dual-block system. Specifically, the method includes the following steps: In S201, if the conditions for uploading power data are met, the second smart meter obtains the first private key and the first public key of the second block system where the second smart meter is located.
[0038] In this embodiment, the second smart meter can be configured with corresponding upload conditions. When the upload conditions are met at any given time, the second smart meter can obtain the first private key and the first public key used when uploading the electricity data. The upload conditions are used to instruct all second smart meters in the second block system to upload electricity data.
[0039] In some implementations, the upload condition can be a time-triggered condition. For example, the second smart meter can be set with a corresponding upload period or upload time. If the upload period or upload time is met at any time, the operation S201 can be triggered.
[0040] In some implementations, the upload condition can be an operation trigger condition. For example, the second smart meter can receive upload commands sent by other devices. For instance, the management terminal can broadcast upload commands to the smart meter management system, and then each second smart meter in the management system can execute the operation in S201 after receiving the upload command. Specifically, the specific triggering method for the upload condition can be set according to the actual situation; the content of the upload condition is not limited here.
[0041] In this embodiment, since all devices in the second block system store historically uploaded electricity data, specifically the second historical data uploaded by each second smart meter and the first historical data uploaded by the first smart meter in the second block system, when it is necessary to determine the first private key used for encryption during the current upload, the second smart meter can read the historical block data uploaded by each second smart meter through its local storage, and then decode the block data according to the public key of each historical block data, thereby extracting the second historical data collected by the second smart meter in the past, i.e., the historically uploaded electricity data. The second smart meter can perform data conversion processing based on all historically uploaded electricity data to obtain the corresponding first private key.
[0042] In some possible implementations, the second smart meter can store a corresponding hash conversion algorithm, which combines all the second historical data to obtain combined data, and then imports the combined data into the hash conversion algorithm to output the first private key.
[0043] In this embodiment, since the process of the first smart meter uploading power data to the second block system is the same as that of the second smart meter uploading power data to the second block system, the process by which the second smart meter determines the first public key based on the first smart meter's first historical data is the same as the process of determining the first private key. For a detailed description, please refer to the description of obtaining the first private key above. That is, the second smart meter can read the historical block data uploaded by the first smart meter through local storage, and then decode the historical block data uploaded by the first smart meter according to the public key of each historical block data, thereby extracting the first historical data collected by the first smart meter in the past, and then performing data conversion processing based on the first historical data to obtain the first public key.
[0044] In some possible implementations, the second smart meter can be set with a valid duration, that is, the second smart meter can determine the second historical data within the valid duration from all the second historical data to generate the first private key mentioned above, and determine the first historical data within the valid duration from all the first historical data to generate the first public key mentioned above.
[0045] In S202, the second smart meter processes the first power data using the first private key to obtain the first block data, and uploads the first block data to the second block system.
[0046] In this embodiment, the second smart meter is used to collect the user's electricity consumption information, and then obtain the aforementioned first power data based on the electricity consumption information. Specifically, the aforementioned first power data may be the meter reading corresponding to the second smart meter at the moment when the upload conditions are met.
[0047] For example, Figure 3 A schematic diagram of the format of first power data provided in an embodiment of this application is shown. See also Figure 3 As shown, the second smart meter recognizes that the upload conditions are met at a certain moment, and the meter reading at this moment is 68513 kWh. The second smart meter can generate the corresponding first power data, i.e., data 31, based on the time information corresponding to that moment, the user's corresponding user number, and the aforementioned meter reading. After obtaining the aforementioned data 31, the second smart meter can process the first power data using the first private key, thereby obtaining the first block data.
[0048] In some implementations, in order to upload the first power data to the second block system, the second smart meter can obtain the latest uploaded block data in the second block system, and process it with the first private key based on the latest uploaded block data and the aforementioned first power data, thereby obtaining the aforementioned first block data, and uploading the first block data to the second block system.
[0049] In this embodiment, the second smart meter can be equipped with a wired communication module or a wireless communication module. For example, the second smart meter can be connected to the second block system via a network cable, a mobile communication network, or a routing device. The method by which the second smart meter connects to the second block system is not limited here.
[0050] In S203, the first smart meter authenticates the first block data based on the first public key, and obtains the second private key and the second public key after successful authentication.
[0051] In this embodiment, after receiving the first block data uploaded by the second smart meter, the first smart meter can decrypt the first block data using the first public key, thereby obtaining the first power data collected by the second smart meter through the first block data. Then, it can perform authentication operations on the first power data according to preset authentication conditions to generate the authentication result of the first power data.
[0052] In this embodiment, the first smart meter is deployed at the transmission line nodes of all second smart meters in the second block system. This means that all electricity supplied to users connected to the second smart meters must pass through the location where the first smart meter is installed. The reading of the first smart meter will be greater than or equal to the sum of the readings of all second smart meters. Therefore, the accuracy of the readings of each second smart meter in the second block system can be indirectly monitored through the first smart meter, thereby identifying any abnormal first power data. Specifically, if the first smart meter detects no abnormalities in the first power data of the first block, an authentication result of successful authentication is generated; otherwise, if an abnormality is detected in the first power data, an authentication result of failed authentication is generated.
[0053] In some implementations, the authentication conditions described above can be as follows: After receiving the first block data from each of the second smart meters in the second block system, the first smart meter can decrypt each first block data using the first public key, thereby obtaining the first power data collected by all the second smart meters in the second block system. Then, the first smart meter compares all the first power data with the second power data collected by the first smart meter. If the sum of all the first power data is less than the second power data, the authentication is successful; otherwise, if the sum of all the first power data is greater than the second power data, the authentication fails. Optionally, the first smart meter can identify all the first power data uploaded this time as abnormal data, and then proceed with the subsequent operations of obtaining the private key and uploading to the first block system. Optionally, the electronic device can also determine the existence of abnormal power data from all the first power data uploaded this time, and re-encapsulate the first power data without abnormalities before uploading it to the first block system.
[0054] In this embodiment, when the first smart meter successfully authenticates the first power data uploaded by the second smart meter, it can obtain a second private key. This second private key is determined based on the historical power data collected by the first smart meter, namely the aforementioned fourth historical data. Since the first smart meter is installed in the first block system, all block data uploaded to the first block system is stored in the memory of the first smart meter. The aforementioned fourth historical data can be obtained from the local memory, and then the aforementioned second private key can be obtained based on the fourth historical data. The method for obtaining the second private key can be found in the relevant description of S201, and will not be repeated here.
[0055] In this embodiment, the management terminal in the first block system can upload the total historical power data collected by the first block system to the first block system, i.e., the aforementioned third historical data. The third historical data is then processed using the corresponding private key to obtain the corresponding block data. The first smart meter can decode the aforementioned block data using the corresponding public key, thereby restoring the third historical data uploaded by the management terminal, and generating a second public key based on the third historical data.
[0056] In S204, the first smart meter processes the first block data using the second private key to obtain the second block data, and then uploads the second block data to the first block system.
[0057] In this embodiment, after obtaining the second private key, the first smart meter can use the second private key to re-encapsulate the first block data, thereby obtaining the second block data. Specifically, the process of the first smart meter generating the second block data is similar to the process of the second smart meter generating the first block data. For a detailed description, please refer to the relevant description in S202, which will not be repeated here.
[0058] In some possible implementations, in order to upload the first block data to the first block system, the first smart meter can obtain the latest uploaded block data in the first block system, and process it with the second private key based on the latest uploaded block data and the aforementioned first block data, thereby obtaining the aforementioned second block data, and uploading the second block data to the first block system.
[0059] In this embodiment, since the second block data uploaded to the first block system is all power data obtained through authentication, the first smart meters deployed at the transmission line nodes filter the first power data that fails authentication and retain the first power data that passes authentication, thereby improving the credibility and accuracy of the power data and reducing the probability of uploading abnormal data to the first block system.
[0060] As can be seen from the above, the blockchain-based smart meter management method provided in this application embodiment can be divided into two block systems: a second block system comprising multiple second smart meters and a first smart meter deployed on the user side, and a first block system comprising multiple first smart meters and a management terminal deployed on the administrator side. The second smart meters can collect user meter data and, upon detecting that the conditions for uploading power data are met, process the first power data using a first private key in the second block system to obtain first block data, which is then uploaded to the second block system. In other words, the collected power data is stored through the second block system. To authenticate the validity of this power data, the first smart meters in the second block system can decode the first block data using a first public key to obtain the power data, authenticate the power data, and, after successful authentication, re-encapsulate the first block system to obtain second block data, which is then uploaded to the first block system. This improves the validity and accuracy of the power data stored in the first block system. Compared with existing smart meter management systems, this application embodiment does not directly upload the electricity data collected by the user side to the administrator side for storage. Instead, it first authenticates and verifies the data through the first smart meter in the second block system, and then uploads it to the first block system after the authentication and verification are passed. This not only enables reliable storage of electricity data, but also avoids uploading invalid electricity data to the first block system, saving storage pressure on the first block system and improving the reliability of electricity data in the first block system.
[0061] Figure 4 This diagram illustrates a detailed implementation flowchart of S203 of a blockchain-based smart meter management method provided in the second embodiment of this application. See also... Figure 4 As shown, relative to Figure 2 In the embodiment described above, the management method for a blockchain-based smart meter provided in this application includes steps S2031 to S2036, which are specifically described as follows: Specifically, the first smart meter authenticates the first block data based on the first public key, and obtains the second private key and the second public key after successful authentication, including: In S2031, the first smart meter decodes the first block data uploaded by each of the second smart meters in the second block system using the first public key to obtain the first power data of each of the second smart meters.
[0062] In this embodiment, since the first public key used by different second smart meters when generating the first block data is the same, that is, the first public key can be used to decode the first block data uploaded by all second smart meters, the first smart meter can obtain the first public key based on the first historical data stored locally, and then perform decoding operations on the first block data uploaded by each second smart meter according to the first public key, thereby being able to extract the first power data collected by each second smart meter from the first block data.
[0063] In some possible implementations, when generating the first block of data, the second smart meter can import the first historical data and the second historical data into a preset key conversion algorithm to obtain a pair of first public keys and first private keys. To ensure that other devices can decode the first block of data, all devices in the second block system (such as the first smart meter and the second smart meter) use the same key conversion algorithm. Optionally, the key conversion algorithm can be sent by the management terminal to each device in the second block system, or it can be obtained through other means; no limitation is placed on the key conversion algorithm here.
[0064] In this embodiment, since the first smart meter can store the data of each block in the second block system, and the first smart meter also uses the same key conversion algorithm as the second smart meter, the first smart meter can obtain the first historical data and the second historical data through local memory, and then obtain the first public key for decoding the first block data through the key conversion algorithm, thereby being able to restore the first power data.
[0065] In S2032, the first smart meter determines the data confidence level corresponding to all the first block data based on the data deviation between the second power data of the first smart meter and the sum of all the first power data; the data confidence level is negatively correlated with the data deviation.
[0066] In this embodiment, the first smart meter can decode each first block of data to obtain the first power data uploaded by each second smart meter. All the first power data can be summed to obtain the total reading. Since the first smart meter is located at the transmission line node of all the second smart meters, meaning the reading of the first smart meter is not less than the total reading of all the second smart meters, the second power data obtained by the first smart meter can be compared with the total reading to determine the data deviation between them.
[0067] For example, Figure 5 A schematic diagram of a power transmission line node according to an embodiment of this application is shown. See also Figure 5As shown, the first smart meter 51 is installed at the transmission line 510. This transmission line 510 can be divided into multiple different transmission lines, such as transmission lines 521 to 523, by a splitter or other means. Transmission line 521 supplies electricity to resident 53, who is equipped with a second smart meter 531. Transmission line 522 supplies electricity to resident 54, who is equipped with a second smart meter 541. Transmission line 523 supplies electricity to resident 55, who is equipped with a second smart meter 551. Therefore, the electricity supplied to residents 53 through 55 must pass through the transmission line nodes where the first smart meter is deployed.
[0068] In this embodiment, the first smart meter can be equipped with a hash function between data deviation and data confidence level. After calculating the data deviation between the second electricity data and the sum of readings, the data deviation can be imported into the hash function to convert the data deviation into a corresponding data confidence level. This data confidence level characterizes the accuracy and reliability of the first electricity data collected in this instance. A higher data confidence level indicates that the collected electricity data is closer to the actual electricity consumption data, thus enabling subsequent authentication of the first block of data based on this data confidence level.
[0069] For example, if the difference between the second power data and the total number of readings (i.e., the aforementioned data deviation) is negative, the data confidence level is set to the lowest value; if the difference is positive, the larger the value of the difference, the lower the corresponding data confidence level, i.e., the aforementioned data confidence level and data deviation are negatively correlated.
[0070] In S2033, if the data confidence level is greater than or equal to the confidence level threshold, the authentication of the first block data is successful.
[0071] In this embodiment, the first smart meter can compare the data confidence level with a preset confidence threshold. If the data confidence level is greater than the preset confidence threshold, it means that the data collected by the second smart meter is relatively accurate and consistent with the actual power consumption. At this time, the first block data uploaded by each second smart meter can be identified as successfully authenticated, and the subsequent operation S204 can be executed.
[0072] In S2034, if the data confidence level is less than the confidence level threshold, then based on the first timestamp corresponding to when the upload condition is met, multiple operation records of each of the second smart meters are obtained respectively.
[0073] In this embodiment, if the first smart meter detects that the data confidence level is less than the confidence level threshold, it is possible that some of the power data collected by the second smart meters is inaccurate. In this case, it is necessary to further identify the second smart meters that have abnormal data collection. Therefore, the operation records of each second smart meter obtained between the first timestamps can be obtained based on the first timestamp corresponding to the time when the upload conditions are met.
[0074] In some possible implementations, the first smart meter can obtain the operation records generated during the time period between the first and second timestamps based on the second timestamp corresponding to the last time the upload conditions were met by the second smart meter. That is, the recording time of the above multiple operation records is within the time period between the first and second timestamps, which can reduce the acquisition of operation records and improve the efficiency of subsequent anomaly identification.
[0075] In some possible implementations, the first smart meter and the second smart meter communicate via a local area network (LAN). In this case, the second smart meter can send the aforementioned multiple operation records to the first smart meter via the LAN.
[0076] In S2035, for any second smart meter, the first smart meter determines the anomaly identification result of the second smart meter based on the plurality of operation records of the second smart meter.
[0077] In this embodiment, the second smart meter can generate corresponding operation records during operation. For example, the second smart meter can generate an operation record according to a preset period, such as every 10 minutes or every 30 minutes. Under normal operating conditions, the second smart meter can obtain one operation record per period. Therefore, the first smart meter can compare the time interval between each operation record with the preset period corresponding to the second smart meter to determine whether there is any abnormality in the second smart meter.
[0078] For example, if a smart meter experiences a power outage, the timer used to periodically record the operation data may stop working, resulting in the time interval between two adjacent operation records exceeding a preset period. This allows the system to identify an anomaly in the second smart meter. Alternatively, when the second smart meter restarts after a power outage, a restart operation record can be generated. If a restart operation record exists among multiple operation records, it can be identified that the corresponding second smart meter may be experiencing an anomaly, and a corresponding anomaly identification result can be generated.
[0079] It should be noted that there are several ways to generate anomaly identification results based on multiple operation records. The first smart meter can obtain the anomaly identification conditions corresponding to the second smart meter based on the meter model or device identifier, and then extract the corresponding feature parameters based on multiple operation records, such as the interval between adjacent records or the number of restart records. The feature parameters are then compared with the corresponding anomaly identification conditions to generate the anomaly identification results.
[0080] Furthermore, as another embodiment of this application, the above-described S2035 may specifically include the following steps: In S2035.1, for any operating record, the first smart meter determines the meter reading difference of the operating record based on the operating record and other operating records adjacent to the operating record.
[0081] In this embodiment, the first smart meter can sort the various operation records according to the chronological order of their recording times, thereby obtaining the corresponding record sequence. Then, based on the meter readings at the corresponding times in each operation record, the difference between the meter readings of any two adjacent operation records can be determined, thus obtaining the aforementioned meter reading difference.
[0082] In S2035.2, the first smart meter determines the anomaly coefficient of the operation record based on the difference in readings of each of the meters.
[0083] In this embodiment, the first smart meter can determine whether there are meter reading differences that are less than a preset lower threshold or greater than an upper threshold based on the meter reading differences corresponding to each operation record, and determine the anomaly coefficient corresponding to each operation record based on the preset upper and lower thresholds. The aforementioned upper and lower thresholds can be determined based on the usage habits of the user corresponding to the second smart meter.
[0084] In some possible implementations, if the collection period for the above-mentioned operation records is one day, the difference between the daily electricity consumption of a general user is small. Based on this, the first smart meter can calculate the average difference based on the differences in all meter readings. If the deviation between any meter reading difference and the above-mentioned average difference is larger, the corresponding anomaly coefficient is larger. Thus, the anomaly coefficient corresponding to each operation record can be determined based on the above-mentioned average difference.
[0085] In some possible implementations, the first smart meter can also calculate the reading variance of the second smart meter based on the meter reading differences corresponding to all operating records, and determine the aforementioned anomaly coefficient based on the reading variance. Specifically, the larger the reading variance, the larger the corresponding anomaly coefficient; conversely, the smaller the reading variance, the smaller the corresponding anomaly coefficient.
[0086] In S2035.3, if the first smart meter detects that any of the abnormal coefficients is greater than a preset abnormal level, it identifies the operating record corresponding to the abnormal coefficient as an abnormal record and generates an abnormal identification result for the abnormal record.
[0087] In this embodiment, after determining the anomaly coefficient corresponding to each operation record, the first smart meter can compare the anomaly coefficient with a preset anomaly level. If the anomaly coefficient is greater than the preset anomaly level, the operation record is identified as an abnormal record. Then, based on all identified abnormal records, an anomaly identification result corresponding to the second smart meter is generated. The anomaly identification result can include multiple results such as: meter damage, meter malfunction, record anomaly, and no anomaly. Optionally, if the anomaly identification result is a record anomaly, it indicates that the second smart meter is not abnormal; the anomaly may have been caused by a brief, sudden anomaly during the generation of the operation record. In this case, only the abnormal operation record needs to be repaired, without needing to repair the second smart meter itself.
[0088] In some possible implementations, if the number of abnormal records is greater than or equal to a preset first quantity threshold, an abnormal identification result of meter damage can be generated; if the number of abnormal records is less than the first quantity threshold but greater than the second quantity threshold, an abnormal identification result of meter temporary malfunction can be generated; if the number of abnormal records is less than the second quantity threshold, an abnormal identification result of meter without abnormality but with inaccurate records can be generated.
[0089] In this embodiment of the application, by calculating the difference in meter readings between adjacent operation records, the abnormality coefficient corresponding to each operation record can be determined. Then, based on whether the difference between meter readings is abnormal, the operation record with abnormality can be identified. Based on the number of abnormal records, the corresponding abnormality identification result can be determined, thereby realizing the automatic identification of abnormal conditions of the second smart meter.
[0090] In S2036, the first smart meter sends anomaly repair information to the management terminal based on the anomaly identification results of each of the second smart meters.
[0091] In this embodiment, the first smart meter can generate anomaly identification results for each of the second smart meters using the aforementioned method, thereby identifying the anomaly-causing second smart meters and generating corresponding anomaly repair information. After receiving the anomaly repair information, the management terminal can prompt the administrator to repair the anomaly-causing second smart meters, thus achieving the goal of automatically detecting and proactively repairing anomalies. This improves the timeliness and accuracy of smart meter management and reduces the continued impact of subsequent power data collection anomalies.
[0092] Figure 6 This diagram illustrates a detailed implementation flowchart of S201 of a blockchain-based smart meter management method according to a third embodiment of this application. See also... Figure 6 As shown, relative to Figure 2 In the embodiment described above, the management method for a blockchain-based smart meter provided in this application includes steps S2011 to S2014, which are described in detail below: In S2011, the second smart meter acquires multiple third block data uploaded at a second timestamp in the second block system; the second timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each third block data is uploaded by the second smart meter in the second block system.
[0093] In this embodiment, the second smart device can obtain second historical data from historically uploaded block data. Specifically, the second smart device can determine the collection time corresponding to the second historical data used to generate the first private key, determine the corresponding second timestamp based on the collection time, and obtain third block data uploaded using the second timestamp from the second block system. The third block data is obtained by processing the second historical data.
[0094] In S2012, the second smart meter decodes each of the third block data according to the third public key corresponding to the second timestamp, and obtains the second historical data corresponding to each of the third block data.
[0095] In this embodiment, the second smart meter can obtain the corresponding third public key based on the second timestamp. For example, when the second smart meter uploads the third block data to the second block system, it can obtain the third private key and the third public key corresponding to the third block data. The third private key is specifically used for processing the second historical data, and the third public key is used for decoding the third block data. The second smart meter can store the third public key and the third private key in its local memory. When it is necessary to decode the third block data again, it can obtain the third public key from the local memory.
[0096] Optionally, the second smart meter can also obtain the block data required to generate the third public key from the second block system. For details on how to obtain the third public key, please refer to the method of obtaining the first public key, which will not be repeated here.
[0097] In this embodiment, after obtaining the third public key, the second smart meter can decode the third block data using the third public key, and then extract the second historical data carried by it from the third block data, that is, the power data uploaded by the second smart meter during historical use (i.e., the second timestamp).
[0098] In S2013, the second smart meter combines the second historical data in sequence according to the number of each second smart meter in the second block system to obtain the first historical sequence.
[0099] In this embodiment, after the second smart meter obtains each second historical data uploaded with a second timestamp, it can determine the position of the second historical data in the sequence according to the number of each second smart meter in the second block system. For example, the smaller the number value, the earlier the second historical data collected by the second smart meter is in the first historical sequence; conversely, the larger the number value, the later the second historical data collected by the second smart meter is in the first historical sequence. Based on the above method, each second historical data can be sorted in sequence to obtain the first historical sequence mentioned above.
[0100] In S2014, the second smart meter processes the first historical sequence using a preset hash algorithm to obtain the first private key.
[0101] In this embodiment, the second smart meter can import the first historical sequence into a preset hash algorithm, thereby converting the first historical sequence into a first private key of fixed length.
[0102] In this embodiment of the application, the second smart meter can obtain the third historical data uploaded in the past by obtaining the third block data from the second block system and the corresponding third public key, and then obtain the corresponding first historical sequence and the first private key. Thus, the first private key can be obtained through local storage, which improves the efficiency of obtaining the first private key and reduces the difficulty of obtaining it.
[0103] Figure 7 This diagram illustrates a detailed implementation flowchart of S203 of a blockchain-based smart meter management method provided in the fourth embodiment of this application. See also... Figure 7 As shown, relative to Figure 2In the embodiment provided in this application, a blockchain-based smart meter management method includes steps S203, which comprises steps S701 to S704, as detailed below: In S701, the first smart meter acquires multiple fourth block data uploaded at a third timestamp in the first block system; the third timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each of the fourth block data is uploaded by the first smart meter in the first block system.
[0104] In this embodiment, the first smart device can obtain fourth historical data from historically uploaded block data. Specifically, the first smart device can determine the collection time corresponding to the fourth historical data used to generate the fourth private key, determine the corresponding third timestamp based on the collection time, and obtain the fourth block data uploaded with the third timestamp from the first block system. The aforementioned fourth block data is obtained by processing the fourth historical data.
[0105] In S702, the first smart meter decodes each of the fourth block data according to the fourth public key corresponding to the third timestamp, and obtains the fourth historical data corresponding to each of the fourth block data.
[0106] In this embodiment, the first smart meter can obtain the corresponding fourth public key based on the third timestamp. For example, when the first smart meter uploads the fourth block data to the first block system, it can obtain the fourth private key and the fourth public key corresponding to the fourth block data. The fourth private key is specifically used when processing the fourth historical data, and the fourth public key is used when decoding the fourth block data. The first smart meter can store the fourth public key and the fourth private key in its local memory. When it is necessary to decode the fourth block data again, it can obtain the fourth public key from the local memory.
[0107] Optionally, the first smart meter can also obtain the block data required to generate the fourth public key from the first block system. For details on how to obtain the fourth public key, please refer to the method of obtaining the first public key, which will not be repeated here.
[0108] In this embodiment, after obtaining the fourth public key, the first smart meter can decode the fourth block data using the fourth public key, and then extract the fourth historical data carried by the fourth block data, that is, the power data uploaded by the first smart meter during historical use (i.e., the third timestamp).
[0109] In S703, the first smart meter sequentially combines the fourth historical data according to the number of each first smart meter in the first block system to obtain the second historical sequence.
[0110] In this embodiment, after the first smart meter obtains each fourth historical data uploaded with the third timestamp, it can determine the position of the fourth historical data in the sequence according to the number of each first smart meter in the first block system. For example, the smaller the number value, the earlier the fourth historical data collected by the first smart meter is in the second historical sequence; conversely, the larger the number value, the later the fourth historical data collected by the first smart meter is in the second historical sequence. Based on the above method, each fourth historical data can be sorted in sequence to obtain the aforementioned second historical sequence.
[0111] In S704, the first smart meter processes the second historical sequence using a preset hash algorithm to obtain the second private key.
[0112] In this embodiment, after the first smart meter obtains each fourth historical data uploaded with the third timestamp, it can determine the position of the fourth historical data in the sequence according to the number of each first smart meter in the first block system. For example, the smaller the number value, the earlier the fourth historical data collected by the first smart meter is in the second historical sequence; conversely, the larger the number value, the later the fourth historical data collected by the first smart meter is in the second historical sequence. Based on the above method, each fourth historical data can be sorted in sequence to obtain the aforementioned second historical sequence.
[0113] In this embodiment of the application, the first smart meter can obtain the fourth block data from the first block system and obtain the fourth historical data uploaded in the past through the corresponding fourth public key, and then obtain the corresponding second historical sequence and the second private key. Thus, the second private key can be obtained through local storage, which improves the efficiency of obtaining the second private key and reduces the difficulty of obtaining it.
[0114] Figure 8 This illustration shows the interaction flowchart between modules in a second smart meter within a blockchain-based smart meter management method provided in the fifth embodiment of this application. See also... Figure 8 As shown, relative to Figure 2-7 In any of the embodiments described above, the management method for a blockchain-based smart meter provided in this application further includes steps S801 to S803, which are described in detail below: Furthermore, the second smart meter includes a triggering unit, an authentication unit, and a processing unit.
[0115] The aforementioned triggering unit is used to determine whether the second smart meter meets the upload conditions, and if the upload conditions are met, it triggers the blockchain data uploading operation.
[0116] The aforementioned authentication unit is used to perform block system authentication operations when the second smart meter uploads block data to the second block system, such as identifying the identity of the second smart meter and obtaining relevant keys.
[0117] The aforementioned processing unit is used to process the power data of the second smart meter, such as encapsulating the power data to obtain block data, or decoding the block data to obtain historically uploaded power data or power data uploaded by other devices.
[0118] Specifically, the above methods also include: In S801, the second smart meter is in a low-power mode if the upload conditions are not met; in the low-power mode, the authentication unit is in a sleep state and the processing unit is in a first working state; in the first working state, the processing unit performs meter recording operations.
[0119] In this embodiment, since the second smart meter is installed on the user side, and maintaining the second smart meter in the block system requires a lot of resources, in order to reduce the energy consumption of the second smart meter, and since the upload conditions for different second smart meters to upload block data are the same, the second smart device in the second block system can be in a low-energy mode when the upload conditions are not met, thereby reducing the energy consumption of the second smart meter under normal conditions.
[0120] In this embodiment, when the second smart meter is in low-power mode, its authentication unit is in a dormant state, meaning it does not perform any authentication operations related to the blockchain system. Meanwhile, the processing unit can be in its first operating state, capable of recording power data, such as meter readings and operation records. It should be noted that in low-power mode, the triggering unit is also in operating mode; that is, the determination of whether the upload conditions are met is specifically based on the triggering unit.
[0121] In S802, the second smart meter determines whether the upload condition is met at the current time through the trigger unit, and switches to block writing mode when the trigger unit recognizes that the upload condition is met; in the block writing mode, the authentication unit is in a wake-up state and the processing unit is in a second working state; in the second working state, the processing unit performs block data processing operations.
[0122] In this embodiment, the second smart meter can determine whether the upload conditions are met by the triggering unit. If the triggering unit detects that the upload conditions are not met at the current time, it can execute the operation of S801, that is, maintain the low power mode; otherwise, if the triggering unit detects that the upload conditions are met at the current time, it can switch the second smart meter from the low power mode to the block write mode.
[0123] In this embodiment, when the second smart meter is in block writing mode, the authentication unit is in a wake-up state, which means it can perform relevant authentication operations of the second block system, and the processing unit is in a second working state, which can process the collected first power data, such as obtaining the first private key and the first public key, and processing the first power data through the first private key to obtain the first block data.
[0124] Specifically, after executing S202, that is, after the second smart meter processes the first power data using the first private key to obtain the first block data and uploads the first block data to the second block system, the process further includes: In S803, the second smart meter switches from the block write mode to the low-power mode.
[0125] In this embodiment, after uploading the first block data to the second block system, the second smart meter can switch back to low-power mode, thereby reducing the device energy consumption of the second smart meter when it does not need to upload block data.
[0126] Figure 9 A flowchart illustrating a specific implementation of a blockchain-based smart meter management method according to the sixth embodiment of this application is shown. See also... Figure 9 As shown, relative to Figure 2-7 In any of the embodiments described above, the management method for a blockchain-based smart meter provided in this application further includes steps S901 to S903, which are described in detail below: In S901, the management terminal decodes the second block data based on the first public key and the second public key of the second block system to determine the reporting time information of each second smart meter; the reporting time information includes the upload time of at least one piece of the first block data uploaded by the second smart meter.
[0127] In this embodiment, in addition to identifying abnormal block data through the first smart terminal, the smart meter management system can also proactively identify whether the block data uploaded by each second smart meter in the block system is abnormal. Specifically, the management terminal can obtain the first public key used by the second smart terminal when uploading the first block data, and the second public key corresponding to the upload of the second block data. It first decodes the second block data using the second public key to obtain the first block data, and then decodes the first block data again using the first public key to obtain the first power data. Based on the first power data, it obtains the reporting time of the second smart meter, encapsulates the reporting times of all second smart meters in the second block system, and obtains the aforementioned reporting time information. That is, the reporting time information includes the reporting time corresponding to the upload of the first block data by each second smart meter in the second block system.
[0128] In S902, the management terminal matches the reported time information with preset meter abnormality conditions to determine the abnormality level of the second smart meter.
[0129] In this embodiment, the management terminal can match the reporting time information with preset meter abnormality conditions, thereby identifying whether there are second smart meters in the second block system that fail to report in a timely manner, and determining the abnormality level of each second smart meter according to the reporting time information.
[0130] In this embodiment, if the anomaly level of all second smart meters is less than or equal to the anomaly threshold, then each second smart meter in the second block system is identified as having no anomaly, and the operation of collecting power data by the second smart meters can continue; otherwise, if the anomaly level of any second smart meter is identified as greater than the anomaly threshold, then operation S903 is executed.
[0131] In some possible implementations, the above-mentioned S902 can specifically determine the anomaly level in the following way: the management terminal determines the upload time difference between any two second smart meters in the second block system based on each upload time in the upload time information; determines the upload interval variance of the second block system based on all the upload time differences; and for any second smart meter, determines the anomaly level corresponding to the second smart meter based on at least one upload time difference of the second smart meter and the upload interval variance.
[0132] In this embodiment, since the upload conditions of each second smart meter in the second block system are the same, that is, under normal circumstances, the upload time difference of each second smart meter is not large. If the upload time of a certain second smart meter is significantly different from the upload time of other second smart meters, that is, the upload time difference is large, the corresponding second smart meter may have an abnormal timer or clock, which may affect the normal operation of the second smart meter. Therefore, the abnormality level of the second smart meter can be determined based on the upload time difference between the second smart meter and other smart meters.
[0133] On the other hand, the management terminal can determine the stability of the second block system based on the upload interval variance of the second block system, and then determine the anomaly base number of the entire second block system based on the stability. It can also determine the corresponding weighting coefficient based on the upload time difference value of each second smart meter, and obtain the anomaly level of the second smart meter based on the weighting coefficient and the aforementioned anomaly base number.
[0134] In S903, if the management terminal detects that the anomaly level is greater than a preset anomaly threshold, it generates a repair prompt message for the second smart meter.
[0135] In this embodiment, when the management terminal detects that the anomaly level of any second smart meter is greater than the anomaly threshold, it can generate a repair prompt message for the second smart meter to prompt the administrator to repair the anomaly of the second smart meter.
[0136] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A management method for smart meters based on blockchain, characterized in that, A management system for smart meters; the management system for smart meters includes a first block system and a second block system; the first block system includes multiple first smart meters and a management terminal; the second block system includes at least one first smart meter and multiple second smart meters; The first smart meter is deployed at multiple transmission line nodes of the second smart meter in the second block system; The management method includes: When the conditions for uploading power data are met, the second smart meter obtains the first private key and the first public key of the second block system where the second smart meter is located; the first public key is determined based on the first historical data of the first smart meter connected to the second smart meter; the first private key is determined based on the second historical data of each second smart meter in the second block system; the upload conditions are used to instruct all second smart meters in the second block system to upload power data; The second smart meter processes the first power data using the first private key to obtain the first block data, and then uploads the first block data to the second block system; The first smart meter authenticates the first block data based on the first public key, and obtains a second private key and a second public key after successful authentication; the second public key is determined by the management terminal based on the third historical data of the first block system; the second private key is determined based on the fourth historical data of each of the first smart meters in the first block system; The first smart meter processes the first block data using the second private key to obtain the second block data, and then uploads the second block data to the first block system.
2. The method according to claim 1, characterized in that, The first smart meter authenticates the first block data using the first public key, and obtains the second private key and the second public key upon successful authentication, including: The first smart meter uses the first public key to decode the first block data uploaded by each of the second smart meters in the second block system to obtain the first power data of each of the second smart meters; The first smart meter determines the data confidence level corresponding to all the first block data based on the data deviation between the second power data of the first smart meter and the sum of all the first power data; the data confidence level is negatively correlated with the data deviation. If the confidence level of the data is greater than or equal to the confidence level threshold, then the authentication of the first block of data is successful. If the data confidence level is less than the confidence level threshold, then based on the first timestamp corresponding to when the upload condition is met, multiple operation records of each of the second smart meters are obtained respectively. For any second smart meter, the first smart meter determines the anomaly identification result of the second smart meter based on the multiple operation records of the second smart meter; The first smart meter sends anomaly repair information to the management terminal based on the anomaly identification results of each of the second smart meters.
3. The method according to claim 2, characterized in that, For any second smart meter, the first smart meter determines the anomaly identification result of the second smart meter based on the multiple operating records of the second smart meter, including: For any given operation record, the first smart meter determines the meter reading difference of the operation record based on the operation record and other operation records adjacent to it. The first smart meter determines the anomaly coefficient of the operation record based on the difference in readings of each of the meters; If the first smart meter detects any of the aforementioned abnormal coefficients that are greater than a preset abnormal level, it identifies the operating record corresponding to the abnormal coefficient as an abnormal record and generates an abnormal identification result for the abnormal record.
4. The method according to any one of claims 1-3, characterized in that, Under the condition that the power data upload conditions are met, the second smart meter obtains the first private key and the first public key of the second block system where the second smart meter is located, including: The second smart meter acquires multiple third block data uploaded at a second timestamp in the second block system; the second timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each third block data is uploaded by the second smart meter in the second block system; The second smart meter decodes each of the third block data according to the third public key corresponding to the second timestamp to obtain the second historical data corresponding to each of the third block data; The second smart meter combines the second historical data sequentially according to the number of each second smart meter in the second block system to obtain the first historical sequence; The second smart meter processes the first historical sequence using a preset hash algorithm to obtain the first private key.
5. The method according to any one of claims 1-3, characterized in that, The first smart meter authenticates the first block data using the first public key, and obtains the second private key and the second public key upon successful authentication, including: The first smart meter acquires multiple fourth block data uploaded at a third timestamp in the first block system; the third timestamp is earlier than the first timestamp, and the first timestamp is the timestamp corresponding to when the upload condition is met; each fourth block data is uploaded by the first smart meter in the first block system; The first smart meter decodes each of the fourth block data according to the fourth public key corresponding to the third timestamp, and obtains the fourth historical data corresponding to each of the fourth block data; The first smart meter combines the fourth historical data in sequence according to the number of each first smart meter in the first block system to obtain the second historical sequence; The first smart meter processes the second historical sequence using a preset hash algorithm to obtain the second private key.
6. The method according to any one of claims 1-3, characterized in that, The second smart meter includes a triggering unit, an authentication unit, and a processing unit; the method further includes: When the upload conditions are not met, the second smart meter is in a low-power mode; in the low-power mode, the authentication unit is in a sleep state and the processing unit is in a first working state; in the first working state, the processing unit performs meter recording operations. The second smart meter determines whether the upload conditions are met at the current time through the trigger unit, and switches to block writing mode when the trigger unit identifies that the upload conditions are met; in the block writing mode, the authentication unit is in a wake-up state and the processing unit is in a second working state; in the second working state, the processing unit performs block data processing operations; After the second smart meter processes the first power data using the first private key to obtain the first block data and uploads the first block data to the second block system, the process further includes: The second smart meter switches from the block write mode to the low-energy mode.
7. The method according to any one of claims 1-3, characterized in that, Also includes: The management terminal decodes the second block data based on the first public key and the second public key of the second block system to determine the reporting time information of each second smart meter. The reporting time information includes the upload time of at least one of the first block data uploaded by the second smart meter; The management terminal matches the reported time information with preset meter abnormality conditions to determine the abnormality level of the second smart meter. If the management terminal detects that the anomaly level is greater than a preset anomaly threshold, it generates a repair prompt message for the second smart meter.
8. The method according to claim 7, characterized in that, The management terminal matches the reported time information with preset meter anomaly conditions to determine the anomaly level of the second smart meter, including: The management terminal determines the upload time difference between any two second smart meters in the second block system based on the various upload times in the upload time information. Based on all the aforementioned upload time differences, determine the upload interval variance of the second block system; For any second smart meter, the anomaly level corresponding to the second smart meter is determined based on at least one upload time difference of the second smart meter and the upload interval variance.
9. A management system for smart meters based on blockchain, characterized in that, The management system for the smart meter includes a first block system and a second block system; the first block system includes multiple first smart meters and a management terminal; the second block system includes at least one first smart meter and multiple second smart meters. The first smart meter is deployed at multiple transmission line nodes of the second smart meter in the second block system; The second smart meter is used to obtain the first private key and the first public key of the second block system where the second smart meter is located, provided that the conditions for uploading power data are met. The first public key is determined based on the first historical data of the first smart meter connected to the second smart meter; the first private key is determined based on the second historical data of each of the second smart meters in the second block system; the upload condition is used to instruct all the second smart meters in the second block system to upload power data; The second smart meter is used to process the first power data using the first private key to obtain the first block data, and upload the first block data to the second block system; The first smart meter is used to authenticate the first block data based on the first public key, and obtain the second private key and the second public key after successful authentication; The second public key is determined by the management terminal based on the third historical data of the first block system; the second private key is determined based on the fourth historical data of each of the first smart meters in the first block system. The first smart meter is used to process the first block data using the second private key to obtain the second block data, and then upload the second block data to the first block system.
10. The management system according to claim 9, characterized in that, The second smart meter includes a triggering unit, an authentication unit, and a processing unit; The second smart meter is configured to operate in a low-energy mode when the upload conditions are not met. In the low-energy mode, the authentication unit is in a sleep state, and the processing unit is in a first working state. In the first working state, the processing unit performs meter recording operations. The second smart meter is used to determine whether the upload condition is met at the current time through the triggering unit, and to switch to block writing mode when the triggering unit identifies that the upload condition is met; in the block writing mode, the authentication unit is in a wake-up state and the processing unit is in a second working state; in the second working state, the processing unit performs block data processing operations; In the second smart meter, after processing the first power data using the first private key to obtain the first block data and uploading the first block data to the second block system, the system further includes: The second smart meter is used to switch from the block write mode to the low-energy mode.
