Electric quantity reconciliation method and device based on edge calculation and storage medium

By using edge computing and blockchain technology, electricity data is collected and verified in real time, which solves the problem of delayed electricity data reconciliation in the power grid financial system, realizes the automation and timeliness of electricity reconciliation, and reduces financial risks.

CN121682902APending Publication Date: 2026-03-17SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

The existing power grid financial system suffers from outdated electricity data reconciliation methods, resulting in long-term outstanding accounts and high financial risks, lacking timeliness and accuracy.

Method used

By adopting an edge computing-based approach, electricity data is collected in real time through the integrated terminal of the distribution area, metering records are generated, hash values ​​are calculated and uploaded to the blockchain, a hash tree is constructed for verification, and data comparison and supplementary entry requests are made on the server side, thereby achieving automation and near real-time performance of the reconciliation process.

Benefits of technology

It significantly improves the timeliness and accuracy of electricity reconciliation, reduces reliance on manual verification, quickly identifies and corrects data loss or tampering issues, and reduces financial risks and potential outstanding accounts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121682902A_ABST
    Figure CN121682902A_ABST
Patent Text Reader

Abstract

The invention discloses an electric quantity reconciliation method and device based on edge calculation and a storage medium. The method comprises the following steps: step S10, collecting electric quantity data of an electric meter, and generating a metering record of the electric quantity data based on a preset electric quantity metering unit; step S20, calculating a hash value of the measurement record, and uploading the hash value as leaf node information to the block chain network; step S30, obtaining a target measurement record and a corresponding target hash value of a preset time period, constructing a hash tree based on the target hash value, and taking a root node of the hash tree as a check value; step S40, aggregating the target metering records into a metering data packet, and sending the metering data packet to a server; and S50, after an additional recording request sent by the server is received, determining corresponding additional recording metering data according to the additional recording request, and sending the additional recording metering data to the server. According to the invention, the dependence on manual checking can be reduced, and the timeliness and accuracy of account checking can be obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, device and storage medium for electricity reconciliation based on edge computing. Background Technology

[0002] In the operation and management of the power industry, the power grid system and the financial system generate massive amounts of electricity data every day, and both need to reconcile these data to ensure the accuracy of the electricity data and the consistency of the accounts.

[0003] Currently, traditional reconciliation methods widely used in related technical fields have many limitations. Specifically, in the electricity data collection stage, meter readings are usually taken at the end of the month. After the meter readings are completed, the data needs to be manually exported from the relevant system to an Excel file, and then the electricity data for each household is checked one by one. If errors are found during the verification process, manual adjustments must be performed.

[0004] From a system architecture and data interaction perspective, the power grid system and the financial system operate independently, each storing its own electricity ledger data. They only perform a one-time data comparison at the end of each month using batch file processing. This reconciliation model presents significant problems. Due to the severe time lag in data comparison, if a customer's meter data is missing or tampered with, it often goes undetected until the following month's data comparison.

[0005] This lagging data discovery mechanism leads to unresolved accounting issues and easily results in long-term outstanding accounts due to data discrepancies. Long-term outstanding accounts not only increase the complexity and workload of accounting management, but more importantly, expose companies to higher financial risks, adversely affecting their financial security and normal operations. Therefore, there is an urgent need for a more efficient, timely, and accurate reconciliation technology to address these problems existing in current technologies. Summary of the Invention

[0006] To address the technical problem of long-term outstanding accounts and high financial risks in power grid finance, this invention provides a power reconciliation method, device, and storage medium based on edge computing, which can improve the timeliness and accuracy of reconciliation and reduce financial risks and the potential for outstanding accounts.

[0007] As one aspect of the present invention, a power reconciliation method based on edge computing is provided, which is applied to a converged terminal in a distribution area. The method includes the following steps: Step S10: Collect the electricity consumption data of the electricity meter and generate a metering record of the electricity consumption data based on the preset electricity metering unit; Step S20: Calculate the hash value of the metering record and upload the hash value as leaf node information to the blockchain network; Step S30: Obtain the target metering records and corresponding target hash values ​​for a preset time period, construct a hash tree based on the target hash values, and use the root node of the hash tree as the verification value; Step S40: Aggregate the target metering records into a metering data packet and send the metering data packet to the server; Step S50: After receiving the supplementary recording request sent by the server, determine the corresponding supplementary recording measurement data according to the supplementary recording request, and send the supplementary recording measurement data to the server.

[0008] Preferably, step S30 further includes: The time interval of the preset time period is determined according to the preset time interval; In the metering records in the cache, identify all target metering records whose recording time falls within the time interval, and obtain the target hash value corresponding to the target metering record; Construct a hash tree structure using the target hash value as the leaf node; In the hash tree structure, the hash value of the parent node is calculated layer by layer from bottom to top to obtain the root hash value, and the root hash value is used as the verification value. The leaf node list of the leaf nodes, the root hash value, and the period identifier are associated and stored in the local index area.

