A battery swap station monitoring method and system based on the internet of things

By using the SHA-256 algorithm and blockchain system in battery swapping stations for power data error detection and accountability, and combining the Dijkstra algorithm and XGBoost model to optimize power paths and allocation, the reliability and scheduling optimization problems of power data processing in battery swapping stations are solved, achieving efficient power resource management and accountability.

CN120834645BActive Publication Date: 2026-02-10STATE GRID ELECTRIC VEHICLE SERVICE HUBEI CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511324089.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2026-02-10
Estimated Expiration
2045-09-17

AI Technical Summary

Technical Problem

Existing power data processing at battery swapping stations suffers from insufficient authenticity verification and error detection, lacks a dynamic and adjustable encryption mechanism, and fails to optimize path planning and energy dispatch in real time by incorporating multiple factors. This results in uneven resource allocation, low power flow efficiency, and a lack of a clear accountability mechanism, making it difficult to trace responsibility when the system malfunctions.

Method used

The SHA-256 algorithm is used to generate power data blocks. A blockchain system based on a threshold-editable hash function is constructed for error detection and accountability. The Dijkstra algorithm is used to calculate the optimal power path. An XGBoost prediction model is constructed to predict the load, adjust the power distribution strategy, and classify and make decisions on abnormal results through multi-dimensional features.

Benefits of technology

It improves the reliability of power data and the ability to detect anomalies, enhances the accuracy of load forecasting and the intelligence of power distribution, strengthens the precision and traceability of the monitoring system, and ensures the high reliability and security of the system under abnormal conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120834645B_ABST
    Figure CN120834645B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on Internet of Things battery swap station monitoring method and system, it is related to electric power dispatching optimization and intelligent energy management technical field, collection electric power data and pre-processing, set up node, extract electric power feature, generate electric power data block using SHA-256 algorithm, carry out electric power data error detection, construct the block chain system based on threshold editable hash function, carry out editing log record and responsibility tracking;Build road network diagram, calculate the dynamic weight of each edge of road network diagram, calculate optimal electric power path using Dijkstra algorithm, with MILP model as optimization target, define three-layer constraint condition, build XGBoost prediction model to predict the load of battery swap station, adjust electric power distribution strategy, by using improved SHA-256 algorithm and constructing the block chain system based on threshold editable hash function, improve the security of electric power data, by combining road network diagram to calculate dynamic weight, using Dijkstra algorithm and adjusting electric power distribution strategy, enhance the intelligentization of monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power dispatch optimization and intelligent energy management technology, and in particular to a method and system for monitoring battery swapping stations based on the Internet of Things. Background Technology

[0002] With the popularization of new energy vehicles and the rapid development of electric travel, battery swapping stations have shown unique advantages over traditional charging stations in terms of energy replenishment efficiency, service frequency and battery management. In recent years, with the help of Internet of Things (IoT) technology, the intelligence and networking level of battery swapping stations have been continuously improved. Although the relevant systems have made some progress, there are still obvious shortcomings in the accuracy of power data processing, transmission security and dispatch response efficiency. Especially in multi-site and high-traffic scenarios, issues such as data reliability, inter-node communication coordination and power distribution strategies urgently require more systematic solutions.

[0003] Currently, the verification of the authenticity and error detection of power data largely rely on traditional hash verification methods, lacking dynamic and adjustable encryption mechanisms. This results in limited responsiveness to illegal tampering and system anomalies. At the level of route planning and energy dispatch, static rules still dominate, failing to fully integrate factors such as traffic conditions and power plant load dynamics for real-time optimization. This leads to uneven resource allocation or low power flow efficiency. Furthermore, there is a lack of clear records and traceability mechanisms for attributing responsibility for power incidents, making it difficult to trace accountability once system anomalies or data conflicts occur. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an IoT-based method for monitoring power swapping stations to address the issues of verifying the authenticity of power data and detecting errors. However, current methods rely heavily on traditional hash verification, lacking a dynamically adjustable encryption mechanism and having limited responsiveness to illegal tampering and system anomalies. Furthermore, at the path planning and energy scheduling levels, static rules are still dominant, failing to fully integrate factors such as traffic conditions and power station load dynamics for real-time optimization. This leads to uneven resource allocation or low power flow efficiency. Additionally, the lack of clear records and traceability mechanisms for attributing responsibility for power incidents makes subsequent accountability difficult in the event of system anomalies or data conflicts.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for monitoring battery swapping stations based on the Internet of Things, comprising,

[0008] Collect and preprocess power data, establish nodes, extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record edit logs and track accountability.

[0009] Construct a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy.

[0010] Generate multidimensional features, classify abnormal results, and make decisions based on the abnormal classification results;

[0011] Build a visual interface to display the generated data from the analysis.

[0012] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the steps of collecting power data, establishing nodes, extracting power features, generating power data blocks, performing power data error detection, constructing a blockchain system based on a threshold-editable hash function, and recording edit logs and tracing accountability include:

[0013] The power data includes battery power, battery remaining SOC, power load data of the battery swapping station, and the location coordinates of the electric vehicle.

[0014] Three nodes are set up, including an edge computing node, an authorized node, and a consensus node;

[0015] Based on the preprocessed power data, the battery health status (SOH) of each vehicle is calculated, the distance from the vehicle to the battery swapping station is calculated using the Havesing formula, and the load rate of the battery swapping station is calculated using the ratio method.

