Electric vehicle charging state monitoring method, device, equipment and medium
By using federated learning and smart contract technology in a blockchain network and combining the deviation values of global and local prediction results, the accuracy and security issues of electric vehicle charging status monitoring are solved, achieving more efficient and secure charging status monitoring.
Patent Information
- Application Number
- CN202410702815.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In existing technologies, electric vehicle charging status monitoring models are incomplete and unreliable due to the diversity of vehicles and charging pile equipment, posing safety hazards.
Federated learning technology is used in the blockchain network to aggregate global model parameters by combining local model parameters trained locally on each node. The deviation between global and local prediction results is then used to determine the charging status of electric vehicles. Smart contracts and differential privacy technology are used to protect data privacy.
It enables more accurate charging status monitoring, reduces development costs, and improves the safety and reliability of the charging process through the traceability and security of blockchain.
Smart Images

Figure CN118689939B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of blockchain technology, specifically to a method, apparatus, device, and medium for monitoring the charging status of electric vehicles. Background Technology
[0002] With the increasing popularity of electric vehicles, the demand for monitoring and providing safety warnings for their charging status is growing. Monitoring charging status is crucial for ensuring battery performance, extending battery life, and improving charging efficiency. Furthermore, potential safety hazards during electric vehicle charging, such as overcharging, over-discharging, and abnormal temperatures, pose threats to the safety of the battery and the entire vehicle. Therefore, developing an effective method for monitoring charging status and providing safety warnings is essential for promoting the development of electric vehicle technology and ensuring user safety.
[0003] Traditional charging status monitoring methods typically use hardware devices such as sensors to acquire real-time data on the vehicle and battery. However, electric vehicle charging data is widely distributed, and vehicles from different manufacturers and equipment from different charging station operators often have different characteristics and usage patterns. Monitoring models trained on this basis tend to be incomplete and unreliable. Summary of the Invention
[0004] The purpose of this disclosure is to provide a method, apparatus, device, and medium for monitoring the charging status of electric vehicles, thereby improving the accuracy of electric vehicle charging status monitoring.
[0005] To achieve the above objectives, according to a first aspect of the present disclosure, a method for monitoring the charging status of an electric vehicle is provided, which is applied to any node in a blockchain network. The blockchain network stores global model parameters, which are obtained by aggregating local model parameters trained locally by each node in the blockchain network based on historical charging data. The electric vehicle charging status monitoring method includes: Obtain the charging data of the electric vehicle; Obtain the global model parameters from the blockchain network, and determine the target global model corresponding to the global model parameters; The charging data is input into a locally trained local model to obtain a local prediction result output by the local model, and the charging data is input into a target global model to obtain a global prediction result output by the target global model. The charging status of the electric vehicle is determined based on the magnitude of the deviation between the local prediction result and the global prediction result.
[0006] Optionally, the method further includes: Determine the standard deviation and mean absolute error between the local prediction results and the global prediction results; Determine the residual deviation value between the standard deviation and the mean absolute error, and use the residual deviation value as the deviation value between the local prediction result and the global prediction result; Determining the charging status of the electric vehicle based on the deviation between the local prediction result and the global prediction result includes: If the residual deviation value is greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0007] Optionally, there are multiple local prediction results and multiple global prediction results; for the multiple local prediction results and multiple global prediction results, there are multiple standard deviations and mean absolute errors calculated. Determining the residual deviation value between the standard deviation and the mean absolute error includes: Determine a first residual deviation value that characterizes the mean deviation between the plurality of said standard deviations and the plurality of said mean absolute errors; Based on the first residual deviation value, a second residual deviation value is determined to characterize the data distribution deviation between the plurality of standard deviations and the plurality of mean absolute errors; Determining the charging status of the electric vehicle based on the deviation between the local prediction result and the global prediction result includes: If both the first residual deviation value and the second residual deviation value are greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0008] Optionally, the global model parameters stored in the blockchain network are dense-state global model parameters. A first smart contract is deployed in the blockchain network. The first smart contract is used to obtain the target global model corresponding to the dense-state global model parameters. The dense-state global model parameters are obtained by densely aggregating privacy-preserving local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network. The step of obtaining the global model parameters from the blockchain network and determining the target global model corresponding to the global model parameters includes: The first smart contract is invoked to obtain the target global model corresponding to the encrypted global model parameters stored in the blockchain network. The target global model is obtained by decrypting the encrypted global model parameters and removing noise.
[0009] Optionally, the global model parameters stored in the blockchain network are dense global model parameters. The dense global model parameters are obtained by densely aggregating privacy local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network. A second smart contract is deployed in the blockchain network, and the second smart contract is used to perform dense aggregation of the privacy local model parameters. The method further includes: Obtain the historical charging data of the electric vehicle and the charging status tags corresponding to the historical charging data; Obtain the global model parameters from the blockchain network, and use the target global model corresponding to the global model parameters as the local model to be trained; The local model to be trained is iteratively trained based on the historical charging data and the charging status label, and the local model parameters of the local model to be trained are adjusted according to the results of each iteration until the training termination condition is met, and the trained local model is obtained. Noise is added to the local model parameters of the trained local model to obtain privacy local model parameters; The second smart contract is invoked to perform secret-state aggregation of the privacy local model parameters obtained locally and other privacy local model parameters trained by other nodes in the blockchain network to obtain secret-state global model parameters; The second smart contract is also used to store the dense global model parameters that have reached a consensus in the blockchain network on the blockchain.
[0010] Optionally, the local model to be trained includes a convolutional operation sub-model to be trained and a bidirectional recurrent gating unit sub-model to be trained. The step of iteratively training the local model to be trained based on the historical charging data and the charging status label, and adjusting the local model parameters of the local model to be trained based on the results of each iteration, until the training termination condition is met, to obtain the trained local model, includes: The historical charging data is standardized to obtain standard charging data; The standard charging data is input into the convolutional operation sub-model to be trained to obtain the intermediate feature vector output by the convolutional operation sub-model to be trained. The intermediate feature vector is input into the bidirectional cyclic gating unit sub-model to be trained, and the charging state prediction result output by the bidirectional cyclic gating unit sub-model to be trained is obtained. The loss value is calculated based on the charging state prediction result and the charging state label, and the convolution training parameters of the convolution operation sub-model to be trained and the gating training parameters of the bidirectional recurrent gating unit sub-model to be trained are adjusted based on the loss value. Return to the step of inputting the standard charging data into the convolutional sub-model to be trained to calculate the loss value, until the training termination condition is met, and obtain the local model that has been trained. The trained local model includes a trained convolutional operation sub-model and a trained bidirectional recurrent gated unit sub-model. The local model parameters of the trained local model include the convolutional training parameters of the trained convolutional operation sub-model and the gating training parameters of the trained bidirectional recurrent gated unit sub-model.
[0011] Optionally, before adding noise to the local model parameters of the trained local model, the method further includes: Obtain the weight pruning threshold from the blockchain network; The local training parameters of the trained local model are pruned according to the weight pruning threshold.
[0012] According to a second aspect of the present disclosure, an electric vehicle charging status monitoring device is provided, which is applied to any node in a blockchain network. The blockchain network stores global model parameters, which are obtained by aggregating local model parameters trained locally by each node in the blockchain network based on historical charging data. The electric vehicle charging status monitoring device includes: The first acquisition module is used to acquire the charging data of the electric vehicle; The second acquisition module is used to acquire the global model parameters from the blockchain network and determine the target global model corresponding to the global model parameters; The input module is used to input the charging data into a locally trained local model to obtain a local prediction result output by the local model, and to input the charging data into the target global model to obtain a global prediction result output by the target global model. The first determining module is used to determine the charging status of the electric vehicle based on the magnitude of the deviation between the local prediction result and the global prediction result.
[0013] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0014] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method described in any of the first aspects above.
[0015] The above technical solution uses federated learning technology to train a global model within a blockchain network. The parameters of this global model are aggregated from the local model parameters trained locally by each node in the blockchain network based on historical charging data, thus incorporating common features of various vehicle models and charging stations. Based on this, the charging data of electric vehicles is predicted using both the target global model (which integrates the parameters of the global model with various common features) and the local models trained locally by each node. Global and local prediction results are obtained separately, and the deviation between the two is used to comprehensively determine the charging status of the electric vehicle, ensuring the accuracy of monitoring.
[0016] In this way, there is no need to design separate models and collect data for various vehicle models and charging pile characteristics, which reduces development costs. Furthermore, a secure and robust global model can be trained based on the traceability and immutability of blockchain, thereby improving the accuracy of electric vehicle charging status monitoring while reducing development costs and providing effective support for the safety and reliability of the electric vehicle charging process.
[0017] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0018] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating an exemplary embodiment of the present disclosure of a method for monitoring the charging status of an electric vehicle.
[0019] Figure 2 This is a schematic diagram of a scenario illustrating an exemplary embodiment of the present disclosure of a method for monitoring the charging status of an electric vehicle.
[0020] Figure 3 This is a flowchart illustrating an exemplary embodiment of the present disclosure for determining the parameters of a dense-state global model.
[0021] Figure 4 This is a schematic diagram illustrating a local model to be trained, as shown in an exemplary embodiment of this disclosure.
[0022] Figure 5This is a schematic diagram of a bidirectional cyclic gating unit sub-model shown in an exemplary embodiment of the present disclosure.
[0023] Figure 6 This is a flowchart illustrating a method for monitoring the charging status of an electric vehicle, as shown in another exemplary embodiment of this disclosure.
[0024] Figure 7 This is a block diagram of an electric vehicle charging status monitoring device shown in an exemplary embodiment of the present disclosure.
[0025] Figure 8 This is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. Detailed Implementation
[0026] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0027] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.
[0028] Electric vehicle charging is a complex process. As mentioned in the background section, electric vehicle charging data is widely distributed, and vehicles from different manufacturers and equipment from different charging station operators often have different characteristics and usage patterns. Based on this, the monitoring models trained have problems of being incomplete and unreliable.
[0029] In view of this, this disclosure provides a method for monitoring the charging status of electric vehicles, which uses federated learning technology to train a global model in a blockchain network. Federated learning technology allows for centralized modeling using data from multiple charging station operators without sharing the original data. Through federated learning, a more comprehensive and accurate charging status monitoring model can be learned from aggregated data from multiple sources without disclosing specific user privacy information. Furthermore, federated learning technology can improve the robustness of the model, making it better adaptable to different types of electric vehicles and charging equipment.
[0030] Using federated learning in blockchain networks allows for the integration of datasets distributed across different participants to build more comprehensive and representative models, thus better adapting to various electric vehicles and charging devices. As an emerging machine learning approach, federated learning enables model training and updates while protecting data privacy.
[0031] In one possible implementation, edge devices can be deployed at charging stations to acquire charging data from electric vehicles. Based on this, the edge devices can act as nodes in a blockchain network, allowing a global model to be trained using federated learning techniques within the blockchain network.
[0032] In this embodiment, the global model parameters in federated learning are aggregated from the local model parameters trained locally by each node in the blockchain network based on historical charging data, thereby incorporating common features of various vehicle models and charging piles. Based on this, the charging data of electric vehicles is predicted using the target global model corresponding to the global model parameters that integrates various common features and the local models trained locally by each node. Global prediction results and local prediction results are obtained respectively, and the deviation between the two is used to comprehensively determine the charging status of the electric vehicle, ensuring the accuracy of monitoring.
[0033] In this way, there is no need to design separate models and collect data for various vehicle models and charging pile characteristics, which reduces development costs. Furthermore, a secure and robust global model can be trained based on the traceability and immutability of blockchain, thereby improving the accuracy of electric vehicle charging status monitoring while reducing development costs and providing effective support for the safety and reliability of the electric vehicle charging process.
[0034] The electric vehicle charging status monitoring method provided in this disclosure can be applied to any node in a blockchain network, that is, any edge device deployed on the side of a charging pile. Smart contracts can also be deployed in the blockchain network; these smart contracts can include one or more types to perform different operations. In a specific implementation, smart contracts can be deployed on some or all of the nodes in the blockchain network, thereby allowing the nodes in the blockchain network to execute the corresponding smart contracts.
[0035] For example, charging data of electric vehicles can be acquired through edge devices in a blockchain network, and a local model and its parameters can be trained locally based on the acquired historical charging data. On this basis, a corresponding smart contract can be invoked to aggregate the local model parameters from various nodes in the blockchain network to obtain the corresponding global model parameters.
[0036] It should be noted that on-chain consensus operations can be performed on global model parameters, and the global model parameters that have reached consensus in the blockchain network can be stored on the chain for real-time monitoring of electric vehicle charging status.
[0037] It is easy to understand that a global model parameter can be stored in a blockchain network. This global model parameter is obtained by aggregating the local model parameters that each node in the blockchain network trains locally based on historical charging data.
[0038] Figure 1 This is a flowchart illustrating an exemplary embodiment of the present disclosure of a method for monitoring the charging status of an electric vehicle. Figure 1 As shown, the electric vehicle charging status monitoring method may include steps S101 to S104.
[0039] In step S101, charging data of the electric vehicle is acquired.
[0040] The charging data for electric vehicles can include various parameters related to electric vehicle charging, which can be used to determine the charging status of the electric vehicle.
[0041] For example, various parameters related to electric vehicle charging may include the rated capacity of the vehicle's power battery, the rated voltage of the vehicle's power battery, the maximum permissible single cell voltage, the maximum permissible charging current, the nominal energy of the vehicle's power battery, the maximum permissible charging voltage, the maximum permissible temperature, the initial SOC (State of Charge) of the vehicle's power battery, the initial voltage of the vehicle's power battery, the required voltage of the vehicle's power battery, the required current of the vehicle's power battery, the measured charging voltage, the measured charging current, the maximum single cell voltage of the vehicle's power battery, the current SOC of the vehicle's power battery, and the maximum temperature of the single cell of the vehicle's power battery.
[0042] In step S102, global model parameters are obtained from the blockchain network, and the target global model corresponding to the global model parameters is determined.
[0043] In step S103, the charging data is input into the locally trained local model to obtain the local prediction result output by the local model, and the charging data is input into the target global model to obtain the global prediction result output by the target global model.
[0044] It should be noted that after a node obtains the global model parameters from the blockchain network, it can determine the model to which these global model parameters are applied, i.e., the target global model. In one possible implementation, the global model parameters can be applied to a locally trained local model, and the local model with updated parameters can be used as the target global model.
[0045] Based on this, the charging data can be predicted using the local model and the target global model trained locally, respectively, to obtain local prediction results and global prediction results.
[0046] In step S104, the charging status of the electric vehicle is determined based on the magnitude of the deviation between the local prediction result and the global prediction result.
[0047] It should be understood that the global model parameters are derived by aggregating the local model parameters trained locally by each node in the blockchain network. Therefore, with a sufficiently large number of nodes, the global model parameters can incorporate a large amount of common features from various vehicle models and charging stations, thus possessing greater applicability and making the target global model determined based on the global model parameters more comprehensive and accurate. The local models trained locally by each node are continuously updated based on local charging data and the global model parameters on the blockchain. Therefore, predictions based on these locally trained local models can, to a certain extent, yield charging status predictions that are more closely aligned with the current charging status of electric vehicles. Furthermore, by combining the deviation values between the two sets of predictions to comprehensively determine the charging status of the electric vehicle, the accuracy of monitoring can be ensured.
[0048] In one possible implementation, the step of determining the deviation between the local prediction result and the global prediction result may include: Determine the standard deviation and mean absolute error between the local and global forecast results; Determine the residual deviation value between the standard deviation and the mean absolute error. The residual deviation value is used as the deviation value between the local prediction result and the global prediction result.
[0049] The standard deviation can be determined by referring to Formula 1 below, and the mean absolute error can be determined by referring to Formula 2 below.
[0050] e1= (Formula 1) e2= (Formula 2) Where Y1 represents the local prediction result, Y2 represents the global prediction result, m represents the number of elements in vector Y1, vectors Y1 and Y2 have the same number of elements, e1 represents the standard deviation of Y1 and Y2, and e2 represents the mean absolute error of Y1 and Y2.
[0051] Understandably, the mean absolute error between the local and global prediction results can characterize the degree of deviation between their mean values. The standard deviation between the local and global prediction results can characterize the magnitude of the numerical fluctuations in these two predictions. Based on this, one of the mean absolute error and the standard deviation can be used as the observed value, and the other as the predicted value. The residual deviation between the observed value and the predicted value can be calculated, i.e., the residual deviation between the mean absolute error and the standard deviation can be determined. This residual deviation value can then be used to assess the volatility and bias of the prediction results, and based on the assessment results, the charging state of the electric vehicle can be determined.
[0052] Optionally, step S104 above may include: If the residual deviation value is greater than the preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0053] Accordingly, if the residual deviation value is less than or equal to the preset safety threshold, the charging status of the electric vehicle is determined to be normal.
[0054] The preset safety threshold can be determined according to the actual situation, and this disclosure does not make specific limitations on it.
[0055] It should be noted that, in order to reduce error interference, predictions can be made based on multiple consecutively sampled charging data, resulting in multiple local prediction results and multiple global prediction results. Furthermore, multiple standard deviations and multiple mean absolute errors are calculated for these multiple local and global prediction results.
[0056] Based on this, the steps for determining the residual deviation value between the standard deviation and the mean absolute error may include: Determine the first residual deviation value that characterizes the mean deviation among multiple standard deviations and multiple mean absolute errors; Based on the first residual deviation value, a second residual deviation value is determined to characterize the data distribution deviation between multiple standard deviations and multiple mean absolute errors.
[0057] The method for determining the first residual deviation value can refer to Formula 3 below, and the method for determining the second residual deviation value can refer to Formula 4 below.
[0058] (Formula 3) (Formula 4) Where e1 represents the standard deviation of the local prediction result Y1 and the global prediction result Y2, and e2 represents the mean absolute error of Y1 and Y2. This is the first residual deviation value. is the second residual deviation value, and N is the number of consecutive samples.
[0059] The number of consecutive samples N can be set according to actual conditions, and this disclosure does not impose a specific limitation. In one embodiment, the value of N can be specified locally by the node, and the standard deviation and mean absolute error between the N local prediction results and the global prediction result can be determined accordingly. In another embodiment, the value of N can be specified by a smart contract deployed in the blockchain network, thereby allowing the node to obtain the value of N from the blockchain network and determine the standard deviation and mean absolute error between the N local prediction results and the global prediction result accordingly.
[0060] In one possible implementation, the first residual deviation value and the second residual deviation value between N standard deviations and the mean absolute error can be calculated continuously using the sliding window method.
[0061] It is easy to understand that the residual deviation value may include the first residual deviation value and the second residual deviation value mentioned above. Therefore, in this embodiment of the disclosure, step S104 may include: If both the first residual deviation value and the second residual deviation value are greater than the preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0062] Accordingly, if the first residual deviation value or the second residual deviation value is less than or equal to the preset safety threshold, the charging status of the electric vehicle is determined to be normal.
[0063] It should be noted that by making predictions based on multiple consecutively sampled charging data, the charging curve of the electric vehicle can be determined based on the obtained prediction results. When both the first residual deviation value and the second residual deviation value are greater than the preset safety threshold, it can be indicated that the charging curve of the electric vehicle has deviated from the normal range, thereby determining that the charging status of the electric vehicle is abnormal.
[0064] Figure 2 This is a schematic diagram illustrating a scenario of an electric vehicle charging status monitoring method according to an exemplary embodiment of this disclosure. Figure 2 As shown, taking edge device 201, a node in the blockchain network, as an example, edge device 201 locally acquires charging data from an electric vehicle and obtains global model parameters from blockchain 202. It then uses these global model parameters as local model parameters for local training to obtain a new round of local model parameters. Based on this, edge device 201 can share the new round of local model parameters with blockchain 202 by calling a smart contract, and aggregate them to obtain a new round of global model parameters. Once consensus is reached on the chain for the new round of global model parameters, they are stored in blockchain 202 for use in the next round of training.
[0065] It should be understood that the process of training a global model using federated learning technology in a blockchain involves multiple rounds of training. Each round of training may include the steps from which the edge device 201 obtains the global model parameters from the blockchain 202 to storing the new round of global model parameters that have reached consensus on the blockchain 202.
[0066] In one possible implementation, during the first round of training, the global model parameters stored in blockchain 202 can be randomly generated; that is, the global model parameters that edge device 201 first obtains from blockchain 202 can be randomly generated. After the first round of training, the global model parameters that edge device 201 obtains from blockchain 202 can be aggregated from the previous round of training.
[0067] It should be noted that using federated learning techniques to train a global model is of great significance for improving the model's security and robustness. However, the following privacy risks still exist during the federated learning training process.
[0068] (1) Privacy leaks caused by exposure of local information. In each round of training, each node in the blockchain network needs to upload updated parameters such as local models or gradients obtained from local training. These parameters implicitly contain the characteristics of the node's data, and malicious attackers can intercept this information and launch attacks. A typical attack behavior is a reconstruction attack, in which the attacker, as an internal malicious attacker participating in the training, intercepts the model gradient of the target node in each round of training. Based on the intercepted information, the malicious attacker can generate and optimize a set of virtual data, so that the model gradient obtained by training from the virtual data approximates the model gradient of the target node, thereby making the virtual data approximate the real training data of the target node.
[0069] (2) Privacy leaks caused by exposure of global information. When the central node is honest and the communication channel is secure, malicious attackers cannot directly obtain the data uploaded by the target node. However, the aggregation results of the central node, or the final output global model, are still open to malicious attackers. Studies have shown that malicious attackers can use black-box access to the output global model to generate a shadow model that mimics the behavior of the model based on the prediction results. They can then use the shadow model to train a discriminator to determine whether a piece of data belongs to the real training set. Furthermore, in the case of white-box access, malicious attackers can launch gradient ascent attacks and isolation attacks on the target node to obtain its local view, which significantly increases the probability of information leakage.
[0070] To address this, this embodiment of the disclosure, based on the concept of local differential privacy, adds a certain perturbation, i.e., noise, to the locally trained local model, and submits the privacy-preserving local model parameters obtained after perturbation to the smart contract, thereby ensuring differential privacy in each round of aggregation. Thus, regardless of whether some data from the node's local environment participates in training, the distribution of the global model parameters obtained after aggregation does not change significantly. This approach takes into account that the amount of information contained in the data often decreases with computation or processing. When a malicious attacker cannot steal the charging data obtained locally by the node, the information closest to the original data that they can obtain is the global model parameters of each round of aggregation. Therefore, by adding noise to the local model parameters used to obtain the global model parameters through aggregation, the characteristics of the real training data reflected in the parameters are interfered with, effectively preventing the aggregated model from being exploited by malicious attackers.
[0071] Furthermore, considering that malicious attackers can reconstruct their local datasets based on the local model parameters submitted by nodes to the smart contract, this embodiment also utilizes multi-party secure computation to hide the local model parameters trained by each node in each round of training, thereby performing encrypted aggregation and ensuring that the global model parameters uploaded to the blockchain network are encrypted. This ensures that the smart contract can simultaneously aggregate the local model parameters submitted by nodes to obtain the correct aggregation result, while also preventing the leakage of local information.
[0072] Optionally, the global model parameters stored in the blockchain network are dense-state global model parameters. A first smart contract is deployed in the blockchain network to obtain the target global model corresponding to the dense-state global model parameters. The dense-state global model parameters are obtained by densely aggregating the privacy-preserving local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network.
[0073] Based on this, step S102 above may include: The first smart contract is invoked to obtain the target global model corresponding to the dense global model parameters stored in the blockchain network. The target global model is obtained by decrypting the dense global model parameters and removing noise.
[0074] It is understandable that by decrypting the dense global model parameters and removing noise, the global model parameters can be obtained. Based on this, the model that applies these global model parameters, i.e., the target global model, can be determined.
[0075] It should be noted that a second smart contract can also be deployed in the blockchain network. This second smart contract is used to perform dense aggregation of privacy local model parameters to obtain dense global model parameters.
[0076] Figure 3 This is a flowchart illustrating an exemplary embodiment of the present disclosure for determining parameters of a dense-state global model. For example... Figure 3 As shown, the technical solution provided in this embodiment may further include training steps S301 to S305, which are used to train a local model and determine the dense-state global model parameters based on it.
[0077] S301, obtain the historical charging data of the electric vehicle and the charging status tags corresponding to the historical charging data.
[0078] The charging status label can be generated based on the historical charging status data of electric vehicles.
[0079] S302: Obtain global model parameters from the blockchain network and use the target global model corresponding to the global model parameters as the local model to be trained.
[0080] S303: Iteratively train the local model to be trained based on historical charging data and charging status labels, and adjust the local model parameters of the local model to be trained based on the results of each iteration until the training termination condition is met, thus obtaining the trained local model.
[0081] The training termination condition can be either the number of training iterations being greater than the preset number of training iterations, or the loss value in the iterative training results being less than the preset loss value. The specific condition can be determined according to the actual situation, and this disclosure does not impose any specific limitations on it.
[0082] S304 adds noise to the local model parameters of the trained local model to obtain privacy local model parameters.
[0083] For example, noise can be added to the local model parameters using the following formula 5.
[0084] (Formula 5) in, This represents the global model parameters obtained from the blockchain network. The local model parameters represent the local model trained locally at the node. The Gaussian function is used to add noise to local model parameters, and ε represents the privacy protection strength parameter. This represents the parameters of the privacy-focused local model.
[0085] Understandably, Formula 5 represents the direction... Add a mean of 0 and a variance of ||MM 0 || / ε is Gaussian noise. In one possible implementation, the value of ε can be set through a smart contract, and a consensus on the value of ε can be reached through a blockchain network.
[0086] By applying differential privacy to add noise to local model parameters, privacy leaks caused by the exposure of global model parameters obtained from the aggregation of privacy-focused local model parameters can be effectively prevented.
[0087] S305, calls the second smart contract to perform dense aggregation of the locally obtained privacy local model parameters and other privacy local model parameters trained by other nodes in the blockchain network to obtain the dense global model parameters.
[0088] The second smart contract is also used to store the parameters of the encrypted global model that have reached consensus in the blockchain network on the blockchain.
[0089] For example, the parameters of the privacy local model can be expressed using the following formula 6. Dense-state polymerization is carried out.
[0090] (Formula 6) in, Represents global model parameters The number of bits in the binary representation. Represents the parameters of the dense-state global model. From n privacy local model parameters Obtained by aggregation.
[0091] By employing multi-party secure computation to encrypt the privacy-related local model parameters submitted by each node to the smart contract, privacy leaks caused by the exposure of these parameters can be effectively prevented. Furthermore, by aggregating the privacy-related local model parameters from each node in a secure manner to obtain the secure global model parameters, the trustworthiness of the data can be guaranteed through blockchain consensus.
[0092] It is worth noting that, when monitoring the charging status of electric vehicles based on real-time charging data, the parameters of the dense global model stored in the blockchain network can also be updated according to the above training steps S301~S305. This allows the global model to be updated in a timely manner based on the continuously generated charging data of electric vehicles, thereby improving the applicability and comprehensiveness of the global model.
[0093] Optionally, prior to step S304 above, the technical solution provided in this disclosure embodiment may further include: Obtain the weight pruning threshold from the blockchain network; The local training parameters of the trained local model are pruned according to the weight pruning threshold.
[0094] For example, the privacy local model parameters Mp can be weighted and clipped using the following formula 7 to obtain the clipped privacy local model parameters Mp'.
[0095] (Formula 7) Here, C represents the weight pruning threshold, which can be determined according to the actual situation, and this disclosure does not impose specific limitations on it. In one possible implementation, the weight pruning threshold can be set through a smart contract, and a consensus on the weight pruning threshold can be reached through a blockchain network.
[0096] It should be understood that Formula 7 represents setting the values of parameters in the privacy local model parameter Mp that are greater than the weight pruning threshold to C. By setting the weight pruning threshold, the number of parameters participating in subsequent calculations in the model can be reduced, thereby improving computational efficiency and, consequently, the operational efficiency of electric vehicle charging status monitoring.
[0097] Furthermore, it should be noted that the model architecture of the local model to be trained can be set in various ways. For example, a convolutional neural network can be used to extract convolutional features from electric vehicle charging data, and a predictive neural network can be applied to further process the convolutional features and make corresponding predictions.
[0098] Among them, the predictive neural network can be, for example, a Long Short-Term Memory (LSTM) network model, or a Bidirectional Gated Recurrent Unit (Bi-GRU) model.
[0099] It is worth noting that various charging data of electric vehicles can be collected in real time during each charging process, and the collected data can be used for model training and prediction, thereby continuously updating the global model and reflecting big data trends. However, considering the complex structure and numerous parameters of LSTM, prediction using LSTM-based neural networks often suffers from slow model convergence and long training times when processing large amounts of data. This performance disadvantage becomes even more pronounced when performing privacy-preserving federated learning, making it difficult to meet the performance requirements of joint modeling of electric vehicle charging data. Therefore, this disclosure, based on the advantages of Bi-GRU's simple structure, fewer parameters, and fast model convergence, and considering the continuous data characteristics of electric vehicle charging data, proposes that using Bi-GRU for prediction tasks in the joint modeling scenario of electric vehicle charging data can achieve better results.
[0100] It is easy to understand that the charging status of an electric vehicle changes as the charging process progresses, and there is a strong correlation between the charging data of the electric vehicle throughout the entire charging process. It takes into account the characteristics of historical and future charging data. Therefore, Bi-GRU, which combines forward GRU and backward GRU, can make in-depth use of the charging data of electric vehicles.
[0101] Figure 4 This is a schematic diagram illustrating an exemplary embodiment of the present disclosure of training a local model to be trained. For example... Figure 4 As shown, edge devices 401 and 402 acquire their respective historical charging data, perform data standardization processing locally, and then conduct privacy-preserving federated training through a smart contract. During this process, edge devices 401 and 402 perform multiple rounds of iterative training based on their respective prediction results. Upon meeting their respective training termination conditions, they obtain the corresponding locally trained models.
[0102] Continue Figure 4For example, it should be understood that the local model to be trained may include a convolutional sub-model to be trained and a bidirectional recurrent gating sub-model to be trained.
[0103] Based on this, the local model to be trained is iteratively trained using historical charging data and charging status labels, and the local model parameters are adjusted according to the results of each iteration until the training termination condition is met, resulting in a fully trained local model. The steps may include: Historical charging data is standardized to obtain standard charging data. Standard charging data is input into the convolutional sub-model to be trained to obtain the intermediate feature vector output by the convolutional sub-model to be trained. The intermediate feature vector is input into the bidirectional cyclic gated unit sub-model to be trained, and the charging state prediction result output by the bidirectional cyclic gated unit sub-model to be trained is obtained. The loss value is calculated based on the charging state prediction result and the charging state label, and the convolution training parameters of the convolution operation sub-model to be trained and the gating training parameters of the bidirectional recurrent gating unit sub-model to be trained are adjusted based on the loss value. Return to the step of inputting standard charging data into the convolutional sub-model to be trained to calculate the loss value, until the training termination condition is met, and obtain the trained local model; The trained local model includes the trained convolution operation sub-model and the trained bidirectional recurrent gated unit sub-model. The local model parameters of the trained local model include the convolution training parameters of the trained convolution operation sub-model and the gating training parameters of the trained bidirectional recurrent gated unit sub-model.
[0104] It should be noted that historical charging data can include various parameters related to electric vehicle charging, and the values of these parameter sets can be represented by vectors. express.
[0105] For example, the vector representing historical charging data can be represented by the following formula 8. Perform data standardization processing to obtain standard charging data. .
[0106] (Formula 8) in, This represents a vector consisting of the minimum values of the same parameter across multiple historical charging data points. A vector representing the maximum value of the same parameter across multiple historical charging data points. The characterization is based on the standard charging data obtained after data standardization.
[0107] For example, the data processing performed by the convolutional sub-model to be trained on standard charging data can be referred to Formula 9 below.
[0108]
[0109] (Formula 9) in, and These represent the first convolution weights and the second convolution weights, respectively. and These represent the first bias value and the second bias value, respectively. Represents convolution operation. Represents the activation function. Represents max pooling operation. This represents the intermediate feature vector output by the convolutional sub-model to be trained.
[0110] It is understandable that the convolution training parameters of the convolution operation sub-model can include the above. , , and .
[0111] Figure 5 This is a schematic diagram illustrating a bidirectional cyclic gating unit sub-model according to an exemplary embodiment of this disclosure. Figure 5 As shown, the bidirectional cyclic gating unit sub-model may include an update gate Z, a reset gate R, and a temporary storage unit. The update gate Z outputs the hidden state h through the corresponding activation function σ. t-1 The reset gate R outputs the intermediate result h through the corresponding activation function σ. t Temporary storage unit Output candidate hidden states using the hyperbolic tangent activation function (tanh). .
[0112] Based on this, the prediction result Y of the bidirectional cyclic gating unit sub-model can be obtained through the following formulas 10 to 18.
[0113] (Formula 10) (Formula 11) (Formula 12) (Formula 13) (Formula 14) (Formula 15) (Formula 16) (Formula 17) (Formula 18) Where the subscript t represents the t-th iteration, and the parameters W and b are combined with different subscripts z, r, and In the case of , represent different input weights in the bidirectional recurrent gated unit sub-model, and the superscripts f and b represent the forward hidden layer and the backward hidden layer, respectively. and These represent the forward update gate state bias vector and the backward update gate state bias vector, respectively. and These represent the forward reset gate state bias vector and the backward reset gate state bias vector, respectively. and These represent the forward temporary storage unit state bias vector and the backward temporary storage unit state bias vector, respectively.
[0114] It is not difficult to understand that the gating training parameters of the bidirectional cyclic gating unit sub-model can include the above-mentioned input weights, that is... , , , , , , , , , , ,as well as .
[0115] Based on this, continue to use Figure 4 For example, the intermediate feature vector can be... The process involves inputting the bidirectional recurrent gated unit (BROG) sub-model to be trained, obtaining its output charging state prediction, calculating the loss value based on the charging state prediction and charging state label, and adjusting the convolution training parameters of the convolutional sub-model and the gating training parameters of the BROG sub-model based on the loss value. Then, the process returns to the step of inputting standard charging data into the convolutional sub-model to calculate the loss value, continuing until the training termination condition is met, resulting in a locally trained model.
[0116] Therefore, it is easy to understand that the local model parameters M of the trained local model can include the above. , , , , , , , , , , , , , , ,as well as .
[0117] Figure 6 This is a flowchart illustrating a method for monitoring the charging status of an electric vehicle, as shown in another exemplary embodiment of this disclosure. Figure 6 As shown, the electric vehicle charging status monitoring method provided in this embodiment may include steps S5010 to S5038.
[0118] In step S5010, charging data of the electric vehicle is acquired.
[0119] In step S5012, historical charging data is selected from the charging data of the electric vehicle, and the charging status tag corresponding to the historical charging data is obtained.
[0120] In step S5014, the historical charging data is standardized.
[0121] In step S5016, standard charging data is obtained.
[0122] In step S5020, the grid structure of the federated learning model is determined and the grid parameters are initialized.
[0123] In this context, the federated learning model is the global model, and the grid parameters are the global model parameters.
[0124] In step S5022, iterative training is performed based on standard charging data and charging status labels, and the weights and biases of the federated learning model are updated.
[0125] It is understandable that updating the weights and biases of a federated learning model involves updating the global model parameters.
[0126] In step S5024, if the training termination condition is met, the federated learning model that has completed training is obtained.
[0127] It should be understood that, under the condition of training termination, a local model trained locally on the edge device can be obtained, and the global model parameters can be obtained by aggregating the parameters of the local models trained on each edge device. Based on this, the corresponding global model can be determined according to the global model parameters, and this global model is the federated learning model that has been trained.
[0128] In step S5026, based on standard charging data, the residual mean and standard deviation of the temperature during normal charging of the electric vehicle are calculated using a sliding window.
[0129] In step S5028, a preset safety threshold is determined.
[0130] In step S5030, real-time charging data of the electric vehicle is acquired, its status is monitored, and displayed.
[0131] The charging data is input into the trained federated learning model to predict the charging temperature of the electric vehicle in step S5032.
[0132] In step S5034, the mean and standard deviation of the residuals of the predicted temperature of the electric vehicle are calculated using a sliding window.
[0133] In step S5036, it is determined whether the mean and standard deviation of the residuals of the predicted temperature both exceed a preset safety threshold. If both exceed the threshold, proceed to step S5038.
[0134] In step S5038, a safety warning is issued.
[0135] In this embodiment of the disclosure, while monitoring the charging data during the charging process of an electric vehicle, a temperature model for the power battery can also be trained, thereby enabling the determination of whether the charging status of the electric vehicle is safe.
[0136] In one possible implementation, the acquired electric vehicle charging data is divided into real-time data and historical data. This allows the use of historical charging data to train a deep learning network, thereby constructing a temperature prediction model for electric vehicle charging. Based on this, real-time charging data is input into the temperature prediction model to predict the temperature, and the predicted values are analyzed to determine whether temperature anomalies occur during the electric vehicle charging process, thus providing a safety warning for the charging process.
[0137] It is worth noting that the embodiments disclosed in this paper use federated learning technology to jointly model edge-side charging data belonging to different manufacturers, thereby forming a secure and robust global model. In this process, blockchain technology is also used to achieve consensus collaboration during model training, achieving traceability and immutability. Furthermore, differential privacy and multi-party secure computation technologies are used to eliminate the risk of data leakage in traditional federated learning processes.
[0138] The above technical solution uses federated learning technology to train a global model within a blockchain network. The parameters of this global model are aggregated from the local model parameters trained locally by each node in the blockchain network based on historical charging data, thus incorporating common features of various vehicle models and charging stations. Based on this, the charging data of electric vehicles is predicted using both the target global model (which integrates the parameters of the global model with various common features) and the local models trained locally by each node. Global and local prediction results are obtained separately, and the deviation between the two is used to comprehensively determine the charging status of the electric vehicle, ensuring the accuracy of monitoring.
[0139] In this way, there is no need to design separate models and collect data for various vehicle models and charging pile characteristics, which reduces development costs. Furthermore, a secure and robust global model can be trained based on the traceability and immutability of blockchain, thereby improving the accuracy of electric vehicle charging status monitoring while reducing development costs and providing effective support for the safety and reliability of the electric vehicle charging process.
[0140] Based on the same inventive concept, this disclosure provides an electric vehicle charging status monitoring device. Figure 7 This is a block diagram of an electric vehicle charging status monitoring device 700 shown in an exemplary embodiment of this disclosure. (Refer to...) Figure 7 The electric vehicle charging status monitoring device 700 is applied to any node in a blockchain network. The blockchain network stores global model parameters, which are obtained by aggregating local model parameters trained locally by each node in the blockchain network based on historical charging data.
[0141] The electric vehicle charging status monitoring device 700 includes: The first acquisition module 701 is used to acquire the charging data of the electric vehicle; The second acquisition module 702 is used to acquire the global model parameters from the blockchain network and determine the target global model corresponding to the global model parameters; The input module 703 is used to input the charging data into a locally trained local model to obtain a local prediction result output by the local model, and to input the charging data into the target global model to obtain a global prediction result output by the target global model. The first determining module 704 is used to determine the charging status of the electric vehicle based on the magnitude of the deviation between the local prediction result and the global prediction result.
[0142] In one embodiment, the electric vehicle charging status monitoring device 700 further includes a second determining module, which is used for: Determine the standard deviation and mean absolute error between the local prediction results and the global prediction results; The residual deviation value between the standard deviation and the mean absolute error is determined, and the residual deviation value is used as the deviation value between the local prediction result and the global prediction result.
[0143] Based on this, the first determining module 704 is used for: If the residual deviation value is greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0144] In one embodiment, there are multiple local prediction results and multiple global prediction results; for the multiple local prediction results and multiple global prediction results, there are multiple standard deviations and mean absolute errors calculated.
[0145] The second determining module is used for: Determine a first residual deviation value that characterizes the mean deviation between the plurality of said standard deviations and the plurality of said mean absolute errors; Based on the first residual deviation value, a second residual deviation value is determined that characterizes the data distribution deviation between the plurality of standard deviations and the plurality of mean absolute errors.
[0146] Based on this, the first determining module 704 is used for: If both the first residual deviation value and the second residual deviation value are greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
[0147] In one embodiment, the global model parameters stored in the blockchain network are dense global model parameters. A first smart contract is deployed in the blockchain network. The first smart contract is used to obtain the target global model corresponding to the dense global model parameters. The dense global model parameters are obtained by dense aggregation of privacy local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network.
[0148] Based on this, the second acquisition module 702 is used for: The first smart contract is invoked to obtain the target global model corresponding to the encrypted global model parameters stored in the blockchain network. The target global model is obtained by decrypting the encrypted global model parameters and removing noise.
[0149] In one embodiment, the global model parameters stored in the blockchain network are dense global model parameters. A first smart contract is deployed in the blockchain network. The first smart contract is used to obtain the target global model corresponding to the dense global model parameters. The dense global model parameters are obtained by dense aggregation of privacy local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network.
[0150] Based on this, the electric vehicle charging status monitoring device 700 also includes a training module, which is used for: Obtain the historical charging data of the electric vehicle and the charging status tags corresponding to the historical charging data; Obtain the global model parameters from the blockchain network, and use the target global model corresponding to the global model parameters as the local model to be trained; The local model to be trained is iteratively trained based on the historical charging data and the charging status label, and the local model parameters of the local model to be trained are adjusted according to the results of each iteration until the training termination condition is met, and the trained local model is obtained. Noise is added to the local model parameters of the trained local model to obtain privacy local model parameters; The second smart contract is invoked to perform secret-state aggregation of the privacy local model parameters obtained locally and other privacy local model parameters trained by other nodes in the blockchain network to obtain secret-state global model parameters; The second smart contract is also used to store the dense global model parameters that have reached a consensus in the blockchain network on the blockchain.
[0151] In one embodiment, the local model to be trained includes a convolutional operation sub-model to be trained and a bidirectional recurrent gating unit sub-model to be trained.
[0152] Based on this, the training module is used for: The historical charging data is standardized to obtain standard charging data; The standard charging data is input into the convolutional operation sub-model to be trained to obtain the intermediate feature vector output by the convolutional operation sub-model to be trained. The intermediate feature vector is input into the bidirectional cyclic gating unit sub-model to be trained, and the charging state prediction result output by the bidirectional cyclic gating unit sub-model to be trained is obtained. The loss value is calculated based on the charging state prediction result and the charging state label, and the convolution training parameters of the convolution operation sub-model to be trained and the gating training parameters of the bidirectional recurrent gating unit sub-model to be trained are adjusted based on the loss value. Return to the step of inputting the standard charging data into the convolutional sub-model to be trained to calculate the loss value, until the training termination condition is met, and obtain the local model that has been trained. The trained local model includes a trained convolutional operation sub-model and a trained bidirectional recurrent gated unit sub-model. The local model parameters of the trained local model include the convolutional training parameters of the trained convolutional operation sub-model and the gating training parameters of the trained bidirectional recurrent gated unit sub-model.
[0153] In one embodiment, the electric vehicle charging status monitoring device 700 further includes a weight trimming module, which is used for: Before adding noise to the local model parameters of the trained local model, a weight pruning threshold is obtained from the blockchain network. The local training parameters of the trained local model are pruned according to the weight pruning threshold.
[0154] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0155] Figure 8 This is a block diagram illustrating an electronic device 800 according to an exemplary embodiment of this disclosure. Figure 8 As shown, the electronic device 800 may include a processor 801 and a memory 802. The electronic device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.
[0156] The processor 801 controls the overall operation of the electronic device 800 to complete all or part of the steps in the electric vehicle charging status monitoring method described above. The memory 802 stores various types of data to support the operation of the electronic device 800. This data may include, for example, instructions for any application or method operating on the electronic device 800, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 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 Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 802 or transmitted via communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 805 is used for wired or wireless communication between the electronic device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 805 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0157] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the electric vehicle charging status monitoring method described above.
[0158] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the electric vehicle charging state monitoring method described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above, which may be executed by the processor 801 of the electronic device 800 to complete the electric vehicle charging state monitoring method described above.
[0159] In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described electric vehicle charging state monitoring method when executed by the programmable device.
[0160] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0161] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0162] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A method for monitoring the charging status of an electric vehicle, characterized in that, It is applied to any node in a blockchain network, where global model parameters are stored. These global model parameters are obtained by aggregating local model parameters trained locally by each node in the blockchain network based on historical charging data. The electric vehicle charging status monitoring method includes: Obtain the charging data of the electric vehicle; Obtain the global model parameters from the blockchain network, and determine the target global model corresponding to the global model parameters; The charging data is input into a locally trained local model to obtain a local prediction result output by the local model, and the charging data is input into a target global model to obtain a global prediction result output by the target global model. The charging status of the electric vehicle is determined based on the magnitude of the deviation between the local prediction result and the global prediction result.
2. The electric vehicle charging status monitoring method according to claim 1, characterized in that, The method further includes: Determine the standard deviation and mean absolute error between the local prediction results and the global prediction results; Determine the residual deviation value between the standard deviation and the mean absolute error, and use the residual deviation value as the deviation value between the local prediction result and the global prediction result; Determining the charging status of the electric vehicle based on the deviation between the local prediction result and the global prediction result includes: If the residual deviation value is greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
3. The electric vehicle charging status monitoring method according to claim 2, characterized in that, There are multiple local prediction results and multiple global prediction results; for the multiple local prediction results and multiple global prediction results, there are multiple standard deviations and mean absolute errors calculated. Determining the residual deviation value between the standard deviation and the mean absolute error includes: Determine a first residual deviation value that characterizes the mean deviation between the plurality of said standard deviations and the plurality of said mean absolute errors; Based on the first residual deviation value, a second residual deviation value is determined to characterize the data distribution deviation between the plurality of standard deviations and the plurality of mean absolute errors; Determining the charging status of the electric vehicle based on the deviation between the local prediction result and the global prediction result includes: If both the first residual deviation value and the second residual deviation value are greater than a preset safety threshold, the charging status of the electric vehicle is determined to be abnormal.
4. The method for monitoring the charging status of an electric vehicle according to any one of claims 1-3, characterized in that, The global model parameters stored in the blockchain network are dense global model parameters. A first smart contract is deployed in the blockchain network. The first smart contract is used to obtain the target global model corresponding to the dense global model parameters. The dense global model parameters are obtained by dense aggregation of privacy local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network. The step of obtaining the global model parameters from the blockchain network and determining the target global model corresponding to the global model parameters includes: The first smart contract is invoked to obtain the target global model corresponding to the encrypted global model parameters stored in the blockchain network. The target global model is obtained by decrypting the encrypted global model parameters and removing noise.
5. The method for monitoring the charging status of an electric vehicle according to any one of claims 1-3, characterized in that, The global model parameters stored in the blockchain network are dense global model parameters. The dense global model parameters are obtained by densely aggregating privacy local model parameters obtained by adding noise to the local model parameters trained locally by each node in the blockchain network. A second smart contract is deployed in the blockchain network, and the second smart contract is used to perform dense aggregation of the privacy local model parameters. The method further includes: Obtain the historical charging data of the electric vehicle and the charging status tags corresponding to the historical charging data; Obtain the global model parameters from the blockchain network, and use the target global model corresponding to the global model parameters as the local model to be trained; The local model to be trained is iteratively trained based on the historical charging data and the charging status label, and the local model parameters of the local model to be trained are adjusted according to the results of each iteration until the training termination condition is met, and the trained local model is obtained. Noise is added to the local model parameters of the trained local model to obtain privacy local model parameters; The second smart contract is invoked to perform secret-state aggregation of the privacy local model parameters obtained locally and other privacy local model parameters trained by other nodes in the blockchain network to obtain secret-state global model parameters; The second smart contract is also used to store the dense global model parameters that have reached a consensus in the blockchain network on the blockchain.
6. The electric vehicle charging status monitoring method according to claim 5, characterized in that, The local model to be trained includes a convolutional operation sub-model and a bidirectional recurrent gating unit sub-model to be trained. The step of iteratively training the local model to be trained based on the historical charging data and the charging status label, and adjusting the local model parameters of the local model to be trained based on the results of each iteration, until the training termination condition is met, to obtain the trained local model, includes: The historical charging data is standardized to obtain standard charging data; The standard charging data is input into the convolutional operation sub-model to be trained to obtain the intermediate feature vector output by the convolutional operation sub-model to be trained. The intermediate feature vector is input into the bidirectional cyclic gating unit sub-model to be trained, and the charging state prediction result output by the bidirectional cyclic gating unit sub-model to be trained is obtained. The loss value is calculated based on the charging state prediction result and the charging state label, and the convolution training parameters of the convolution operation sub-model to be trained and the gating training parameters of the bidirectional recurrent gating unit sub-model to be trained are adjusted based on the loss value. Return to the step of inputting the standard charging data into the convolutional sub-model to be trained to calculate the loss value, until the training termination condition is met, and obtain the local model that has been trained. The trained local model includes a trained convolutional operation sub-model and a trained bidirectional recurrent gated unit sub-model. The local model parameters of the trained local model include the convolutional training parameters of the trained convolutional operation sub-model and the gating training parameters of the trained bidirectional recurrent gated unit sub-model.
7. The electric vehicle charging status monitoring method according to claim 5, characterized in that, Before adding noise to the local model parameters of the trained local model, the method further includes: Obtain the weight pruning threshold from the blockchain network; The local training parameters of the trained local model are pruned according to the weight pruning threshold.
8. A device for monitoring the charging status of an electric vehicle, characterized in that, It is applied to any node in a blockchain network, where global model parameters are stored. These global model parameters are obtained by aggregating local model parameters trained locally by each node in the blockchain network based on historical charging data. The electric vehicle charging status monitoring device includes: The first acquisition module is used to acquire the charging data of the electric vehicle; The second acquisition module is used to acquire the global model parameters from the blockchain network and determine the target global model corresponding to the global model parameters; The input module is used to input the charging data into a locally trained local model to obtain a local prediction result output by the local model, and to input the charging data into the target global model to obtain a global prediction result output by the target global model. The first determining module is used to determine the charging status of the electric vehicle based on the magnitude of the deviation between the local prediction result and the global prediction result.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Federal learning-based intelligent power grid equipment anomaly detection method and system
CN113139600A
Power quality disturbance detection method and device, electronic equipment and storage medium
CN113901412A