[0009] Preferably, step S10 further includes: Receive the pulse signal sent by the electricity meter, and read the current electricity value when the rising edge of the pulse signal is detected; Obtain the timestamp corresponding to the pulse signal, and combine the power value, meter address and timestamp into the metering record.

[0010] Preferably, step S20 further includes: The hash value is combined with the meter identifier and timestamp to generate blockchain transaction data; The blockchain transaction data is digitally signed to generate signed transaction data; The signed transaction data is broadcast to neighboring nodes in the blockchain network; The system receives a notification from the blockchain network that the signed transaction data has been verified, and marks the metering record corresponding to the hash value as being on-chain.

[0011] Preferably, step S50 further includes: Parse the target time frame and target meter address in the supplementary recording request; Based on the target time frame and the target meter address, retrieve the corresponding original metering record from the local index area; The retrieved original measurement records are digitally signed and verified. If the verification is successful, they are used as supplementary measurement data. The supplementary metering data is encapsulated into a response message and sent to the server.

[0012] As another aspect of the present invention, an edge computing-based electricity reconciliation method is also provided, characterized in that it is applied to a server, and the method includes the following steps: Step S60: Receive the metering data packet sent by the substation convergence terminal, and obtain the target metering record in the metering data packet; Step S70: Calculate the target hash value of the target metering record, construct a target hash tree based on the target hash value, and use the root node of the target hash tree as the target verification value; Step S80: Compare the verification value with the target verification value, and when the verification value and the target verification value do not match, obtain leaf node information in the blockchain network; Step S90: Compare the target leaf node and the leaf node information of the target hash tree, and generate a supplementary entry request based on the comparison result; Step S100: Send the supplementary recording request to the substation convergence terminal, and receive the supplementary metering data fed back by the substation convergence terminal.

[0013] Preferably, step S90 further includes: Generate a blockchain query request based on the time range of the target measurement record; The query request is sent to the blockchain network to obtain the hash values ​​of all leaf nodes within the corresponding time interval; Verify the on-chain consistency of the leaf node hash value; if the verification passes, use it as the leaf node information.

[0014] Preferably, after step S100, the method further includes: In the response message sent by the integrated terminal of the distribution area, the supplementary metering data is obtained, and the supplementary metering data is updated to the target metering record; Based on the updated target metering record, the target hash tree is recalculated to obtain the first verification value; Calculate the second verification value based on the leaf node information obtained in the blockchain network; The first check value is compared with the second check value. If the comparison result is consistent, the supplementary recording action is completed.

[0015] As another aspect of the present invention, an edge computing-based electricity reconciliation device is also provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the edge computing-based electricity reconciliation method as described above.

[0016] As another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored thereon, and when executed by a processor, the computer program implements the steps of the aforementioned edge computing-based electricity reconciliation method.

[0017] The technical solution of this invention has at least the following technical effects: This invention provides a method, device, and storage medium for electricity reconciliation based on edge computing. It collects electricity meter data in real time through a substation converged terminal and generates metering records. Hash values ​​are calculated and uploaded to the blockchain to ensure data immutability. A root node of a hash tree is periodically constructed as a verification value. Aggregated metering data packets are sent to a server. Upon receiving a supplementary recording request, the system responds quickly and provides supplementary metering data. Simultaneously, after receiving the data, the server calculates the target hash value, constructs a target hash tree for verification value comparison, and, if a mismatch occurs, retrieves leaf node information from the blockchain to generate a supplementary recording request. This achieves near real-time and automation of the reconciliation process.

[0018] Implementing this invention can reduce reliance on manual verification, significantly improve the timeliness and accuracy of reconciliation, enable the rapid detection and correction of data loss or tampering issues, and reduce financial risks and the potential for outstanding accounts. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating a first embodiment of an edge computing-based electricity reconciliation method provided by the present invention. Figure 2 This is a flowchart illustrating a second embodiment of an edge computing-based electricity reconciliation method provided by the present invention. Figure 3 This is a flowchart illustrating a third embodiment of an edge computing-based electricity reconciliation method provided by the present invention. Figure 4This is a schematic diagram of the structure of an edge computing-based electricity reconciliation device in the hardware operating environment involved in the embodiments of the present invention. Detailed Implementation

[0021] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0022] The main solution of this invention is as follows: Collect electricity consumption data from electricity meters and generate metering records based on preset electricity metering units; calculate the hash value of the metering record and upload the hash value as leaf node information to the blockchain network; obtain target metering records and corresponding target hash values ​​for preset time periods, construct a hash tree based on the target hash values, and use the root node of the hash tree as a verification value; aggregate the target metering records into metering data packets and send the metering data packets to the server; upon receiving a supplementary recording request from the server, determine the corresponding supplementary metering data according to the supplementary recording request and send the supplementary metering data to the server.