[0016] The current power of each vehicle's battery The data, including vehicle health status (SOH), distance from each vehicle to the battery swapping station, and station load rate, are processed into a JSON serialization set to generate a feature set. , feature set Preprocessed power data, hash value and current timestamp Perform byte-level concatenation operations to generate data for the blocks to be hashed. The SHA-256 algorithm is used to calculate the block hash value, and the generated 256-bit hash value is... Hash value and current timestamp Perform byte-level concatenation to generate a block header, and then combine the block header with the data of the block to be hashed. Pack it into a new block and broadcast it to the authorized nodes in the Hyperledger Fabric network. Use PBFT consensus to verify it. If the verification is successful, send an acknowledgment message; otherwise, record the failure log and retry.

[0017] The battery swapping station management node extracts a feature set from the new blocks it receives. Data is collected in real time from the battery swapping station, and consistency is verified using an anomaly detection formula. Based on the verification results, if... The new block is marked as an abnormal block, an error report is generated, which includes abnormal parameters, timestamp and block ID, and the error report is broadcast to the battery swapping station management node and power grid control center in the blockchain network;

[0018] An updated feature set is generated from the node containing the abnormal block. and make a creation / editing request. The Elliptic Curve Digital Signature Algorithm (ECDSA) is used to generate the signature of the initiating node. ,Will and The data is packaged and broadcast to authorized nodes in the Hyperledger Fabric network. The channel manager in the Hyperledger Fabric network then parses the data. Confirm the set of nodes participating in the verification. Construct a blockchain system based on a threshold-editable hash function and calculate the signature verification threshold. Each node participating in the verification receives the packaged data. and The signature of the initiating node is verified using the initiating node's ECDSA public key. Nodes that pass the verification are selected, and each node generates its own signature, resulting in a signature set. The initiating node verifies the threshold through signature verification. Verification is performed if the number of signatures in the signature set is greater than or equal to the signature verification threshold. The block hash is calculated using the SHA-256 algorithm. If the number of signatures in the signature set is not greater than or equal to the signature verification threshold... The editing process is terminated.

[0019] Will , , and signature set Generate edit blocks, and peer nodes extract information from the edit blocks. , , and signature set The system generates edit logs and stores them in a separate log chain on the blockchain (in parallel with the main data chain), using PBFT consensus for confirmation.

[0020] like Peer nodes extract information about new blocks, generate edit logs, and store them in a separate log chain of the blockchain (in parallel with the main data chain), which is then confirmed using PBFT consensus.

[0021] Edit blocks, new blocks, and edit logs are used to generate a trusted blockchain dataset.

[0022] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the following steps are included: constructing a road network map, calculating the dynamic weight of each edge of the road network map, using the Dijkstra algorithm to calculate the optimal power path, defining three layers of constraints with the MILP model as the optimization objective, constructing an XGBoost prediction model to predict the load of the battery swapping station, and adjusting the power distribution strategy.

[0023] Extract the remaining battery power and current location coordinates of each electric vehicle, use a fixed threshold filtering method to filter out the vehicles that need battery swapping, and generate a list of vehicles that need battery swapping, their corresponding current location coordinates and remaining battery power.

[0024] Collect urban road data, generate a digital elevation model (DEM), treat intersections as graph nodes, battery swapping stations as special nodes, and roads as edges to construct a road network graph. The algorithm calculates the power consumption weight for each edge, matches the nearest intersection based on the list of vehicles requiring battery swapping using Euclidean distance, determines the starting node of the vehicle in the road network graph, obtains real-time traffic data through real-time traffic data service, calculates the travel time of each road based on the accident status, calculates the dynamic weight of each edge of the road network graph, sets the objective function with the goal of minimizing the comprehensive weight, uses Dijkstra's algorithm to traverse the road network graph to find the optimal path of the objective function, selects the battery swapping station with the minimum power consumption, outputs the optimal path from each vehicle to the battery swapping station, and verifies it using power constraints.

[0025] Define the minimum total power cost of a battery swapping station The MILP model is used as the optimization objective. Power capacity constraints, battery swapping time constraints, and the constraint that each vehicle can only swap batteries once are defined. The MILP model is solved using CPLEX optimization. The optimal battery swapping time and the number of the assigned battery swapping station equipment for each vehicle are output as a scheduling plan and uploaded to the blockchain system to generate a scheduling record block. If the scheduling plan is adjusted (e.g., due to equipment failure), the blockchain system based on a threshold editable hash function is activated to verify it and output the verified scheduling plan.

[0026] To construct an XGBoost prediction model, the load rate of historical battery swapping stations is collected, preprocessed, and then decomposed using STL. This data is used as the input to train the XGBoost prediction model, and the trained XGBoost prediction model is output.

[0027] Based on the validated scheduling plan, the standardized load of the battery swapping station is decomposed using STL and input into the trained XGBoost prediction model for prediction. All predicted battery swapping station loads are denormalized to generate a predicted load sequence, which is then encapsulated as an MQTT message and published to the smart grid control center via the MQTT protocol. The grid control center adjusts the power distribution strategy according to the predicted load sequence.

[0028] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the step of generating multi-dimensional features and classifying abnormal results includes:

[0029] The real-time load rate of the battery swapping station, battery power, power distribution, and predicted load are combined into a multi-dimensional feature, and the Z-score of the multi-dimensional feature is calculated. ;

[0030] Thresholds were set for working hours, evening rush hour, and nighttime based on historical regression estimation.

[0031] If any feature The issue was identified as an anomaly at the battery swapping station, and the anomaly was categorized accordingly.

[0032] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the step of making decisions based on anomaly classification results includes:

[0033] Based on the anomaly classification results, the following actions are performed: issuing real-time alerts, sending user notifications, switching to a backup battery swapping station, restricting local high-power devices, requesting additional power from the power grid, isolating faulty devices at the battery swapping station, notifying the maintenance team, and adjusting the prediction model parameters.

[0034] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the preprocessing of power data includes:

[0035] The preprocessing includes checking the integrity of the collected power data based on time series, filling missing values ​​using time series interpolation, detecting and deleting outliers using time series analysis, aligning the power data by timestamp, and performing standardization processing.

[0036] As a preferred embodiment of the IoT-based battery swapping station monitoring method of the present invention, the step of constructing a visual interface to display and analyze the generated data includes:

[0037] The generated power data is processed into JSON format, and a web-based interface is created using the Plotly Dash framework to display the generated power data.

[0038] Users access the visual interface through a browser, which supports authentication.

[0039] Secondly, the present invention provides an Internet of Things (IoT)-based monitoring system for battery swapping stations, comprising:

[0040] The data collection and preprocessing module is used to collect and preprocess power data;

[0041] The extraction and editing module is used to extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record editing logs and track accountability.

[0042] A calculation module is constructed to build a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy.

[0043] The classification generation module is used to generate multidimensional features, classify abnormal results, and make decisions based on the abnormal classification results.

[0044] The visualization module is used to build a visual interface to display the data generated by the analysis.

[0045] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the Internet of Things-based battery swapping station monitoring method described in the first aspect of the present invention.

[0046] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the Internet of Things-based battery swapping station monitoring method as described in the first aspect of the present invention.

[0047] The beneficial effects of this invention are as follows: By collecting and preprocessing power data, establishing nodes, extracting power features, generating power data blocks using the SHA-256 algorithm, detecting power data errors, constructing a blockchain system based on a threshold-editable hash function, and recording edit logs and tracking responsibility; constructing a road network map, calculating the dynamic weight of each edge of the road network map, calculating the optimal power path using the Dijkstra algorithm, defining three layers of constraints with the MILP model as the optimization objective, constructing an XGBoost prediction model to predict the load of the battery swapping station, and adjusting the power allocation strategy; generating multi-dimensional features, classifying abnormal results, and making decisions based on the abnormal classification results, this invention improves the anomaly detection and decision-making capabilities, increases the accuracy of battery swapping station load prediction, and enhances the intelligence and accuracy of the monitoring system. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a flowchart of the IoT-based battery swapping station monitoring method in Example 1.

[0050] Figure 2 This is a schematic diagram of the IoT-based battery swapping station monitoring system in Example 1.

[0051] Figure 3 This is a flowchart of the blockchain data processing and editing process in Example 1.

[0052] Figure 4 This is a flowchart of the battery swapping path optimization and scheduling process based on real-time traffic and dynamic road network weights in Example 1. Detailed Implementation

[0053] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0054] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0055] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0056] Example 1, referring to Figures 1 to 4 This is the first embodiment of the present invention, which provides a method for monitoring battery swapping stations based on the Internet of Things, including the following steps:

[0057] S1. Collect and preprocess power data, set up nodes, extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record edit logs and track responsibilities.

[0058] Specifically, the power data includes battery power, battery remaining SOC, power load data of the battery swapping station, and the location coordinates of the electric vehicle;

[0059] The preprocessing includes checking the integrity of the collected power data based on time series, filling missing values ​​using time series interpolation, detecting and deleting outliers using time series analysis, aligning the power data by timestamp, and performing standardization processing.

[0060] Establish edge computing nodes, authorized nodes, and consensus nodes;

[0061] The edge computing node refers to the local computing device deployed in the battery swapping station, which is responsible for receiving IoT sensor data, performing feature extraction, initiating block generation, and error detection.

[0062] The authorized nodes mentioned above are operated by the battery swapping station management center and the power grid control center in the blockchain network, and are responsible for verifying the edit request and providing ECDSA signatures;

[0063] The consensus node refers to the node that runs the PBFT (Practical Byzantine Fault Tolerance) consensus algorithm, which is responsible for maintaining the consistency of the distributed ledger and storing blocks and logs;

[0064] Based on the preprocessed power data, the battery health status (SOH) of each vehicle is calculated using the following formula:

[0065] ,

[0066] in, This represents the battery's current power. and The maximum and minimum power of the battery are determined by the battery specifications. and These are the battery's current charge level and optimal charge level, respectively. The coefficient representing the influence of electrical charge is obtained through experimental calibration and reflects the effect of SOC deviation on SOH.

[0067] Based on the preprocessed power data, the distance from the vehicle to the battery swapping station is calculated using the Havesing formula, and the load factor of the battery swapping station is calculated using the ratio method.

[0068] The current power of each vehicle's battery The data, including vehicle health status (SOH), distance from each vehicle to the battery swapping station, and station load rate, are processed into a JSON serialization set to generate a feature set. ;

[0069] Retrieve the hash of the previous block from the Hyperledger Fabric ledger. , feature set Preprocessed power data, hash value and current timestamp Perform byte-level concatenation operations to generate data for the blocks to be hashed. ;

[0070] The block hash value is calculated using the SHA-256 algorithm, as follows:

[0071] ,

[0072] in, For the generated 256-bit hash value, It uses the SHA-256 algorithm;

[0073] A 256-bit length strikes a balance between security, computational efficiency, and storage requirements, making it suitable for high-frequency power data blockchain storage; therefore, 256 bits are used here.

[0074] The generated 256-bit hash value Hash value and current timestamp Perform byte-level concatenation operations to generate block headers;

