Power consumption prediction program for electric moving body and generation method of power consumption prediction model
The power consumption prediction program for EVs divides driving routes into sections to predict power consumption using neural networks and a secure federated learning framework, addressing inefficiencies in power trading by accurately forecasting energy supply and demand.
Patent Information
- Application Number
- JP2023020162
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2024-08-23
AI Technical Summary
Current power trading between electric vehicles (EVs) and the power grid is inefficient due to a lack of guidance on how to properly sell power, as EV owners cannot accurately predict power consumption based on future operations, leading to uncertainties in supply and demand balancing.
A power consumption prediction program that calculates power consumption by dividing the driving route into multiple sections, using weather, geographic, user, and EV information to predict power consumption through a neural network model, and employs a secure semi-distributed federated learning-based framework to train and generate power consumption prediction models.
Accurately predicts power consumption for future EV operations, enabling timely response to peak energy demand by integrating EVs into the smart grid, enhancing energy supply and demand balancing.
Smart Images

Figure 2024114410000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a power consumption prediction program for an electric vehicle and a method for generating a power consumption prediction model. [Background technology]
[0002] A Virtual Power Plant (VPP) balances the load on the power grid by allocating the power generated by various interconnected units during peak demand periods. However, the fluctuation of energy produced by renewable resources makes it difficult to balance the energy supply. Therefore, if demand-side energy devices such as electric vehicles (hereinafter referred to as EVs) and mobile robots are effectively deployed, the energy supply and demand can be balanced. With the integration of EVs into the smart grid, it becomes possible to feed power back to the power grid from the mobile battery of the EV. The following Patent Documents 1 to 7 and Non-Patent Documents 1 and 2 describe the power of the mobile battery of the EV. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication No. 2021-039684 [Patent Document 2] JP 2020-064490 A [Patent Document 3] Patent Publication No. 2022-050126 [Patent Document 4] Chinese Patent Publication No. 113886813 [Patent Document 5] German Patent Publication No. 102018211575 [Patent Document 6] European Patent Publication No. 3564873 [Patent Document 7] US Patent Publication No. 2022 / 0044162 [Non-patent literature]
[0004] [Non-Patent Document 1] W., P. Chen, D. Zeng, and J. Liu, "Electric vehicle fleet integration in a virtual power plant with large-scale wind power," IEEE Transactions on Industry Applications,, vol. 56, No. 5, pp. 5924-5931, 2020. [Non-Patent Document 2] Z. Wang, M. Ogbodo, H. Huang, C. Qiu, M. Hisada, and ABAbdallah, "AEBIS: AI-enabled blockchain-based electric vehicle integrated system for power management in smart grid platform," IEEE Access, vol. 8, pp. 226 409-226 421, 2020. Summary of the Invention [Problem to be solved by the invention]
[0005] However, current power trading between EVs and the power grid is inefficient because there is no guidance on how to sell power appropriately. For example, see Patent Documents 1-3. Also, although EV owners know the state of charge (SoC) and future trips of their EVs, they cannot know exactly how much power will be consumed by the EV's future driving, and therefore cannot know when to sell power and how much power they can supply. For example, see Non-Patent Document 2.
[0006] Therefore, an object of a first aspect of the present disclosure is to provide an electric vehicle power consumption prediction program and a power consumption prediction model generating method that enable accurate knowledge of the amount of power consumption due to future operation of an EV. [Means for solving the problem]
[0007] A first aspect of the present disclosure is a program for causing a computer to execute a process for predicting power consumption in a future operation of an electric vehicle, the prediction process comprising: calculating one or more intermediate positions for dividing a driving route from a starting point to a destination of one operation of the electric vehicle into a plurality of divided routes; The power consumption prediction program for an electric vehicle includes: inputting, for each of the multiple split routes, a sample having a start time of the split route, weather information at the start time of the split route, geographic information of the split route, information on a user driving the electric vehicle, and driving time and electric vehicle information; executing a power consumption prediction model program that estimates the power consumption of the electric vehicle on the split route; and calculating the power consumption of one operation by adding up the power consumption estimated for each of the multiple split routes. Effect of the Invention
[0008] According to the first aspect, it is possible to accurately predict power consumption in the future operation of an electric vehicle even when the electric vehicle is not connected to a charging station. [Brief description of the drawings]
[0009] [Figure 1] 1 is a diagram illustrating an example of the configuration of a smart grid system according to an embodiment of the present invention. [Diagram 2] 1 is a diagram showing the movement of an EV from a departure city (or departure point) to a destination city (or destination) and intermediate positions, etc., in a multi-stage power consumption prediction program. [Diagram 3] FIG. 2 is a diagram illustrating an example of a configuration of a power consumption prediction model executed by a multi-stage power consumption prediction program. [Figure 4] FIG. 13 is a flowchart of a multi-stage power consumption program. [Diagram 5] 1 is a pseudo-code example of a multi-stage power consumption program. [Figure 6] FIG. 1 is a diagram showing a semi-distributed federated learning-based framework in this embodiment. [Figure 7] This figure shows the hardware configuration of EV nodes, aggregators AGR, and miners MNRs included in the semi-distributed federated learning framework. [Figure 8] FIG. 13 is a diagram showing a flowchart of the processing of EV nodes, aggregator AGR, and miners MNRs of an EV fleet in a semi-distributed federated learning framework. [Figure 9] FIG. 13 is a diagram showing a program pseudocode of the FL-QLMS algorithm (1) using an auxiliary model. [Figure 10] FIG. 1 is a diagram showing a specific example of the FL-QLMS algorithm (1). [Figure 11] FIG. 13 is a program pseudocode of the FL-QLMS algorithm (2) without using an auxiliary model. [Figure 12] FIG. 13 is a flowchart showing an energy trading process performed by an EV node. [Figure 13] FIG. 13 is a flowchart of a first energy trading process by an aggregator. [Figure 14] FIG. 11 is a flowchart of a second energy trading process by an aggregator. [Figure 15] FIG. 2 is a diagram showing a table of training data used for training the power consumption prediction model of the present embodiment to be evaluated. [Figure 16] FIG. 13 is a diagram showing the evaluation results of the model. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] [Example of smart grid system configuration] Fig. 1 is a diagram showing an example of the configuration of a smart grid system according to the present embodiment. The smart grid system includes an energy resource E_RSC that generates renewable energy or non-renewable energy, and a power grid P_GRD that supplies the energy of the energy resource to a consumer CSM. An energy demand E_DMD is issued from the consumer CSM to the power grid P_GRD, and in response, the power grid P_GRD transmits an energy request E_RQ to the energy resource E_RSC, and in response, the energy resource E_RSC supplies energy E_SPL to the power grid P_GRD.
[0011] Since renewable energy is unstable, a large number of electric vehicles EV_1 to EV_n are incorporated into the smart grid system to respond to peaks in energy demand E_DMD. Then, power is effectively supplied from the storage batteries of the electric vehicles to the power grid P_GRD. An edge computer is installed in the electric vehicles EV. This edge computer is called an EV node.
[0012] When the energy supply E_SPL from the energy resource E_RSC cannot meet the sudden increase in the energy demand E_DMD, the power grid P_GRD transmits an energy request E_DMD to the aggregator AGR. In response to this, the aggregator AGR broadcasts an energy supply request E_SPL_RQ to the nodes of the electric vehicles EV_1 to EV_n.
[0013] Each EV node EV_1 to EV_n executes its own power consumption prediction program to predict power consumption due to future movement or driving, and predicts the remaining energy after each EV's movement. Each EV node determines the amount of energy to be supplied to the power grid P_GRD and the time of supply based on the predicted remaining energy. The aggregator AGR receives the energy offer E_OFR including the energy supply amount and the supply time returned from each electric mobile object. In response to this, the aggregator AGR executes the EV selection program EV_SLCT to select an electric mobile object that receives the energy offer, and returns the total energy offer T_E_OFR to the power grid P_GRD. The selected electric mobile object EV, while connected to the charging station C_ST, discharges the power of each energy offer E_OFR from each storage battery, and performs energy supply E_SPL to the power grid P_GRD.
[0014] As described above, in the smart grid system in Fig. 1, each EV node can accurately predict the amount of power consumption due to future driving, and therefore can respond to peaks in energy demand E_DMD in a timely manner.
[0015] In the following, with respect to the smart grid system of Fig. 1, a multi-stage power consumption prediction program executed by each EV node in this embodiment and a method for generating a power consumption prediction model in the multi-stage power consumption prediction program will be described. The generation of the power consumption prediction model is performed by a secure semi-distributed federated learning-based framework. Then, when integrating local models in the federated learning, the aggregator executes a qualified local model selection program.
[0016] [Multi-stage power consumption prediction program] FIG. 2 is a diagram showing the driving of an EV from a departure city (or starting point) to a destination city (or destination) and intermediate positions, etc., in a multi-stage power consumption prediction program. As shown in FIG. 2, an EV travels from the departure city (or starting point) to the destination city (or destination) in one drive. s From Destination City dIn this case, one or more intermediate locations City c is calculated, and the intermediate position City c The practical city closest to is selected. c is obtained by dividing the driving route between the starting city and the destination city by distances traveled with equal distances or equal driving times. Therefore, the intermediate points are called equal points.
[0017] The multi-stage electricity consumption forecast program calculates the route from the departure city to the destination city by dividing the route into equal intermediate cities. c The route is divided into sections (sections) and the power consumption prediction model predicts the power consumption for each section. The multi-stage power consumption prediction program then adds up the power consumption predicted for each section and predicts the power consumption for one trip from the departure city to the destination city.
[0018] In addition, the multi-stage power consumption prediction program predicts the power consumption for each divided route using the power consumption prediction model. s and several intermediate cities c The weather data from the weather forecast station WS is used. The distance of the divided route is preferably set to the distance traveled by driving an EV for about one hour, for example.
[0019] Fig. 3 is a diagram showing an example of a configuration of a power consumption prediction model executed by a multi-stage power consumption prediction program, Fig. 4 is a diagram showing a flowchart of the multi-stage power consumption program, and Fig. 5 is an example of pseudo code of the multi-stage power consumption program.
[0020] As shown in Figure 2, the starting city is City s is located in Area 1. Destination City d is located in area N. The departure city and destination city are expressed as latitude and longitude (Lat s , Long s ), (Lat d , Long d) are associated with the duration of the drive. The duration of the drive is abbreviated as DoD (Duration of Drive). To simplify matters, we assume that the duration of the drive is an integer and can only range from 1 to 12 hours. The start time is t s As shown in the figure.
[0021] We also assume that the EV moves in a straight line at a constant speed. Therefore, the program can calculate the EV's position at each time t as follows:
[0022]
number
[0023] Each calculated position is called an equal point (midpoint or intermediate position) because the distance between two adjacent positions is the same. As shown in Figure 2, these multiple equal points divide the entire travel path of the EV (driving route) into multiple sections (division routes). The multi-stage power consumption prediction program predicts the power consumption of each section, and the predicted results of each section are summed up to obtain the predicted power consumption for one drive.
[0024] The power consumption prediction program uses the following data for each section: (1) Start time t (2) Weather information for the time (weather data) (3) Geographic information (geographic data) (latitude and longitude) (4) User information (user data) (5) Operation Time DoD (6)EV information (EV data). The weather information at time t is calculated for each equidistant point City c Uses weather data from the nearest weather station WS.
[0025] The power consumption prediction model shown in Fig. 3 inputs the following data for each section and predicts the power consumption of each section. The power consumption prediction model in Fig. 3 is a neural network having an input layer IN_LYR, two hidden layers HDN_LYR, and an output layer OUT_LYR. The input layer IN_LYR has 13 neurons, and the following data is input to each neuron. (1) Start time (e.g., start time t, day of the week) (2) Meteorological information (e.g., temperature, precipitation, humidity, wind speed) (3) Geographic information (e.g., latitude and longitude of starting location) (4) User information (e.g., gender, age) (5) Operation time (DoD, e.g. 0-12) (6) EV information (e.g., EV model, EV age)
[0026] Each of the two hidden layers HD_LYR has eight neurons H1 to H8, and each neuron is fully connected to the neurons in the previous layer. The output layer OUT_LYR has one output neuron that is connected to all neurons in the previous hidden layer HD_LYR and outputs power consumption predictions.
[0027] The two hidden layers are fully connected layers, and weights w are assigned to the multiple links between the neurons in the previous layer, and each neuron in the fully connected layer performs a multiply-and-accumulate operation on the output x of the neuron in the previous layer and the link weight w, adds a bias b to the multiply-and-accumulate value, obtains the result (y=Σ(w*x)+b), inputs it to the activation function f(y), and outputs the output value of the activation function. One neuron in the output layer also performs a multiply-and-accumulate operation on the output of the neuron in the previous hidden layer and the link weight, and outputs the result of the operation by adding a bias to the multiply-and-accumulate value as the predicted power consumption.
[0028] The algorithm for predicting the power consumption of an EV will be described in detail with reference to the flowchart of the multi-stage power consumption prediction program in FIG. 4 and the pseudo code of the multi-stage power consumption prediction program in FIG.
[0029] For ease of understanding, the whole algorithm is divided into the following four steps. The numbers in parentheses indicate the steps S in Fig. 4 and the lines in Fig. 5 that correspond to each step. (1) Initialization (S1, Line 1-4) (2) Calculation of intermediate positions (positions of equal points) (S2, Line 5-8) (3) Practical city location calculation (S3, Line 9-23) (4) Power consumption forecast (S4_1, S4_2, Line 24-30, Line 31-33)
[0030] As a preliminary step, the multi-stage power consumption prediction program requires the following data (S0 in Fig. 4, Request in Fig. 5): Departure point
number
number
[0031] The latitudes and longitudes of all cities are stored in the following sets:
[0032]
number
[0033] The weather data includes temperature, precipitation, humidity, and wind speed at the start time t of each split path in the following sets:
[0034]
number
[0035] The user information User_Info includes, for example, the gender and age of the driver.total is the total number of cities, and M is the neural network model for power consumption prediction.
[0036] The process of the processor that executes the multi-stage power consumption prediction program will be described below.
[0037] [First stage: Initialization (S1, Lines 1-4)] In the first stage, the predicted power consumption of the variable PC pred is given (Ensure in Figure 5). Then, the processor initializes the following arrays and variables (S1). array
number
number
number
[0038] [Second stage: Calculation of intermediate positions (positions of equal points) (S2, Line 5-8)] In the second stage, the geographic information of the starting city and isopoint (the start position of the section) for driving time 0 to DoD - 1 is arranged.
number
[0039] [Third stage: Calculating the location of practical cities (S3, Line 9-23)] In the third stage, the processor determines the start position of each section (Lat c , Long c ) calculate the Euclidean distance ED between all practical cities City_ID and the shortest Euclidean distance ED min Find the nearest usable city from the section start location based on.
[0040] In Fig. 5, for each operation time i = 0 to DoD - 1 (line 9), the processor calculates the minimum Euclidean distance ED min , Practical city location Lat p [i], Long p [i], city ID City_ID are initialized (lines 11-13). Lat0, Long0 are the location of the practical city Lat p [i], Long p [i] is an arbitrary initial value. The initial value of the city ID City_ID is 0.
[0041] Then, for each driving time i, city j=1 to N total For each (line 14), the processor finds the position of the equal point Lat c [i], Long c [i] and the location of city j, Lat j , Long j Calculate the distance ED between (line 15), and the calculated distance ED is the minimum distance ED min If it is shorter (line 16), the variable ED min , Practical city location Lat p [i], Long p [i], city ID City_ID[i], distance ED and position Lat of city j j, Long j and update it to city identifier j (lines 17-19).
[0042] In this manner, the processor detects the city ID City_ID[i] of the practical city that is closest to the start position of each section.
[0043] [Fourth stage: Power consumption prediction (S4_1, S4_2, Line 24-30, Line 31-33)] In the fourth stage, the processor calculates the predicted power consumption of the EV for one trip. pred to 0 (line 24). Then, in lines 25-32, the processor prepares a sample S[0:13] of the array of 13 input data to the model M for section i=0 to DoD - 1 corresponding to the driving time (lines 26-30), and executes the power consumption prediction model M(S) to perform power consumption prediction (line 31).
[0044] That is, the processor executes the following in lines 26-30:
number
[11] , S
[12] ). The processor also extracts the temperature, precipitation, humidity, and wind speed from the weather data for the time ts + i-1 and the city ID City_ID[i] (S[2] to S[4]). The processor also extracts the latitude Lat p and longitude Long p (S[6], S[7]). The extracted data is input into the array of input samples S[0:12].
[0045] Finally, input the input sample S[0:12] to model M, run model M(S) to predict the power consumption of the section, and obtain the predicted value of the EV’s power consumption for one trip, PC pred(Line 31) After the prediction for each section is completed, the final predicted value of the power consumption is pred is obtained (line 33).
[0046] As described above, the multi-stage power consumption prediction program of this embodiment is executed by the processor of the EV, and model M is executed in each of multiple sections (divided routes) obtained by dividing the driving route from the starting point to the destination of one EV drive at one or more equal points or the positions of practical cities close to the equal points. That is, the start time of the section, weather information at the start time, geographic information (location information) of the start position, user information, driving time, and EV information are input into model M as a power consumption prediction model (program), and power consumption in the section is predicted. Furthermore, the power consumption predicted in the multiple sections is added up to calculate the power consumption in one EV drive.
[0047] The sections may divide the driving route from the starting point to the destination at equal points. The driving route from the starting point to the destination may be a straight line connecting the starting point and the destination, or may be a road route from the starting point to the destination searched by a navigation program.
[0048] [How to generate a power consumption prediction model] The power consumption prediction model program within the multi-stage power consumption prediction program is a neural network model program, as shown in Figure 3. Therefore, the power consumption prediction model executed by each EV node needs to fine-tune its internal parameters (weight w and bias b) using training data. However, because the amount of training data acquired by each EV while driving is limited, it is difficult to improve the accuracy of the model if each EV trains its own power consumption prediction model with its own training data.
[0049] Therefore, in this embodiment, a power consumption prediction model is trained and generated by federated learning in which a large number of EVs (EV fleets) participate. In order to prevent malicious third parties from participating in the federated learning by the EV fleets, the blockchain network integrates the EV fleets that train local models, an aggregator that aggregates the local models of the EV fleets, and a miner group. Specifically, the blockchain miners are the nodes (computers) of the EVs in the EV fleets.
[0050] However, the transmission of update data of the local models trained by each of the EV nodes to the aggregator via the blockchain network reduces the efficiency of the blockchain. Therefore, in this embodiment, a secure semi-distributed federated learning-based framework for training a power consumption prediction model is provided in a framework that does not reduce the efficiency of the blockchain network and can prevent attacks by malicious third parties.
[0051] [A secure semi-distributed federated learning-based framework] FIG. 6 is a diagram showing a semi-distributed federated learning-based framework in this embodiment. In the framework shown in FIG. 6, multiple EV nodes EV_1, EV_i, EV_n, an aggregator (computer) AGR, and multiple miners MNR_1 to MNR_m are integrated into a blockchain network BLKC_NW shown by a dashed line. A local network L_NW from the EV nodes EV_1 to EV_n to the aggregator AGR is not a blockchain network. In addition, the miners MNRs are the EV nodes themselves of mobile bodies, but in FIG. 6, the EV nodes and the miners MNRs are shown separately for the sake of explanation.
[0052] The outline of the framework's processing is as follows.
[0053] Each EV node (EV edge computer) trains a power consumption prediction model, local models LMDL_1 to LMDL_n, included in a multi-stage power consumption prediction program for predicting power consumption. Then, the parameters of the local models are uploaded to the aggregator AGR. Specifically, the parameters of the local models are parameters such as weights and biases or parameter update data (parameter update values obtained by multiplying the weights and biases of the model error E or the gradients by the learning rates). Hereinafter, these are simply referred to as local model parameters.
[0054] The aggregator AGR runs a Federated Learning Algorithm for Qualified Local Model Selection (FL-QLMS) to collect parameters of local models and aggregate them to obtain parameters of a global model.
[0055] The miner concatenates a block that stores transactions of the parameters of the global model to the blockchain ledger and broadcasts it to the EV nodes, and each EV node obtains the parameters of the global model from the blockchain ledger. The above process is repeated to generate a global model with the desired accuracy.
[0056] FIG. 7 is a diagram showing the hardware configuration of the EV node, the aggregator AGR, and the miners MNRs included in the semi-distributed federated learning framework. Each EV node EV_1 to EV_n of EV Freak is an edge computer provided in the EV. This edge computer has a processor 10, a main memory 12 accessed by the processor, a network interface 14, a storage, and a bus 28 connecting them. The storage stores a training program 20 for the local model, training data 22, and programs and parameters 24 for the local model and the global model.
[0057] The aggregator AGR is a high-performance computer such as a server or a supercomputer. The aggregator AGR has a processor 10, a main memory 12, a network interface 14, a storage, and a bus 28 connecting them. The storage stores an aggregation program 30, local model programs and parameters 32 uploaded from each EV node of the EV fleet, and a global model program and parameters 34 that aggregate the parameters of the local models.
[0058] The miner's computer MNRs has a processor 10, a main memory 12, a network interface 14, a bus 28, and storage, and has a mining program 40 stored in the storage, transactions 42 which are parameters of the global model provided by the aggregator, and data 44 of the block to be added to the blockchain ledger.
[0059] 8 is a diagram showing a flowchart of the process of the EV nodes of the EV fleet, the aggregator AGR, and the miners MNRs in the semi-distributed federated learning framework. The process of the framework will be described in detail with reference to FIG. 6 and FIG. 8.
[0060] The framework process consists of the following five steps S11 to S15.
[0061] First step S11 In the first training round, each EV node initializes a local model and trains each local model with training data acquired during the operation of each EV (the training data includes neural network input data and power consumption output data) (S11_1). From the second training round, each EV node trains a global model with the training data of each EV, and the trained global model becomes the local model of each EV (S11_2). These trainings are performed by each EV node executing a learning program of the local model program.
[0062] Second step S12 Each EV node has a local model M local The parameters (or their updated data) are uploaded to the aggregator AGR (S12). This upload is performed via the local network L_NW on the Internet without using the blockchain.
[0063] Third step S13 The aggregator AGR collects the parameters of the local models transmitted from each EV node, and applies the FL-QLMS algorithm as a local model selection process to select parameters of the local models to be aggregated into parameters of the global model (S13_1). Then, the aggregator aggregates the parameters of the selected local models to generate the global model M global In the aggregation by the aggregator, for example, an average of parameters of the selected local models is calculated.
[0064] Here, the aggregator checks whether the accuracy of the global model having the aggregated parameters exceeds a predetermined reference value TH (S13_3), and if YES, ends the model generation process. If NO, records the parameters of the global model as metadata in the new transaction TX0 (S13_4). Then, the aggregator inputs the transaction TX0 into a hash function H to generate a hash value H(TX0), and generates an encrypted message using the hash value H(TX0) and a private key by a signature algorithm (S13_4). The aggregator generates a transaction TX including the new transaction TX0, the encrypted message, and the public key, and broadcasts the transaction TX to all miners' computers (S13_4).
[0065] Fourth step S14 The miner's computer MNRs authenticates the received transaction TX and stores the authenticated transaction in a block (S14_1). That is, the miner computer generates a hash value H1 of the new transaction TX0 using the same hash function H as the aggregator, and decrypts the encrypted message with the public key to extract the hash value H(TX0). The miner computer checks whether the hash value H1=the hash value H(TX0), and if YES, the digital signature is proven to be valid and the received transaction TX is authenticated. Then, the miner computer adds the authenticated transaction TX to the transaction pool of each EV node (S14_1).
[0066] When the miner computer authenticates the transaction TX, it adds it to the block (S14_2). The block header of the block includes, for example, a 32-byte hash of the previous block, a 32-byte Merkle root (the Merkle root of the hash of multiple transactions in transaction TX), a 4-byte timestamp, a 4-byte difficulty target, and a 4-byte nonce. The nonce is a 32-bit target, and is detected by the miner by solving the following equation. Here, H(M+nonce) is a hash function that calculates (1) the hash of the previous block and data other than the nonce, such as transaction TX (let it be M), and (2) the hash of the nonce. The first n bits of 0 on the right side of the following equation correspond to the difficulty target. The more n given in advance, that is, the smaller the hash value, the higher the difficulty.
[0067]
number
[0068] Fifth step S15 Each EV node downloads the global model parameters from the distributed ledger and sets them as local model parameters for the next cycle (S15). A parameter update method when the parameters are update data for parameters will be described later.
[0069] [How to select parameters of local models eligible to be aggregated in federated learning (FL-QLMS algorithm)] In the above semi-distributed federated learning-based framework, the parameters of each EV’s local model are transferred to the aggregator without using blockchain, which creates a risk that the parameters of a malicious third party’s local model may be transferred to the aggregator.
[0070] Therefore, in this embodiment, in order to ensure the robustness of the aggregation of parameters of local models, the aggregator selects those to be aggregated from the transferred parameters of local models based on the FL-QLMS algorithm.
[0071] The FL-QLMS algorithm selects local model parameters with quality worthy of aggregation. In general, if the distribution of local model parameters is similar to that of global model parameters, the convergence tendency is also considered to be similar. Similar data distribution means that the difference between the two data is small. If the difference between the two data is small, the local model parameters are considered to contribute to parameter aggregation. On the other hand, if the local model parameters are contaminated or provided by malicious attacks, the difference between the contaminated or provided local model parameters and the global model parameters will be large.
[0072] Therefore, the FL-QLMS algorithm selects the parameters of the local model that are similar to the distribution of the parameters of the global model. The data discrepancy between the two models is calculated by the following formula:
[0073]
number
[0074] Next, we first describe the process of federated learning of N EV nodes, and then show the process of selecting parameters of the local model by the FL-QLMS algorithm. Each training round of federated learning consists of the following six steps.
[0075] (1) Each EV node trains its local model using the driving data set it has collected as training data. In this training, each EV node calculates the gradient of the following equation, for example, by adaptive moment estimation optimization. This gradient is update data for the weight W and bias b, which are parameters of local model i, and is data required to update the weight W and bias b included in the parameters.
number
[0076] (2) Each EV node calculates the parameters D i local Upload to the aggregator. D i local is the set of parameters for EV node i (i∈N). For example, the two gradients ∇g i L,W、 ∇g i L,b Since this gradient is calculated for the number of weights W and biases b, the data size is the number of weights W and biases b of the local model. The aggregator is notified of this data size from each EV node.
[0077] (3) The aggregator selects the quality data D of the uploaded local model parameters that contribute to the aggregation based on the FL-QLMS algorithm. i localThe number of selected local models is, for example, α% of the number of all local models.
[0078] (4) Data D of the selected local model i local Before aggregating, the contribution of each local model to the global model is calculated. The contribution of local model i is, for example, Contribution degree i local = Data volume of model i |D i local |÷Total data volume of all selected modelsΣ| D m local |
[0079] (5)Then, the aggregator calculates the parameters ∇g of the selected local model i as follows: i L,W、 ∇g i L,b Contribution w i local Then, we multiply the weights by ∇g G,W、 ∇g G,b Calculate.
number
[0080] (6) Each EV node downloads the parameters of the global model from the blockchain ledger. Each EV node uses the parameters of the global model obtained from the blockchain ledger to update the parameters of the global model (weights W and biases b) in the rth training of each EV as follows, and obtains the parameters of the global model for the r+1th training.
number
[0081] In the above example, each EV node has a local model, which is the weights W of the loss function E and the gradient ∇g i L,W、 ∇g i L,b However, the local model that each EV node uploads to the aggregator uses the learning rate η as the gradient ∇g i L,W、 ∇g i L,b The updated values of weights W and bias b multiplied by η∇g i L,W、 η∇g i L,b In that case, the above formula 13 can be expressed as the update value η∇g i L,W、 η∇g i L,b Contribution w i local The weights are multiplied and summed to obtain the global model parameter update value η∇g G,W、 η∇g G,b Calculate.
[0082] Furthermore, the local model that each EV node uploads to the aggregator is the rth parameter W r and b r From the above update value η∇gi L,W、 η∇g i L,b The parameter W for the r+1th time calculated by subtracting r+1 and b r+1 In that case, the above formula 13 is the parameter W r+1 and b r+1 Contribution w i local The weights are multiplied by the weights and summed to aggregate. The computational load of each EV node is light because the parameters of the local model uploaded to the aggregator are the gradient ∇g i L,W、 ∇g i L,b This is the case.
[0083] Here, the merit of using the blockchain in the semi-distributed federated learning-based framework of this embodiment to download the global model to each EV node will be described. The reason for using the blockchain in the semi-distributed federated learning-based framework is the secure protection of the parameters of the global model. When the aggregator transmits the global model to each EV node, a malicious attacker can easily hack and modify the global model. Therefore, the global model must be securely protected during transmission.
[0084] In this embodiment, in each cycle of federated learning, the parameters of the global model aggregated by the aggregator are stored in a transaction, and the transaction is stored in a new block. When a new block is authenticated through the blockchain consensus mechanism, the new block is added to the blockchain ledger and broadcast. Then, each EV node takes only the new block from the ledger and obtains the latest global model parameters. In the blockchain framework, it is virtually impossible for a malicious attacker to tamper with transactions in a block of the ledger. Also, in this embodiment, the parameters of one global model are simply stored in a new block as a transaction, and the process of authenticating a new block is relatively light, and the processing of the blockchain with only the parameters of one global model as a transaction is relatively efficient.
[0085] Next, two examples of the FL-QLMS algorithm are described.
[0086] [FL-QLMS algorithm (1)] FIG. 9 is a diagram showing pseudocode of the program of the FL-QLMS algorithm (1) using the auxiliary model. First, the aggregator prepares the auxiliary model M aux and a set of local models {M i local}(i∈N), the total number of EV nodes N, and a parameter α are prepared. aux is the gradient ∇g of the parameters of the local model of a given number of EV nodes (e.g., weights W and biases b). G ) is a set of
[0087] The aggregator performs the following to obtain a list of the local models selected for aggregation: The aggregator obtains an empty model list M that is used to store the selected local models. selected (Line 1). Next, the aggregator initializes the auxiliary model M auxLet all the parameters (weights and bias gradients) of aux (Line 2). Furthermore, the aggregator saves each local model M i local The parameters of (weight and bias gradients) are also one-dimensional vectors P i local Save it as (line 3). P aux and P i local and are the same number of data, i.e., |P aux |=|P i local |Becomes true.
[0088] Then, for each model i, the aggregator calculates P based on the Manhattan distance as follows: aux and P i local Dissimilarity between DI aux,i Calculate (lines 4-6).
[0089]
number
[0090] Next, the aggregator performs dissimilarity DI aux,i Select the (α%*N) or a given number of local models with the lowest (most similar) selected (Line 7). Then, the aggregator stores the model list M selected is output as the model to be aggregated (line 8).
[0091] 10 is a diagram showing a specific example of the FL-QLMS algorithm (1). In this specific example, the local models LMDL_1 to LMDL_4 of the EV nodes EV_1 to EV_4 each have three parameters. Correspondingly, the data sets DATA_S_1 to DATA_S_4 of the EV nodes EV_1 to EV_4 have three parameters. It is assumed that the one-dimensional vector of the parameters obtained by training the local models of the EV nodes EV_1 to EV_4 is [1,2,1], [3,2,0], [5,2,2], [-1,-2,10], and the one-dimensional vector of the parameters of the auxiliary model A_MDL of the aggregator AGR is [3,2,1].
[0092] In this case, the dissimilarity DI of each local model to the auxiliary model aux,i is the sum of the differences in each parameter value, as shown in the table in the figure. If the ratio α of local models to be selected is 50%, then models 1 and 2, which have the lowest dissimilarity among the four local models, will be selected. The aggregator then aggregates the average value of the one-dimensional vector of the post-training parameters of the two selected models as the parameters of the global model.
[0093] [FL-QLMS algorithm (2)] FIG. 11 shows a pseudocode of the program of the FL-QLMS algorithm (2) without using an auxiliary model. First, the aggregator needs to obtain a set of local models {M i local}(i ∈ N), the total number of EV nodes N, and a parameter α are prepared.
[0094] The aggregator performs the following to obtain a list of the local models selected for aggregation: The aggregator obtains an empty model list M that is used to store the selected local models. selected (Line 1). Then, the aggregator initializes each local model M i local The parameters of (weight and bias gradients) are also one-dimensional vectors P i localSave it as (line 2). P aux and P i local and are the same number of data, i.e., |P aux |=| P i local |Becomes true.
[0095] Next, the aggregator calculates the one-dimensional vector P i local and the j-th (j ∈ N, j≠i) local model P j local Dissimilarity to DI ij is calculated using the following formula (lines 3 to 6).
[0096]
number
[0097]
number
[0098] The local models with low average dissimilarity (local models with high similarity) obtained above are considered to be more representative local models among the N local models. In other words, the local models with low average dissimilarity have a similar distribution to the whole local models. Therefore, the aggregator selects parameters of α% or a predetermined number of local models with low average dissimilarity and collects them into the model list M selected (Line 9). Then, the aggregator stores the model list M selected is output as the model to be aggregated (line 10).
[0099] [Electricity trading processing for electric vehicles] According to the above embodiment, the EV can predict the power consumption due to future operation with high accuracy, whether the EV is connected to a charging station or not. Therefore, when the EV node receives an energy request from the power grid, the EV node predicts the power consumption due to future operation and responds to the power grid with an energy offer with the amount of power that can be discharged. The power trading process between the EV node and the power grid will be described below.
[0100] Fig. 12 is a diagram showing a flowchart of the energy trading process by the EV node. As described in Fig. 1, when the power grid transmits a power request to the aggregator, the aggregator broadcasts an energy supply request to the EV node (S20). In response to the energy supply request, the EV node (EV edge computer) extracts the current energy (electricity) CE from the state of the secondary battery (S21) and determines whether or not an energy offer is possible (S22). If it is determined that it is possible (YES in S22), if the EV is connected to the charging station (YES in S23), and if no future driving is scheduled (NO in S24), the EV node transmits an energy offer EO to the aggregator with an energy amount equal to or less than the current energy CE (S25).
[0101] On the other hand, if future driving is planned (YES in S24), the EV node predicts the power consumption EC for the future driving and calculates the remaining energy RE (=CE - EC) after the future driving (S26). If the remaining energy RE is positive (RE > 0) (YES in S27), the EV node transmits an energy offer EO to the aggregator with an energy amount equal to or less than the remaining energy RE (S28). If the remaining energy RE is not positive (NO in S27), the EV node does not transmit an energy offer EO to the aggregator.
[0102] If the EV is not connected to the charging station when the energy request is received (NO in S23) and the EV is traveling toward the charging station (YES in S29), the EV node predicts the power consumption EC for traveling to the charging station and calculates the remaining energy RE (=CE - EC) after the current traveling to the charging station (S30). At this time, if a future driving is planned after arriving at the charging station, the EV node may also predict the power consumption of the future driving and calculate the remaining energy RE when arriving at the charging station after the future driving. Then, if the remaining energy RE is positive (RE > 0) (YES in S31), the EV node transmits an energy offer EO to the aggregator with an energy amount equal to or less than the remaining energy RE (S32). If the remaining energy RE is not positive (NO in S31), the EV node does not transmit the energy offer EO to the aggregator.
[0103] As described above, the EV node can execute the power consumption prediction model program to calculate the remaining energy after future driving with high accuracy, so when the EV node receives an energy supply request, it can transmit an energy offer to the aggregator regardless of whether it is connected to a charging station or not.
[0104] 13 is a flowchart of a first energy trading process by an aggregator. The aggregator first receives energy requests ED from energy consumers and a list (set) of energy offers received from EV nodes {EO i} i∈n n is the number of EV nodes that have sent energy offers (S40). Then, the aggregator obtains a list (set) of the amount of energy supply ES from each EV {ES i} i∈n is initialized (S41).
[0105] If the total amount of energy offered by the energy offer EO is equal to or greater than the energy request ED (YES in S42), the aggregator notifies all EV nodes that offered energy of power discharge (S43). In this case, the amount of power discharge of each EV, i.e., the amount of energy supply ES i The aggregator then substitutes the amount of energy in the energy offer EO into the energy amount (S43). Then, the aggregator notifies the power grid of the total energy offer (S44).
[0106] On the other hand, if the total amount of energy in the energy offer EO is not equal to or greater than the energy request ED (NO in S42), the aggregator notifies all EV nodes that have offered energy not to discharge power (S45).Furthermore, the aggregator notifies the power grid that it cannot provide power discharge (S46).
[0107] 14 is a diagram showing a flowchart of a second energy trading process by an aggregator. The aggregator first receives energy requests ED from energy consumers and a list (set) of energy offers received from EV nodes {EO i} i∈n The aggregator receives the energy offers from each EV, and the energy offers are sent to the EVs (S50). n is the number of EVs that have sent energy offers. The aggregator then receives a list (set) of the amount of energy offered by each EV, ES, {ES i} i∈n In addition, the aggregator initializes the discharge amount {EO i} i∈n are rearranged in descending order (S52).
[0108] If the total amount of energy in the energy offer EO is greater than or equal to the energy request ED (YES in S53), the aggregator i} i∈n In descending order, select the energy offers of each EV one by one until its energy requirement ED is satisfied.
[0109] That is, the aggregator collects a list of energy offers {EO i}i∈n The order i of EV is set to i=1 (S54), and the energy offer EO i is equal to or less than the energy request ED (S55). If it is equal to or less than the energy request ED (YES in S55), the aggregator i The amount of energy supply in ES i (S57). As a result, the i-th EV becomes a target for power discharge in the energy offer. The aggregator then subtracts the amount of energy supply ESi from the energy request ED and increments the order i (i=i+1) (S57).
[0110] The aggregator repeats the above-mentioned processes S55 and S57 for the incremented order i. i When is no longer equal to or smaller than the energy requirement ED (NO in S55), the aggregator i The amount of energy supply in ES i (S56). This makes the i-th EV the target for power discharge in the final energy offer. As a result, the aggregator notifies all EV nodes whether they will discharge power or not (S58). The amount of power discharged by the i-th EV selected as the target for power discharge is calculated based on the energy supply amount ES i (= Energy Offer EO i ) (S58). Then, the aggregator notifies the power grid of the total energy offer (S59).
[0111] If the total amount of energy in the energy offer EO is not equal to or greater than the energy request ED (NO in S53), the aggregator notifies all EV nodes that have offered energy not to discharge power (S60). Furthermore, the aggregator notifies the power grid that it cannot provide power discharge (S61).
[0112] [Evaluation of a multi-stage electricity consumption prediction program] The multi-stage power consumption prediction program uses training data obtained from driving multiple EVs to train the power consumption prediction model and adjust the model parameters. The training data includes meteorological information, geographical information, user information, and vehicle information.
[0113] 15 is a diagram showing a table of training data used for training the power consumption prediction model of the present embodiment to be evaluated. The values (Value), units (Unit), and data types (Datatype) of the training data are as follows, as shown in TABLE 5 of FIG. Vehicle departure times and days: from 0:00 to 23:00, 1-7 Weather Data: Weather data for 63 cities in Japan from December 2019 to November 2020 Temperature, precipitation, humidity, wind speed: -13.6~39.5℃, 0~97.5mm, 0.05~1, 0~26.2m / s Geographic information (latitude, longitude): 34.09~41.3°N, 134.84~141.94°E Driver information (gender, age): 0-1 (M / F), 21-69 years old Operation time DoD: 1-12 hours EV information (model, year): Model name, 2013~2022
[0114] The inventors trained and evaluated the multi-stage power consumption prediction program in a federated learning environment with the number of EV nodes N=63, with a total number of data sets of 66,000, the number of training samples of 63,000, and the number of test samples of 3000. In the evaluation, the multi-stage power consumption prediction program (M_PCP) was compared with the power consumption prediction program (PCP) described in Non-Patent Document 2 in terms of the root mean square error (RMSE) of the model. In addition, as shown in the driving activity table in TABLE 6 of FIG. 15, the driving distance was divided into short distance, medium distance, long distance, and the total distance including all of them, and the comparison was made. The PCP in Non-Patent Document 2 does not divide the driving route between the start position and the destination position of one driving into multiple divided routes, but inputs the input data of the start position into a neural network and predicts the power consumption as output data.
[0115] FIG. 16 is a diagram showing the evaluation results of the model. In all of (a) the entire distance, (b) short distance, (c) medium distance, and (d) long distance, M_PCP of this embodiment has a lower RMSE than PCP of Non-Patent Document 2. In (d) the long distance, M_PCP of this embodiment divides the driving distance of one trip by the driving time and divides it into multiple sections, so the RMSE is sufficiently lower than that of PCP of Non-Patent Document 2. Even in (b) the short distance, the RMSE of M_PCP of this embodiment is appropriately low. The variance σ of M_PCP of this embodiment in medium and long distances 2 The reason is thought to be that the power consumption prediction model predicts the power consumption for each section and adds them together, so the variance of each prediction is added together by the addition operation.
[0116] As described above, the multi-stage power consumption prediction program in this embodiment divides the driving route for one drive into multiple sections based on the driving time, predicts the EV's power consumption in each section using a power consumption prediction model composed of a neural network, and adds up these predictions to calculate the total power consumption.
[0117] Furthermore, in this embodiment, in training the power consumption prediction model of the power consumption prediction program, each EV node trains each local model using the driving data of each EV as training data, and the aggregator repeatedly aggregates the parameters of the local models (parameters such as weights and biases or update data for those parameters) to generate parameters of the global model, performing federated learning. Blockchain is not used to transmit the parameters of the local model from the EV node to the aggregator, but blockchain is used to transmit the parameters of the global model from the aggregator to the EV node. This makes it possible to avoid a decrease in the efficiency of the blockchain.
[0118] In addition, in this embodiment, the aggregator selects local model parameters that are less dissimilar to the parameters of another model that serves as a reference from the parameters of the local models uploaded from multiple EV nodes, and aggregates the selected parameters. This makes it possible to suppress the impact of an attack by a malicious third party when uploading parameters of a local model to the aggregator without using a blockchain. [Explanation of symbols]
[0119] Electric vehicle: EV Power grid:P_GRD EV node, EV edge computer: EV_1~EV_n Power consumption prediction program: PCP_PRG Charging station: C_ST Aggregator: AGR EV selection program: EV_SLCT
Claims
1. A program for causing a computer to execute a process for predicting power consumption in a future operation of an electric vehicle, comprising: The prediction process includes: Calculating one or more intermediate positions for dividing a driving route from a starting point to a destination of a single driving of the electric vehicle into a plurality of divided routes; a power consumption prediction model program for estimating the power consumption of the electric vehicle on each of the divided routes by inputting a sample having a start time of the divided route, weather information at the start time of the divided route, geographic information of the divided route, information of a user who drives the electric vehicle, and driving time and electric vehicle information for each of the divided routes; The amount of power consumption estimated for each of the plurality of divided paths is added to calculate the amount of power consumption for the single operation. The power consumption prediction program for an electric vehicle.
2. The process of calculating the one or more intermediate positions includes calculating one or more equal points by dividing a straight line between the departure point and the destination by a driving time from the departure point to the destination, detecting a city closest to the one or more equal points, and setting the detected closest city as the intermediate position; The power consumption prediction program for an electric vehicle according to claim 1 , wherein the weather information is weather information from a weather forecast station in the nearest city.
3. The weather information of the divided route includes temperature, precipitation, humidity and wind speed; the geographical information of the divided route includes location information of a starting point and a destination of the divided route; The user information includes the age of the user, The electric vehicle information includes identification information and model year information of the electric vehicle; The power consumption prediction program for an electric power moving body as described in claim 1 or 2, wherein the power consumption prediction model is a neural network having an input layer having neurons for inputting each of the samples, a plurality of hidden layers each having a predetermined number of neurons, and an output layer having neurons for outputting the power consumption, and the plurality of hidden layers and the output layer are fully connected layers having neurons connected to a plurality of neurons in the previous layer by weighted links.
4. A method for generating a power consumption prediction model for predicting power consumption in a future operation of an electric vehicle, comprising: (a) receiving, via a communication network, parameters of a plurality of local models obtained by training local models of a plurality of electric moving bodies using training data obtained by operating each of the electric moving bodies, the parameters being parameters or parameter update data for updating the parameters; (b) aggregating parameters of a plurality of said local models to generate parameters of a global model; (c) storing the transactions including the parameters of the global model in a new block and causing a miner computer to append the new block to a blockchain ledger to generate a blockchain ledger; (d) receiving, via a communication network, parameters of a plurality of updated local models obtained by further training an updated local model using the parameters of the global model downloaded from the ledger using the training data; (e) A method for generating a power consumption prediction model, comprising repeating (b), (c), and (d) using the updated local model as the local model.
5. 5. The method for generating a power consumption prediction model according to claim 4, further comprising the steps of: selecting, from among the received parameters of the plurality of local models, parameters of the local models having a predetermined ratio or a predetermined number of vectors that have a lower dissimilarity to the vectors of parameters of an auxiliary model trained using the training data; and aggregating the parameters of the selected local models to generate parameters of the global model.
6. 5. The method for generating a power consumption prediction model according to claim 4, further comprising the steps of: selecting, from among the received parameters of the plurality of local models, parameters of the local models having a predetermined ratio or a predetermined number of vectors that have lower dissimilarity to vectors of parameters of a plurality of other local models; and aggregating the parameters of the selected local models to generate parameters of the global model.
Citation Information
Patent Citations
Malicious model detection method and device, server and storage medium
CN113886813A
Method for operating an electrical on-board network of a motor vehicle using artificial intelligence and corresponding overall system
DE102018211575A1
System and method of decentralized machine learning using blockchain
EP3564873A1
Energy transaction management system
JP2020064490A
Energy transaction support system, method, and program
JP2021039684A