[0023] Current technology typically involves centralized meter reading at the end of the month, followed by manual export to Excel for individual verification, and manual adjustments to accounts in case of errors. However, the marketing and financial systems maintain separate electricity ledgers, only performing a one-time comparison via batch files at the end of the month. In this situation, due to the delayed comparison and reliance on manual reconciliation, missing or altered meter data for a particular customer often isn't discovered until the following month. This leads to long-term outstanding balances due to data discrepancies, resulting in significant financial risk.

[0024] This invention collects electricity meter data in real time through a substation convergence terminal and generates metering records. It calculates hash values ​​and uploads them to the blockchain to ensure data immutability. It also periodically constructs the root node of a hash tree as a verification value, sends aggregated metering data packets to the server, and quickly responds to supplementary recording requests by providing supplementary metering data. Simultaneously, the server receives data, calculates the target hash value, constructs a target hash tree for verification value comparison, and generates a supplementary recording request from the leaf node information of the blockchain when a mismatch occurs. This achieves near real-time and automation of the reconciliation process, reducing reliance on manual verification and significantly improving the timeliness and accuracy of reconciliation. It enables the rapid detection and correction of data loss or tampering, reducing financial risks and potential outstanding accounts.

[0025] It should be noted that the executing entity in this embodiment can be a substation converged terminal, or a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of the above functions, or an edge computing-based electricity reconciliation device, etc. This embodiment does not specifically limit it. The following uses a substation converged terminal as an example to describe this embodiment and the following embodiments.

[0026] Based on this, embodiments of the present invention provide a power reconciliation method based on edge computing, referring to... Figure 1 As shown, Figure 1 This is a flowchart illustrating the first embodiment of the edge computing-based electricity reconciliation method of the present invention.

[0027] In this embodiment, the edge computing-based electricity reconciliation method includes steps S10 to S40: Step S10: Collect the electricity consumption data of the electricity meter and generate a metering record of the electricity consumption data based on the preset electricity metering unit; In this embodiment, the substation convergence terminal is an edge computing gateway device installed on the power substation side, acting as the execution entity responsible for collecting, processing, and transmitting power data. Its core includes at least a high-speed microprocessor and a high-precision real-time clock, specifically designed to accurately capture and record power pulses. Power data refers to the raw numerical value representing power consumption output by physical meters through pulse signals. A dedicated hardware module within the substation convergence terminal, the power metering unit, is a preset minimum power unit used to quantify power data; for example, each pulse represents 0.01 kWh. It consists of power value, meter address, timestamp, and other information, and is an immutable data unit used to uniquely identify a single power metering event.

[0028] It's important to note that in a power system, a "distribution area" refers to the area supplied by a single distribution transformer. It is the smallest basic management unit in the distribution network, typically covering a residential area, a building, or a specific region, and is directly connected to the end-user's electricity meter. A distribution area fusion terminal, on the other hand, is an embedded computer device belonging to each distribution area, deployed at the edge of the power network, possessing functions such as data acquisition, computation, storage, communication, and control. It incorporates multiple functions to achieve functional "fusion," enabling data acquisition, computation, transmission, and / or load balancing, performance monitoring, and other functions.

[0029] Optionally, the integrated terminal in a distribution area can communicate with subordinate smart meters, smart switches, and other devices via downlink communication through various methods, such as HPLC, RF, and low-power wireless, to collect data and issue commands. Alternatively, it can connect to the cloud-based main station system (server) via uplink communication through public wireless networks, private fiber optic networks, etc., to aggregate and upload important data and receive downlink instructions. Or, it can communicate with other integrated terminals in the distribution area or devices within the area through peer-to-peer communication to form a blockchain network and achieve distributed collaboration.

[0030] Specifically, the substation convergence terminal continuously monitors the communication between the electricity meter and its connected power line carrier or RS-485 bus. When it detects a pulse signal representing a certain amount of electricity consumption sent by the meter, the unit immediately triggers an interrupt, captures the rising edge of the pulse signal, and simultaneously reads the timestamp of a high-precision real-time clock. Subsequently, the substation convergence terminal parses the current cumulative electricity consumption value from the pulse signal's attributes and combines the electricity consumption value, the unique address identifier of the meter that sent the pulse signal, and the captured precise timestamp into a structured data block. This data block constitutes a complete metering record.

[0031] For example, the substation convergence terminal periodically polls the smart meters under its jurisdiction via RS-485 or HPLC high-speed carrier interface, receives DL / T 698.45 protocol frames returned by the meters, parses the pulse count field within the frame to obtain the electricity value, records the current system UTC time as a timestamp, and uses the meter's communication address as the meter address. These three values ​​are concatenated and a hash algorithm is used to generate a metering record. For instance, a specific metering record might contain the meter address METER-00x-A2xB, the timestamp 2023-xx-xx 10:xx:xx.123, and the electricity value 5xx.8 kWh.