[0075] Block header and data of the block to be hashed Pack it into a new block and broadcast it to the authorized nodes (swapping station management nodes and power grid control center) in the Hyperledger Fabric network. Use PBFT consensus to verify it. If the verification is consistent, send an confirmation message; otherwise, record the failure log and retry.

[0076] The battery swapping station management node extracts a feature set from the new blocks it receives. The data is collected in real time from the battery swapping station, and consistency is verified using an anomaly detection formula, as follows:

[0077] ,

[0078] in, and These are the real-time collected battery power and load rate, respectively. For the battery load rate in the new block, and These are the tolerance thresholds for power and load rate, respectively (set by the accuracy of the sensor collecting the data).

[0079] like The new block is marked as an abnormal block, an error report is generated, which includes abnormal parameters, timestamp and block ID, and the error report is broadcast to the battery swapping station management node and power grid control center in the blockchain network;

[0080] An updated feature set is generated from the node containing the abnormal block. (Including corrected abnormal parameters), and make a creation / editing request. The formula is as follows:

[0081] ,

[0082] in, The node ID that initiated the edit. To edit the request timestamp, This is the original feature set (a set containing outlier parameters). The ID of the abnormal block;

[0083] The signature of the initiating node is generated using the Elliptic Curve Digital Signature Algorithm (ECDSA). The formula is as follows:

[0084] ,

[0085] in, for The hash value is calculated using the improved SHA-256. The ECDSA private key of the initiating node. ECDSA signature function (based on the secp256k1 curve);

[0086] Will and The data is packaged and broadcast to authorized nodes in the Hyperledger Fabric network. The channel manager in the Hyperledger Fabric network then parses the data. Confirm the set of nodes participating in the verification. Construct a blockchain system based on a threshold-editable hash function, including calculating the signature verification threshold. The formula is as follows:

[0087] ,

[0088] in, The authorized ratio is calculated based on the PBFT fault tolerance formula to ensure tolerance. Node failures: Balancing security and efficiency;

[0089] Each node participating in the verification receives the packaged data. and The signature of the initiating node is verified using the initiating node's ECDSA public key. Nodes that pass the verification are selected, and each node generates its own signature, resulting in a signature set. ;

[0090] Based on the signature set, the initiating node verifies the threshold through signature verification. Verification is performed if the number of signatures in the signature set is greater than or equal to the signature verification threshold. The block hash is calculated using the SHA-256 algorithm. The formula is as follows:

[0091] ,

[0092] in, For the edit timestamp of the signature set;

[0093] If the number of signatures in the signature set is greater than or equal to the signature verification threshold... The editing process is terminated.

[0094] Will , , and signature set Generate edit blocks, and peer nodes extract information from the edit blocks. , , and signature set The system generates edit logs and stores them in a separate log chain on the blockchain (in parallel with the main data chain), using PBFT consensus for confirmation.

[0095] like Peer nodes extract information about new blocks, generate edit logs, and store them in a separate log chain of the blockchain (in parallel with the main data chain), which is then confirmed using PBFT consensus.

[0096] Edit blocks, new blocks, and edit logs are used to generate a trusted blockchain dataset.

[0097] By calculating the State of Health (SOH), a SOH health model based on the combined influence of power and State of Charge (SOC) is introduced to quantify the deviation between the current state of the battery and its theoretical optimal state, enabling dynamic evaluation of battery life and performance. The Havesing formula is used to calculate the spatial distance between the vehicle and the battery swapping station, and combined with load ratio calculations, to achieve accurate estimation of battery swapping resource distribution and current service pressure. By splicing feature sets with the hash value of the previous block and using an improved SHA-256 algorithm to calculate the block hash value, low-energy, lightweight data encryption storage is achieved. The hash value, timestamp, and original data structure are integrated to construct the block header, and broadcasting and verification among multiple nodes are completed using the PBFT consensus protocol, realizing distributed storage of trusted power data. By performing difference detection with real-time data, abnormal blocks are identified based on a preset threshold formula, and error reports are generated, achieving system-level anomaly localization. An abnormal node initiates an edit request, and its identity is verified through the ECDSA signature mechanism, enabling secure revision of abnormal blocks. By setting a signature verification threshold and having multiple nodes collaboratively sign for confirmation, a distributed permission verification mechanism is implemented. This mechanism is based on PBFT theory, tolerates the failure of 1 / 3 of the nodes, and ensures that the system maintains high reliability and service continuity even in non-ideal network environments. It generates dedicated editing blocks for editing operations and stores them separately in an independent log chain, thereby decoupling the operation trajectory from the main data chain.

[0098] S2. Construct a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy.

[0099] Specifically, the remaining battery power and current location coordinates of each electric vehicle are extracted from the trusted blockchain dataset. An empirical method is used to set the battery swapping threshold, and a fixed threshold filtering method is used to filter out the vehicles that need battery swapping. The vehicles that need battery swapping, their corresponding current location coordinates, and remaining battery power are then used to generate a list of vehicles that need battery swapping.

[0100] Collect urban road data, generate a digital elevation model (DEM), treat intersections as graph nodes, battery swapping stations as special nodes, and roads as edges to construct a road network graph. The power consumption weight is calculated for each edge using the following formula:

[0101] ,

[0102] For graph nodes To graph nodes electricity consumption, For graph nodes To graph nodes Road distance (unit: km) For vehicle energy efficiency, settings are based on vehicle model. The slope impact factor is set by the vehicle manufacturer's energy efficiency report. The road slope factor (dimensionless, 0 for flat roads, positive for uphill, and negative for downhill, obtained from terrain data). and These are the elevations of map node i and map node j (unit: m, obtained from DEM data), where map node i and map node j are two adjacent nodes on the road network map.

[0103] Based on the list of vehicles requiring battery swapping, the nearest intersection is matched using Euclidean distance to determine the starting node of the vehicles in the road network map. Real-time traffic data is obtained through real-time traffic data services, and the travel time for each road is calculated based on the accident status, using the following formula:

[0104] ,

[0105] in, For graph nodes To graph nodes The adjusted travel time This refers to the travel time under unobstructed conditions. The average speed of the vehicle. For graph nodes To graph nodes The accident status (existence and non-existence). The accident impact coefficient is determined by the severity of the traffic accident.

[0106] Based on the adjusted travel time for each road, the dynamic weight of each edge in the road network map is calculated using the following formula:

[0107] ,

[0108] in, For graph nodes To graph nodes Dynamic edge weights (unit: kWh, combining electricity and time costs). This is the time-to-electricity conversion factor, set using a fixed value method, typically 0.1. This refers to the vehicle's average power consumption.

[0109] The objective function is set to minimize the overall weight. The formula is as follows:

[0110] ,

[0111] in, A specific path from the starting node to the target battery swapping station node consists of a series of graph nodes. To graph nodes The edges form the composition;

[0112] Dijkstra's algorithm is used to traverse the road network graph to find the objective function. The optimal path is determined by selecting the battery swapping station with the lowest power consumption. The optimal path from each vehicle to the swapping station is output and verified using power constraints. The formula is as follows:

[0113] ,

[0114] in, The total power consumption of the route. The amount of electricity that the vehicle's remaining battery power can support;

[0115] like Remove the current battery swapping station from the candidate stations, recalculate using the Dijkstra algorithm, and if all battery swapping stations fail to meet the constraints, mark the vehicle as "requiring assistance" and generate an early warning log (including vehicle ID and location).

[0116] The optimal route, target battery swapping station, and estimated arrival time for each vehicle are JSON-formatted and uploaded to a blockchain system based on a threshold-editable hash function. An initial route block is generated, and the hash value is calculated. If the route data needs to be corrected (e.g., the target battery swapping station is incorrect), the editable process is initiated to edit the data and output the updated route blockchain dataset.

[0117] Define the minimum total power cost of a battery swapping station The MILP model is the optimization objective, and the formula is as follows:

[0118] ,

[0119] in, For the first The electricity cost of the vehicle, For battery swapping time, For electricity price, For the first The waiting cost of a vehicle The cost per unit of time is based on vehicle type (e.g., the cost of a taxi being out of service per minute, estimated from operational data). For the first The waiting time for the vehicle This refers to the time when vehicle b begins battery swapping. Let be the estimated arrival time of vehicle b. For the first Benefits from reduced carbon emissions from vehicles The green electricity ratio is obtained by querying the power grid energy structure database, reflecting the proportion of renewable energy (such as wind and solar power) used by the battery swapping station. For the first The distance of the optimal path from the vehicle to the battery swapping station. The carbon emission benefit per unit distance is set by the average carbon price provided by the environmental protection department. This represents the total number of electric vehicles;

[0120] The power capacity constraint is defined by the following formula:

[0121] ,

[0122] in, For the available power capacity of the battery swapping station, This is the maximum load capacity of the battery swapping station. This represents the current load rate of the battery swapping station. For binary variables, 1 represents the first... The car in time Battery swapping; 0 indicates no battery swapping. For scheduling time windows;

[0123] Define the battery swapping time constraint as follows:

[0124] ,

[0125] Define the constraint that each vehicle can only have its battery swapped once, as shown in the following formula:

[0126] ,

[0127] The MILP model is solved using CPLEX optimization, and the optimal battery swapping time and the number of the assigned battery swapping station equipment for each vehicle are output as a scheduling plan. This plan is then uploaded to the blockchain system to generate a scheduling record block. If the scheduling plan is adjusted (e.g., due to equipment failure), the blockchain system based on a threshold-editable hash function is activated to verify the plan and output the verified scheduling plan.

[0128] An XGBoost prediction model is constructed by collecting and preprocessing the load rate data of historical battery swapping stations, and then using STL to decompose the data into long-term trend (reflecting changes in the load baseline), seasonal components (capturing daily cycles, such as after-work peak hours), and random residuals (reflecting noise or sudden events) time series data as input to the XGBoost prediction model. The XGBoost prediction model is then trained and the trained XGBoost prediction model is output.

[0129] Based on the validated scheduling plan, the standardized load of the battery swapping stations is decomposed using STL into long-term trend, seasonal components, and random residual time-series data. This data is then input into a trained XGBoost prediction model for prediction. All predicted battery swapping station loads are denormalized to generate a predicted load sequence, which is then encapsulated as an MQTT message and published to the smart grid control center via the MQTT protocol. The grid control center adjusts its power allocation strategy based on the predicted load sequence, as shown in the following formula:

[0130] ,

[0131] ,

[0132] in, The power allocated by the power grid to the z-th battery swapping station. The total available power of the power grid, To assign weights, , and The z-th battery swapping station is located at time point. Predict the upper and lower limits of the load and their values ​​at that point in time. For small constants, numerical stability techniques are used to set them. Let z be the maximum load that the z-th battery swapping station can withstand. To represent the sum of the weights allocated to all M battery swapping stations, a normalization method is used to ensure that the total allocated power does not exceed [a certain value]. , This is the index for traversing all battery swapping stations.