[0032] Step S20: Calculate the hash value of the metering record and upload the hash value as leaf node information to the blockchain network; In this embodiment, the hash value is a fixed-length string calculated from the metering record using a hash function such as the SHA-256 algorithm. It is used to uniquely identify the record and is irreversible. Leaf node information refers to the position of the hash value within the hash tree structure, serving as the bottom-level nodes of the tree.

[0033] Optionally, the blockchain network can be a blockchain module of the power grid management platform used to store relevant data, such as bills and power grid information, or it can be a distributed system composed of multiple transformer substation fusion terminal nodes, using a consensus mechanism to ensure data consistency and immutability.

[0034] As an optional implementation, the integrated terminal in the distribution area uses a hash algorithm to process metering records and generate hash values. This process ensures that even minor changes will result in significant changes to the hash values. The hash values ​​are then combined with meter identifiers and timestamps to form blockchain transaction data. The meter identifier is used to associate the meter, and the timestamp is used for time sorting. The terminal uses its own private key to digitally sign the transaction data, generating signed transaction data. The signing process is based on asymmetric encryption principles to verify the data source and integrity. Next, the terminal broadcasts the signed transaction data to neighboring nodes in the blockchain network. Broadcasting is achieved through a peer-to-peer network protocol. The terminal awaits verification notification from the blockchain network. Verification includes signature validity and transaction uniqueness. Once verified, the terminal marks the corresponding metering record as on-chain and updates its local status flag.

[0035] For example, the terminal invokes its built-in cryptographic module, uses the SM3 hash algorithm to hash the metering record, and generates a 256-bit hash value. This hash value is then concatenated with the meter address and timestamp to generate blockchain transaction data. The terminal's private key is used to perform an SM2 digital signature on the transaction data, generating signed transaction data. This signed transaction data is broadcast to neighboring nodes in the blockchain network via the Message Queuing Telemetry Transport (MQTT) protocol. Upon receiving a verification notification from the blockchain network, the corresponding metering record is marked as "on-chain".

[0036] As an alternative implementation, the substation convergence terminal can calculate a hash value based on metering records and / or encapsulate it into micro-transaction information for on-chain execution. Specifically, the substation convergence terminal combines the hash value with the meter identifier and timestamp to generate blockchain transaction data, digitally signs the blockchain transaction data to generate signed transaction data, broadcasts the signed transaction data to neighboring nodes in the blockchain network, receives verification notifications from the blockchain network regarding the signed transaction data, and marks the metering record corresponding to the hash value as having been on-chain.

[0037] Optionally, if the blockchain network is a distributed system composed of multiple integrated terminal nodes in the distribution area, the integrated terminal will synchronously add the metering record identifier to the locally stored blockchain after receiving the consensus response.

[0038] Optionally, leaf node information refers to a fixed-length bit string obtained after the metering record is processed by a one-way hash function, which is used as the bottom-level node when constructing the Merkle tree. The substation convergence terminal calls the built-in cryptographic module to perform a hash operation on the metering record using a hash algorithm, outputting a fixed-length hash value, such as a 256-bit hash value. Then, the hash value is concatenated with the meter address and timestamp to form the transaction payload. The terminal's private key is used to generate signed transaction data using a digital signature algorithm, which is then broadcast to adjacent blockchain nodes via the MQTT protocol. After the nodes complete consensus, they return a verification success notification. Upon receiving the notification, the terminal marks the corresponding metering record as being on-chain.

[0039] Step S30: Obtain the target metering records and corresponding target hash values ​​for a preset time period, construct a hash tree based on the target hash values, and use the root node of the hash tree as the verification value; In this embodiment, the preset time period is a pre-defined time interval, such as 15 minutes or 1 hour, used for periodic data processing. The target metering record refers to all metering records collected within this time period. The target hash value is the set of hash values ​​corresponding to that metering record. A hash tree is a Merkle tree structure that compresses multiple leaf nodes into a single root hash data structure through recursive hashing, used for efficient integrity verification. The leaf nodes are hash values, the parent node is the hash of the child node's hash value, and the root node is the hash value at the top of the tree, used as a check value.

[0040] As an optional implementation, the substation convergence terminal determines the time interval of a preset time period according to a preset time interval. In the metering records in the cache, it identifies all target metering records whose recording time falls within the time interval and obtains the target hash value corresponding to the target metering record. Using the digest value as the leaf node, it constructs a hash tree structure. In the hash tree structure, it calculates the hash value of the parent node layer by layer from bottom to top to obtain the root hash value. The root hash value is used as the verification value. The leaf node list of the leaf node, the root hash value, and the period identifier are associated and stored in the local index area.