[0133] By collecting urban road data, constructing a road network map, and calculating the power consumption weight for each edge, the system can consider actual road conditions, such as slope and traffic conditions, when planning the optimal route for each vehicle based on the road network map. This further improves battery swapping efficiency. By acquiring traffic conditions and calculating travel time based on real-time traffic data services, the road weights in the road network map can be adjusted in real time according to traffic conditions, improving the driving efficiency of battery swapping vehicles and shortening battery swapping time. The optimal route is found using the Dijkstra algorithm, and the power consumption of the route is calculated and verified to ensure that the battery swapping route for each vehicle is optimized in terms of power consumption, while ensuring that the vehicle can reach the battery swapping station smoothly. By optimizing the optimal route for each vehicle and the destination... Information such as the designated battery swapping station and estimated arrival time is uploaded to the blockchain system for verification. An editable process is initiated to make necessary corrections, ensuring the accuracy and traceability of the route data. By defining a MILP model, the power cost of the battery swapping station is minimized. Combined with factors such as electricity price, carbon emissions, and battery swapping time, the battery swapping time and resource allocation are optimized. This not only improves the operating cost-effectiveness of the battery swapping station but also aligns with green development goals. By constructing an XGBoost forecasting model, load forecasting is performed and data support is provided for grid control, improving the accuracy of load forecasting, optimizing power allocation strategies, ensuring grid load balance, improving the operating efficiency of the battery swapping station, and realizing dynamic coordination between the grid and the battery swapping station.

[0134] S3. Generate multi-dimensional features, classify abnormal results, and make decisions based on the abnormal classification results;

[0135] Specifically, the real-time load rate, battery power, power distribution, and predicted load of the battery swapping station are combined into multi-dimensional features, and the Z-score of the multi-dimensional features is calculated. ;

[0136] Thresholds for working hours, rush hour, and nighttime are set based on historical regression estimation, as follows:

[0137] ,

[0138] in, , and These are the thresholds for working hours, rush hour, and nighttime, respectively. For the first Threshold for a multidimensional feature at time t;

[0139] If any feature The issue was determined to be an anomaly at the battery swapping station, and the anomaly results were categorized as follows:

[0140] like If so, the overall power system of the battery swapping station is determined to be overloaded;

[0141] like and If so, it is determined that the power supply system of the battery swapping station is insufficient;

[0142] like and If so, the battery swapping station equipment is determined to be faulty. and Let be the standard deviation and mean of the current battery power of vehicle b at time t, respectively.

[0143] like If the load prediction system of the battery swapping station is found to have a prediction error, then the prediction error is determined. The prediction error of the trained XGBoost prediction model is obtained by subtracting the actual load of the battery swapping station from the predicted load of the battery swapping station.

[0144] By combining multiple key parameters such as real-time load rate, battery power, power distribution, and predicted load of the battery swapping station into multi-dimensional features, the system can comprehensively consider the correlation and mutual influence between different variables. If the Z score of any feature exceeds the threshold, it is determined that the battery swapping station is abnormal. The abnormal results are classified, realizing the automation and accuracy of abnormality detection. This can effectively reduce the error and lag of manual monitoring, improve the timeliness and accuracy of power system fault response, and ensure the stable operation of the battery swapping station.

[0145] Furthermore, based on the anomaly classification results, if the overall power system of the battery swapping station is overloaded, an alarm is issued to the battery swapping station management system and operation and maintenance team using MQTT, high-power equipment is suspended, and the future predicted load is extracted from the predicted load data to select the battery swapping station with the lowest load as a backup battery swapping station. At the same time, a path update request is issued using the MQTT protocol to guide vehicles to the low-load station.

[0146] The alarm includes information such as the overload status of the battery swapping station ID and the load rate. Please check immediately.

[0147] If the power supply system of the battery swapping station is insufficient, high-power equipment will be suspended, and a power supply increase request will be sent to the power grid control center using the MQTT protocol. The power grid response will be monitored closely.

[0148] If the equipment at the battery swapping station malfunctions, the ID of the malfunctioning equipment is extracted from the blockchain dataset, control commands are sent using the MQTT protocol to shut down the malfunctioning equipment, and the maintenance team is notified to repair it immediately.

[0149] If the load prediction system of the battery swapping station has a prediction error, the reduction method is used to lower the learning rate of the trained XGBoost prediction model, and the trained XGBoost prediction model is updated using the reduced learning rate.

[0150] By identifying overload states in the battery swapping station system through anomaly classification models, the risk of system failures or service interruptions caused by excessive load is effectively reduced. This improves the flexibility of system scheduling and the user's battery swapping experience, and ensures the operational safety of the power grid and equipment. When the power supply to the battery swapping station is insufficient, high-power equipment is suspended, and an additional allocation request is sent to the power grid control center using the MQTT protocol. This enables adaptive energy-saving control of high-power equipment, preventing large-scale power outages or equipment damage due to insufficient power supply, and improving the real-time performance and system resilience of power supply scheduling. When a battery swapping station experiences equipment failure, the faulty equipment ID is extracted from the blockchain dataset, and an instruction to shut down the equipment and notify the maintenance team is sent via MQTT. This improves the transparency and response speed of the system in fault handling, preventing the continued operation of faulty equipment from causing more serious damage. Simultaneously, the authenticity and compliance of the operation and maintenance process are ensured. By reducing the learning rate of the XGBoost prediction model based on the prediction deviation of the battery swapping station's load prediction system, a reduction method is used for updates. Without affecting the system's real-time performance, the learning rate is dynamically adjusted to fine-tune the existing XGBoost model, rather than retraining it entirely, maintaining the model's learning ability and prediction accuracy, and improving the predictive system's adaptive and continuous optimization capabilities.