[0041] Specifically, the integrated terminal in the distribution area determines a time range, such as 10:00 to 11:00, based on a preset time interval, e.g., one hour. It then retrieves all records whose times fall within this range from the metering records in the cache and obtains their hash values, which are uploaded to the blockchain. Using these hash values ​​as leaf nodes, a hash tree structure is constructed. The construction process employs a recursive algorithm, grouping leaf nodes and calculating the hash values ​​of their parent nodes until the root node hash value is generated. When calculating the parent node hash, the hash values ​​of two child nodes are typically concatenated. After obtaining the root hash value, it is used as a verification value. The leaf node list, the root hash value, and the period identifier (such as the time range) are stored together in a local index area. This index area uses a database or file system for easy and fast retrieval.

[0042] Optionally, the integrated terminal of the distribution area will also generate a time period identifier based on a preset time period, associate the time period identifier with the corresponding leaf node and / or verification value, and upload it to the blockchain network.

[0043] For example, with a time period of 1 hour, obtain the hash values ​​H1, H2, and H3 of three records from 10:00 to 11:00, calculate H12 as hashH1 plus H2, and H123 as hashH12 plus H3. The root hash is H123. Store the root hash and the list of leaf nodes H1, H2, and H3.

[0044] The process of calculating the parent node from the leaf nodes is a recursive calculation based on a cryptographic hash function. Its core principle is to concatenate the hash values ​​of two adjacent child nodes and calculate their hash value, which becomes the hash value of the parent node. This process proceeds layer by layer upwards until the final root node is generated. The hash values ​​of all data units needed to build the hash tree are used as leaf nodes and arranged sequentially. If the number of leaf nodes is even, they are grouped in pairs. If it is odd, the last leaf node is copied to make it even, ensuring that each layer can be calculated in pairs. Next, starting from the bottom-level leaf nodes, the hash values ​​of every two adjacent child nodes are concatenated sequentially to form a new string. Then, a specified cryptographic hash function, such as SHA-256, is applied to the concatenated string to calculate its hash value, which is the hash value of the parent node of these two child nodes. All the calculated parent node hash values ​​are used as new nodes and arranged in the previous layer. The above concatenation and hash calculation process is repeated, that is, the new nodes in this layer are grouped in pairs, their hash values ​​are concatenated, and the parent node hash value is calculated. This process is repeated recursively, with the number of nodes halved at each level of calculation, until a unique hash value is finally calculated, which becomes the root node of the entire hash tree.

[0045] As another optional implementation, the substation convergence terminal can also store the metering record locally after it is generated, and after a preset time period ends, calculate the hash value of the metering record and build a hash tree at the same time, and then upload the hash value and hash tree to the blockchain network.

[0046] Step S40: Aggregate the target metering records into a metering data packet, and send the metering data packet to the server; In this embodiment, a metering data packet refers to a binary object containing the original metering record and its digital signature, used for independent verification and recalculation by the server. The substation convergence terminal aggregates the target metering records into a metering data packet based on the data packet format corresponding to the preset communication protocol between the terminal and the server, and sends it to the server. The server is a remote data processing center responsible for receiving and processing data.

[0047] Specifically, the integrated terminal in the distribution area collects all target metering records within a preset time period from the cache. These records include electricity consumption values, meter addresses, and timestamps. The records are then aggregated into a single data packet. This aggregation process may include data compression or encryption to improve transmission efficiency and security. The data packet also includes metadata such as time period identifiers and checksums. Finally, the terminal sends the metering data packet to the server via network protocols such as HTTP or MQTT. The transmission process ensures reliable delivery and includes a retry mechanism for errors.

[0048] Step S50: After receiving the supplementary recording request sent by the server, determine the corresponding supplementary recording measurement data according to the supplementary recording request, and send the supplementary recording measurement data to the server.

[0049] In this embodiment, the supplementary recording request is a request message sent by the server when it determines that a metering record is missing based on the metering data packet. It is used to request the converged terminal in the distribution area to resend specific data. The supplementary metering data is the original metering record retrieved by the terminal based on the supplementary recording request. This process completes the metering records stored on the server by resending the missing metering records.

[0050] As an optional implementation, the integrated terminal of the distribution area parses the target time range and target meter address in the supplementary recording request, retrieves the corresponding original metering record from the local index area according to the target time frame and target meter address, performs digital signature verification on the retrieved original metering record, and if the verification is successful, uses it as supplementary metering data, encapsulates the supplementary metering data into a response message, and sends it to the server.

[0051] As an alternative implementation, the substation convergence terminal can also obtain the target hash value in the supplementary recording request, and match the hash value with the locally stored hash value to determine the corresponding supplementary metering record.

[0052] This invention, through a substation convergence terminal, collects electricity meter data in real time and generates metering records. It calculates hash values ​​and uploads them to the blockchain to ensure data immutability. The root node of a hash tree is periodically constructed as a verification value. Aggregated metering data packets are sent to the server. Upon receiving a supplementary recording request, the system responds quickly and provides supplementary metering data. Simultaneously, after receiving the data, the server calculates the target hash value, constructs a target hash tree for verification value comparison, and, if a mismatch occurs, retrieves leaf node information from the blockchain to generate a supplementary recording request. This achieves near real-time and automation of the reconciliation process, reducing reliance on manual verification and significantly improving the timeliness and accuracy of reconciliation. It enables the rapid detection and correction of data loss or tampering issues, reducing financial risks and potential outstanding accounts.

[0053] Based on the same inventive concept, the present invention also provides a second embodiment, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the edge computing-based electricity reconciliation method of the present invention.

[0054] In this embodiment, the edge computing-based electricity reconciliation further includes steps S60~S100: Step S60: Receive the metering data packet sent by the substation convergence terminal, and obtain the target metering record in the metering data packet; In this embodiment, the server receives connections from the substation convergence terminal via a network interface, using TCP / IP or higher-level protocols such as HTTP or MQTT to receive metering data packets. Upon receipt, the server parses the data packet format and extracts the target metering record list; this parsing process may involve decompression or decryption. Simultaneously, metadata such as time period identifiers and checksums are extracted from the data packets, where the checksum is the root hash calculated by the substation convergence terminal. The target metering records are stored in a temporary database or memory for subsequent processing, ensuring data caching and fast access.

[0055] Step S70: Calculate the target hash value of the target metering record, and construct a target hash tree based on the target hash value, using the root node of the target hash tree as the target verification value; In this embodiment, the target hash value is a set of hash values ​​independently calculated by the server for each target metering record. The target hash tree is a Merkle tree structure built by the server based on the target hash values. The target checksum is the root node hash of the target hash tree, used for data verification. The server applies a hash function, such as SHA-256 or SM3, to each target metering record to calculate its hash value, ensuring consistency with the terminal's calculation method. Then, using these hash values ​​as leaf nodes, the target hash tree is constructed. The construction algorithm employs hierarchical hashing, grouping leaf nodes to calculate the parent node hash until the root node hash is generated. The root node hash is the target checksum, which the server stores for comparison. The construction process may be optimized for parallel computation to improve efficiency.

[0056] It should be noted that the hash algorithm used to calculate the hash value in the server needs to be consistent with that in the integrated terminal of the distribution area to ensure the accuracy of the verification.

[0057] Step S80: Compare the verification value with the target verification value, and when the verification value and the target verification value do not match, obtain the leaf node information in the blockchain network; In this embodiment, based on the immutability of data in the blockchain network, the list of hash values ​​obtained by the server from the blockchain network, i.e., leaf node information, represents the trusted data uploaded by the terminal. The server compares the verification value provided by the terminal with the target verification value calculated by itself, using string or binary comparison. If the two match, the data is complete; if they do not match, the server generates a blockchain query request, which includes the time period and terminal identifier. The query request is sent to the blockchain network, and all leaf node hash values ​​uploaded by the terminal within that time period are queried through the network API or smart contract. After receiving the query result, the on-chain consistency of the leaf node hash values ​​is verified by checking the block confirmation and signature validity of the blockchain to ensure data trustworthiness. For example, if the verification value root_hash_123 does not match the target verification value H123, the server queries the blockchain to obtain the leaf node hash list H1, H2, and H3, and verifies their on-chain status.

[0058] As an optional implementation, the server generates a blockchain query request based on the time range of the target metering record, i.e., the time interval corresponding to a preset time period. The query request is sent to the blockchain network to obtain the hash values ​​of all leaf nodes within the corresponding time interval. The on-chain consistency of the leaf node hash values ​​is verified, and if the verification passes, it is used as the leaf node information.

[0059] As another alternative implementation, the server can also obtain the leaf node information of the corresponding period in the blockchain network based on the time period identifier contained in the metering data packet sent by the substation fusion terminal.

[0060] Step S90: Compare the target leaf node and the leaf node information of the target hash tree, and generate a supplementary entry request based on the comparison result; In this embodiment, the server compares the target leaf node list with the leaf node information list obtained from the blockchain, using a comparison algorithm such as set difference lookup to identify missing or mismatched hash values. Based on the differences, it determines the meter address and time range that need to be supplemented; for example, a missing hash value corresponds to a specific meter and time. Then, a supplementation request is generated. The request format is structured data such as JSON, containing the target time range, the target meter address, and a possible reason code. The generation process ensures the request is explicit and operable.

[0061] Optionally, the server can generate a supplementary recording request based on the hash value corresponding to the mismatched leaf node information, so that the substation convergence terminal can send the supplementary metering data corresponding to the leaf node information to the server. Alternatively, the server can generate a supplementary recording request based on the data time frame corresponding to the mismatched leaf node information.