[0151] S4. Build a visual interface to display the data generated from the analysis;

[0152] Specifically, the generated power data is processed into JSON format, and a web-based interface is created using the Plotly Dash framework. The load and predicted load of the battery swapping station are displayed in a time series graph, the power grid distribution and the load rate of the battery swapping station are displayed in a bar chart, the anomaly classification results and corresponding countermeasures are displayed in a stacked bar chart, and the vehicle ID, battery swapping time, battery swapping station ID and device ID are displayed in a table.

[0153] Users access the visual interface through a browser, which supports authentication.

[0154] By using the Plotly Dash framework to create a web-based interface, the system achieves visualization and user interaction. Time series graphs are used to display the load and predicted load of the battery swapping station, enabling dynamic monitoring and trend analysis of the station's operation. Bar charts are used to display the power grid's power allocation and the load rate of the battery swapping station, providing an intuitive presentation and comparative analysis of power allocation. Stacked bar charts are used to display anomaly classification results and corresponding countermeasures, enabling comprehensive analysis and tracking of abnormal system states. By displaying vehicle ID, battery swapping time, battery swapping station ID, and device ID in tabular form, accurate tracking and logging of the battery swapping process are achieved.

[0155] This embodiment also provides an Internet of Things (IoT) based battery swapping station monitoring system, including:

[0156] The data collection and preprocessing module is used to collect and preprocess power data;

[0157] The extraction and editing module is used to extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record editing logs and track accountability.

[0158] A calculation module is constructed to build a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy.

[0159] The classification generation module is used to generate multidimensional features, classify abnormal results, and make decisions based on the abnormal classification results.

[0160] The visualization module is used to build a visual interface to display the data generated by the analysis.

[0161] This embodiment also provides a computer device applicable to the Internet of Things (IoT) based battery swapping station monitoring method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the IoT-based battery swapping station monitoring method proposed in the above embodiment.

[0162] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0163] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the IoT-based battery swapping station monitoring method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0164] In summary, this invention improves anomaly detection and decision-making capabilities, increases the accuracy of load prediction for power swapping stations, and enhances the intelligence and precision of the monitoring system by: collecting and preprocessing power data, establishing nodes, extracting power features, generating power data blocks using the SHA-256 algorithm, detecting power data errors, constructing a blockchain system based on a threshold-editable hash function, recording edit logs, and tracking responsibility; constructing a road network map, calculating the dynamic weight of each edge of the road network map, using the Dijkstra algorithm to calculate the optimal power path, defining three layers of constraints with the MILP model as the optimization objective, constructing an XGBoost prediction model to predict the load of power swapping stations, and adjusting the power allocation strategy; generating multi-dimensional features, classifying abnormal results, and making decisions based on the anomaly classification results.

[0165] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for monitoring battery swapping stations based on the Internet of Things, characterized in that: include, Collect and preprocess power data, establish nodes, extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record edit logs and track accountability. Construct a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy, including extracting the remaining power and current location coordinates of each electric vehicle, using a fixed threshold filtering method to filter out vehicles that need battery swapping, and generating a list of vehicles that need battery swapping, their corresponding current location coordinates, and remaining power. Collect urban road data, generate a digital elevation model (DEM), treat intersections as graph nodes, battery swapping stations as special nodes, and roads as edges to construct a road network graph. The algorithm calculates the power consumption weight for each edge, matches the nearest intersection based on the list of vehicles requiring battery swapping using Euclidean distance, determines the starting node of the vehicle in the road network graph, obtains real-time traffic data through real-time traffic data service, calculates the travel time of each road based on the accident status, calculates the dynamic weight of each edge of the road network graph, sets the objective function with the goal of minimizing the comprehensive weight, uses Dijkstra's algorithm to traverse the road network graph to find the optimal path of the objective function, selects the battery swapping station with the minimum power consumption, outputs the optimal path from each vehicle to the battery swapping station, and verifies it using power constraints. Define the minimum total power cost of a battery swapping station The MILP model is used as the optimization objective. Power capacity constraints, battery swapping time constraints, and the constraint that each vehicle can only swap batteries once are defined. The MILP model is solved using CPLEX optimization. The optimal battery swapping time and the number of the assigned battery swapping station equipment for each vehicle are output as a scheduling plan and uploaded to the blockchain system to generate a scheduling record block. If the scheduling plan is adjusted, the blockchain system based on a threshold editable hash function is activated to verify it and output the verified scheduling plan. To construct an XGBoost prediction model, the load rate of historical battery swapping stations is collected, preprocessed, and then decomposed using STL. This data is used as the input to train the XGBoost prediction model, and the trained XGBoost prediction model is output. Based on the validated scheduling plan, the standardized load of the battery swapping station is decomposed using STL and input into the trained XGBoost prediction model for prediction. All predicted battery swapping station loads are denormalized to generate a predicted load sequence, which is then encapsulated as an MQTT message and published to the smart grid control center via the MQTT protocol. The grid control center adjusts the power distribution strategy according to the predicted load sequence. Generate multidimensional features, classify abnormal results, and make decisions based on the abnormal classification results; Build a visual interface to display the generated data from the analysis.