[0062] Step S100: Send the supplementary recording request to the integrated terminal of the distribution area, and receive the supplementary metering data fed back by the integrated terminal of the distribution area.

[0063] In this embodiment, the server sends the supplementary data request to the corresponding integrated terminal in the distribution area via the network and waits for a response from the integrated terminal. Upon receiving the response message from the integrated terminal, the server parses the message to extract the supplementary metering data. The received data undergoes preliminary verification, such as checking signatures and integrity, to ensure data authenticity. Then, the supplementary metering data is stored or integrated into the existing data, updating the local records to ensure the integrity of the local records.

[0064] Since the system described in Embodiment 2 of this invention is a system used to implement the method of Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this system based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All systems used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0065] Based on the same inventive concept, the present invention also provides a third embodiment, referring to... Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the edge computing-based electricity reconciliation method of the present invention.

[0066] In this embodiment, after sending the supplementary recording request to the substation convergence terminal as described in step S100, and receiving the supplementary metering data fed back by the substation convergence terminal, the method further includes steps S110 to S140: Step S110: Obtain the supplementary metering data from the response message sent by the integrated terminal of the distribution area, and update the supplementary metering data to the target metering record; Step S120: Based on the updated target metering record, recalculate the target hash tree to obtain the first verification value; Step S130: Calculate the second verification value based on the leaf node information obtained in the blockchain network; Step S140: Compare the first verification value with the second verification value. If the comparison result is consistent, the supplementary recording action is completed.

[0067] In this embodiment, after receiving the supplementary metering record, the server will perform further verification on the supplementary metering record. If the verification fails, the supplementary record request will be resent or a warning message will be sent to the administrator terminal.

[0068] Specifically, the server retrieves the supplementary metering data from the response message sent by the integrated terminal in the distribution area, updates the target metering record with the supplementary metering data, and recalculates the target hash tree based on the updated target metering record to obtain the first verification value. Then, based on the leaf node information obtained from the blockchain network, it calculates the second verification value and compares the first verification value with the second verification value. If the comparison result is consistent, the supplementary recording action is completed. If the comparison result is inconsistent, the supplementary recording request is resent, or a warning message is sent to the administrator terminal.

[0069] Since the system described in Embodiment 3 of this invention is a system used to implement the method of Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this system based on the method described in Embodiment 1 of this invention, and therefore will not be described again here. All systems used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0070] The present invention provides an edge computing-based electricity reconciliation device, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the edge computing-based electricity reconciliation method of the above embodiment 1.

[0071] The following is for reference. Figure 4 The diagram illustrates a structural schematic of an edge computing-based electricity reconciliation device suitable for implementing embodiments of the present invention. The edge computing-based electricity reconciliation device in these embodiments may include, but is not limited to, fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The edge computing-based electricity reconciliation device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0072] like Figure 4As shown, the edge computing-based electricity reconciliation device may include a processing unit 101 (e.g., a core processor, graphics processor, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 102 or a program loaded from storage device 103 into random access memory (RAM) 104. The RAM 104 also stores various programs and data required for the operation of the edge computing-based electricity reconciliation device. The processing unit 101, ROM 102, and RAM 104 are interconnected via a bus 105. An input / output (I / O) interface 106 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 106: input devices 107 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 108 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tape, hard disks, etc.; and communication devices 109. Communication device 109 allows the edge computing-based electricity reconciliation device to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows edge computing-based electricity reconciliation devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0073] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 103, or installed from read-only memory 102. When the computer program is executed by processing device 101, it performs the functions defined in the methods of the embodiments disclosed in this invention.

[0074] The edge computing-based electricity reconciliation device provided by this invention, employing the edge computing-based electricity reconciliation method described in the above embodiments, can solve the technical problem of long-term outstanding accounts and high financial risk in power grid finance. Compared with the prior art, the beneficial effects of the edge computing-based electricity reconciliation device provided by this invention are the same as those of the edge computing-based electricity reconciliation method provided in the above embodiments, and other technical features of this edge computing-based electricity reconciliation device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0075] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0076] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0077] The present invention provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the edge computing-based electricity reconciliation method in the above embodiments.

[0078] The computer-readable storage medium provided by this invention may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0079] The aforementioned computer-readable storage medium may be included in an edge computing-based electricity reconciliation device; or it may exist independently and not incorporated into an edge computing-based electricity reconciliation device.

[0080] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by an edge-computing-based electricity reconciliation device, the edge-computing-based electricity reconciliation device performs the following actions: collects electricity meter data and generates metering records based on a preset electricity metering unit; calculates the hash value of the metering record and uploads the hash value as leaf node information to the blockchain network; obtains target metering records and corresponding target hash values ​​for a preset time period, constructs a hash tree based on the target hash values, and uses the root node of the hash tree as a verification value; aggregates the target metering records into metering data packets and sends the metering data packets to a server; upon receiving a supplementary recording request from the server, determines the corresponding supplementary metering data according to the supplementary recording request and sends the supplementary metering data to the server.