2. The IoT-based battery swapping station monitoring method as described in claim 1, characterized in that: The process of collecting power data, establishing nodes, extracting power features, generating power data blocks, detecting power data errors, constructing a blockchain system based on a threshold-editable hash function, and recording edit logs and tracking accountability includes: The power data includes battery power, battery remaining SOC, power load data of the battery swapping station, and the location coordinates of the electric vehicle. Three nodes are set up, including an edge computing node, an authorized node, and a consensus node; Based on the preprocessed power data, the battery health status (SOH) of each vehicle is calculated, the distance from the vehicle to the battery swapping station is calculated using the Havesing formula, and the load rate of the battery swapping station is calculated using the ratio method. The current power of each vehicle's battery The data, including vehicle health status (SOH), distance from each vehicle to the battery swapping station, and station load rate, are processed into a JSON serialization set to generate a feature set. , feature set Preprocessed power data, hash value and current timestamp Perform byte-level concatenation operations to generate data for the blocks to be hashed. The SHA-256 algorithm is used to calculate the block hash value, and the generated 256-bit hash value is... Hash value and current timestamp Perform byte-level concatenation to generate a block header, and then combine the block header with the data of the block to be hashed. Pack it into a new block and broadcast it to the authorized nodes in the Hyperledger Fabric network. Use PBFT consensus to verify it. If the verification is successful, send an acknowledgment message; otherwise, record the failure log and retry. The battery swapping station management node extracts a feature set from the new blocks it receives. Data is collected in real time from the battery swapping station, and consistency is verified using an anomaly detection formula. Based on the verification results, if... The new block is marked as an abnormal block, an error report is generated, which includes abnormal parameters, timestamp and block ID, and the error report is broadcast to the battery swapping station management node and power grid control center in the blockchain network; An updated feature set is generated from the node containing the abnormal block. and make a creation / editing request. The Elliptic Curve Digital Signature Algorithm (ECDSA) is used to generate the signature of the initiating node. ,Will and The data is packaged and broadcast to authorized nodes in the Hyperledger Fabric network. The channel manager in the Hyperledger Fabric network then parses the data. Confirm the set of nodes participating in the verification. Construct a blockchain system based on a threshold-editable hash function and calculate the signature verification threshold. Each node participating in the verification receives the packaged data. and The signature of the initiating node is verified using the initiating node's ECDSA public key. Nodes that pass the verification are selected, and each node generates its own signature, resulting in a signature set. The initiating node verifies the threshold through signature verification. Verification is performed if the number of signatures in the signature set is greater than or equal to the signature verification threshold. The block hash is calculated using the SHA-256 algorithm. If the number of signatures in the signature set is not greater than or equal to the signature verification threshold... The editing process is terminated. Will , The node that initiates the editing and signature set The process involves generating an edit block, with peer nodes extracting information from the edit block to generate an edit log, which is then stored in a separate log chain on the blockchain and confirmed using PBFT consensus. like Peer nodes extract information about new blocks, generate edit logs, and store them in a separate log chain of the blockchain, which is then confirmed using PBFT consensus. Edit blocks, new blocks, and edit logs are used to generate a trusted blockchain dataset.

3. The IoT-based battery swapping station monitoring method as described in claim 2, characterized in that: The generation of multidimensional features for anomaly result classification includes: The real-time load rate of the battery swapping station, battery power, power distribution, and predicted load are combined into a multi-dimensional feature, and the Z-score of the multi-dimensional feature is calculated. ; The For the time t, the first Z-scores for each feature; Thresholds were set for working hours, evening rush hour, and nighttime based on historical regression estimation. If any feature The issue was identified as an anomaly at the battery swapping station, and the anomaly was categorized accordingly. The For the time t, the first Thresholds for each feature.

4. The IoT-based battery swapping station monitoring method as described in claim 3, characterized in that: The decision-making based on the anomaly classification results includes: Based on the anomaly classification results, the following actions are performed: issuing real-time alerts, sending user notifications, switching to a backup battery swapping station, restricting local high-power devices, requesting additional power from the power grid, isolating faulty devices at the battery swapping station, notifying the maintenance team, and adjusting the prediction model parameters.

5. The IoT-based battery swapping station monitoring method as described in claim 4, characterized in that: The preprocessing of power data includes: The preprocessing includes checking the integrity of the collected power data based on time series, filling missing values ​​using time series interpolation, detecting and deleting outliers using time series analysis, aligning the power data by timestamp, and performing standardization processing.

6. The IoT-based battery swapping station monitoring method as described in claim 5, characterized in that: The process of constructing a visual interface to display and analyze the generated data includes: The generated power data is processed into JSON format, and a web-based interface is created using the Plotly Dash framework to display the generated power data. Users access the visual interface through a browser, which supports authentication.

7. A battery swapping station monitoring system based on the Internet of Things (IoT), based on the battery swapping station monitoring method based on the IoT as described in any one of claims 1 to 6, characterized in that: include, The data collection and preprocessing module is used to collect and preprocess power data; The extraction and editing module is used to extract power features, generate power data blocks using the SHA-256 algorithm, perform power data error detection, build a blockchain system based on a threshold-editable hash function, and record editing logs and track accountability. A calculation module is constructed to build a road network map, calculate the dynamic weight of each edge of the road network map, use the Dijkstra algorithm to calculate the optimal power path, use the MILP model as the optimization objective, define three layers of constraints, construct an XGBoost prediction model to predict the load of the battery swapping station, and adjust the power distribution strategy. The classification generation module is used to generate multidimensional features, classify abnormal results, and make decisions based on the abnormal classification results. The visualization module is used to build a visual interface to display the data generated by the analysis.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the IoT-based battery swapping station monitoring method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the IoT-based battery swapping station monitoring method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Internet of vehicles security evaluation system based on block chain

    CN117857220A

  • Variable screening time convolution-based battery swap station load prediction method and system

    CN118114813A