[0081] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0083] The modules described in the embodiments of the present invention can be implemented in software or hardware. The names of the modules do not necessarily limit the specific unit itself.

[0084] The readable storage medium provided by this invention is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned edge computing-based electricity reconciliation method. This addresses the technical problem of long-term outstanding accounts and high financial risk in power grid finances. Compared with existing technologies, the beneficial effects of the computer-readable storage medium provided by this invention are the same as those of the edge computing-based electricity reconciliation method provided in the above embodiments, and will not be elaborated upon here.

[0085] The above description is only a part of the embodiments of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the technical concept of the present invention using the contents of the present invention specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A power reconciliation method based on edge computing, characterized in that, The method, applied to a converged terminal in a distribution network, includes the following steps: Step S10: Collect the electricity consumption data of the electricity meter and generate a metering record of the electricity consumption data based on the preset electricity metering unit; Step S20: Calculate the hash value of the metering record and upload the hash value as leaf node information to the blockchain network; Step S30: Obtain the target metering records and corresponding target hash values ​​for a preset time period, construct a hash tree based on the target hash values, and use the root node of the hash tree as the verification value; Step S40: Aggregate the target metering records into a metering data packet and send the metering data packet to the server; Step S50: After receiving the supplementary recording request sent by the server, determine the corresponding supplementary recording measurement data according to the supplementary recording request, and send the supplementary recording measurement data to the server.

2. The method as described in claim 1, characterized in that, Step S30 further includes: The time interval of the preset time period is determined according to the preset time interval; In the metering records in the cache, identify all target metering records whose recording time falls within the time interval, and obtain the target hash value corresponding to the target metering record; Construct a hash tree structure using the target hash value as the leaf node; In the hash tree structure, the hash value of the parent node is calculated layer by layer from bottom to top to obtain the root hash value, and the root hash value is used as the verification value. The leaf node list of the leaf nodes, the root hash value, and the period identifier are associated and stored in the local index area.

3. The method as described in claim 1, characterized in that, Step S10 further includes: Receive the pulse signal sent by the electricity meter, and read the current electricity value when the rising edge of the pulse signal is detected; Obtain the timestamp corresponding to the pulse signal, and combine the power value, meter address and timestamp into the metering record.

4. The method according to any one of claims 1 to 3, characterized in that, Step S20 further includes: The hash value is combined with the meter identifier and timestamp to generate blockchain transaction data; The blockchain transaction data is digitally signed to generate signed transaction data; The signed transaction data is broadcast to neighboring nodes in the blockchain network; The system receives a notification from the blockchain network that the signed transaction data has been verified, and marks the metering record corresponding to the hash value as being on-chain.

5. The method as described in claim 1, characterized in that, Step S50 further includes: Parse the target time frame and target meter address in the supplementary recording request; Based on the target time frame and the target meter address, retrieve the corresponding original metering record from the local index area; The retrieved original measurement records are digitally signed and verified. If the verification is successful, they are used as supplementary measurement data. The supplementary metering data is encapsulated into a response message and sent to the server.

6. A power reconciliation method based on edge computing, characterized in that, Applied to a server, the method includes the following steps: Step S60: Receive the metering data packet sent by the substation convergence terminal, and obtain the target metering record in the metering data packet; Step S70: Calculate the target hash value of the target metering record, construct a target hash tree based on the target hash value, and use the root node of the target hash tree as the target verification value; Step S80: Compare the verification value with the target verification value, and when the verification value and the target verification value do not match, obtain leaf node information in the blockchain network; Step S90: Compare the target leaf node and the leaf node information of the target hash tree, and generate a supplementary entry request based on the comparison result; Step S100: Send the supplementary recording request to the substation convergence terminal, and receive the supplementary metering data fed back by the substation convergence terminal.

7. The method as described in claim 6, characterized in that, Step S90 further includes: Generate a blockchain query request based on the time range of the target measurement record; The query request is sent to the blockchain network to obtain the hash values ​​of all leaf nodes within the corresponding time interval; Verify the consistency of the chain of the leaf node hash value. If the verification passes, use it as the leaf node information.

8. The method as described in claim 6 or 7, characterized in that, Following step S100, the method further includes: In the response message sent by the integrated terminal of the distribution area, the supplementary metering data is obtained, and the supplementary metering data is updated to the target metering record; Based on the updated target metering record, the target hash tree is recalculated to obtain the first verification value; Calculate the second verification value based on the leaf node information obtained in the blockchain network; The first check value is compared with the second check value. If the comparison result is consistent, the supplementary recording action is completed.

9. An edge computing-based electricity reconciliation device, characterized in that, include: A memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the edge computing-based electricity reconciliation method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the edge computing-based electricity reconciliation method as described in any one of claims 1 to 8.