Power data processing method, device, non-volatile storage medium and processor

Through asynchronous federated learning and deep Q network optimization strategies, the problems of low model iteration efficiency and high resource loss in traditional federated learning are solved, and efficient iteration and safe updates of the power data processing center are achieved.

CN114202070BActive Publication Date: 2024-10-15STATE GRID BEIJING ELECTRIC POWER CO +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111398305.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2024-10-15
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

Traditional synchronous federated learning has problems with low model training efficiency and dependence on equipment reliability in power data processing, resulting in the overall training speed being limited by the worst-performing equipment, and central nodes and equipment nodes are prone to tampering risks during the model aggregation process. , causing the model to collapse.

Method used

The asynchronous federated learning method is used to deliver the first global model to multiple power terminal devices, and receive the uploaded local models for aggregation. Bandwidth is allocated through scheduling optimization strategies to reduce resource loss, and the deep Q network model is used to optimize resource utilization, and gradually Iteratively update the global model.

Benefits of technology

It improves the global model iteration efficiency of the electric power data processing center, reduces resource consumption, enhances the stability and privacy security of the model, and avoids the risk of model collapse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114202070B_ABST
    Figure CN114202070B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, non-volatile storage medium and processor for processing power data. The method comprises: sending a first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; receiving a second number of first local models uploaded by the power terminal devices, wherein the second number is less than the first number, and the first local model is obtained by the power terminal devices using their local power data to train the first global model; aggregating the first global model and the second number of first local models to obtain a second global model. The present invention solves the technical problem of low model iteration efficiency for processing power system data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power technology, and in particular to an electric power data processing method, device, non-volatile storage medium and processor. Background Art

[0002] The data processing center of the smart grid stores a huge amount of user data. When applying traditional machine learning methods to process data, it is necessary to first collect data from the user's local area to the data processing center, and then train the model in the data processing center. These models can be used for power load forecasting, power forecasting, power consumption forecasting, fault diagnosis of power equipment, parameter prediction and deduction, power grid system planning and evaluation, etc.

[0003] In this process, the user's power terminal needs to upload the original data, and the privacy content contained in the data will be exposed, which can be easily used by criminals to threaten corporate information security, national infrastructure security, etc. By adopting the method of federated learning, the data storage and model training phase of machine learning can be transferred to the local device, and the model can only be interacted with the central server, so as to decouple the model training from the data upload and effectively protect the privacy security of users. However, traditional synchronous federated learning has problems such as dependence on equipment reliability and training efficiency. On the one hand, the training efficiency of the entire federated learning system is closely related to the training efficiency of the equipment. There is a barrel effect in the training efficiency of different equipment, and the overall training speed often depends on the model training time of the worst-performing equipment. On the other hand, if the central node and the device node tamper with the model during the aggregation process, it may cause the entire model to collapse.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] Embodiments of the present invention provide a power data processing method, device, non-volatile storage medium and processor to at least solve the technical problem of low model iteration efficiency for processing power system data.

[0006] According to one aspect of an embodiment of the present invention, there is provided a method for processing power data, comprising: sending a first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; receiving a second number of first local models uploaded by the power terminal devices, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal devices using their local power data to train the first global model; and aggregating the first global model and the second number of first local models to obtain a second global model.

[0007] Optionally, when the second number is one, after aggregating to obtain the second global model, it further includes: receiving a third number of second local models uploaded by the power terminal device; aggregating the second global model with the third number of second local models according to predetermined rules to obtain a third global model, wherein the predetermined rules include: aggregating the second global model with one second local model at a time.

[0008] Optionally, the predetermined rule also includes that the second global model aggregates the model according to the following formula: (l) =(1-α (l) )ω (l-1) +α (l) ω new , where ω (l) is the second global model after the lth aggregation, ω (l-1) is the second global model after the l-1th aggregation, ω new represents a model in the second local model, α (l) Represents the proportion of a model in the second local model in the second global model.

[0009] Optionally, the receiving of the second number of first local models uploaded by the power terminal device includes: generating a scheduling optimization strategy based on the scheduling optimization model; allocating bandwidth for the action of uploading the model by the first number of power terminal devices based on the scheduling optimization strategy, wherein, when the first number of power terminal devices perform model training and uploading actions according to the allocated bandwidth, the overall resource loss of the first number of power terminal devices is minimal.

[0010] Optionally, based on the scheduling optimization model, a scheduling optimization strategy is generated, including: obtaining parameter information of the first number of power terminal devices; calculating the delay loss and energy loss when the power terminal devices perform model training and uploading actions according to the parameter information, the delay model and the energy consumption model; and generating the scheduling optimization strategy based on the delay loss, the energy loss and the scheduling optimization model.

[0011] Optionally, it is characterized in that the delay model is expressed by the following formula: T i =T i cmp +T i com , Among them, T i represents the delay loss when the i-th power terminal device performs model training and uploading actions, T i cmp represents the time taken by the i-th power terminal device to train the local model, ci N represents the number of CPU cycles required for the i-th power terminal device to train a data sample. i represents the total number of samples in the local training set of the i-th power terminal equipment, f i represents the CPU frequency of the i-th power terminal device, T i com represents the time taken by the i-th power terminal device to upload the local model, δ represents the size of the local model, and r i represents the average data transmission rate of the i-th power terminal device; the energy consumption model is expressed by the following formula: Among them, E i represents the energy loss of the i-th power terminal device when performing model training and uploading actions, represents the energy loss of the local model obtained by training the i-th power terminal device, where β represents the effective capacitance coefficient of the computing chipset of the i-th power terminal device, represents the energy loss of the i-th power terminal device uploading the local model, p i Represents the power of the i-th power terminal equipment.

[0012] Optionally, the scheduling optimization model includes: a deep Q network model, wherein the state, action and reward of the deep Q network model are determined according to the constraint condition of minimizing the overall resource loss of the first number of power terminal devices.

[0013] According to another aspect of an embodiment of the present invention, there is also provided a power data processing device, including: a sending module, used to send a first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; a receiving module, used to receive a second number of first local models uploaded by the power terminal devices, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal device using its local power data to train the first global model; and an aggregation module, used to aggregate the first global model and the second number of first local models to obtain a second global model.

[0014] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned power data processing methods.

[0015] According to yet another aspect of the embodiments of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned power data processing methods when running.

[0016] In an embodiment of the present invention, a first global model is sequentially sent to a first number of power terminal devices, wherein the first global model is used to process power data; a second number of first local models uploaded by the power terminal devices are received, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal devices using their local power data to train the first global model; the first global model and the second number of first local models are aggregated to obtain a second global model, thereby achieving the purpose of quickly iterating the global model of the power data processing center, thereby realizing the technical effect of improving the model iteration efficiency of the global model of the power data processing center, and further solving the technical problem of low model iteration efficiency for processing power system data. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0018] Figure 1 A hardware structure block diagram of a computer terminal for implementing a power data processing method is shown;

[0019] Figure 2 It is a schematic diagram of power system model training and data processing provided according to relevant technologies;

[0020] Figure 3 is a flow chart of a power data processing method provided according to an embodiment of the present invention;

[0021] Figure 4 is a schematic diagram of advantages of asynchronous federated learning provided according to an optional embodiment of the present invention;

[0022] Figure 5 is a structural block diagram of a power data processing device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0026] Federated learning, a distributed machine learning technology, helps multiple terminals achieve the effect of joint machine learning modeling while ensuring data privacy, security, legality and compliance.

[0027] Deep Q-network, a deep reinforcement learning algorithm, combines deep learning and Q-learning and is applied to scenarios that interact with the environment. For a given environmental state, the deep Q-network performs corresponding actions according to the strategy, which can change the environmental state of the environment and obtain a reward value after the action is executed. The network then updates the strategy based on the reward value.

[0028] According to an embodiment of the present invention, an embodiment of a method for processing power data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal for implementing the power data processing method is shown. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0031] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the power data processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the power data processing method of the above-mentioned application program is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0033] Figure 2 It is a schematic diagram of power system model training and data processing provided by relevant technologies, such as Figure 2As shown, in the related technology, the method of federated learning is used to send the global model from the power grid data center (i.e., the data processing center of the power grid) to each power terminal device. Each power terminal device uses the local data set to train the global model to obtain a local model, and then uploads the local model to the power grid data center. The power grid data center aggregates all uploaded local models at one time to iteratively update the global model of the power grid data center. This process has a barrel effect, that is, the iterative update speed is limited by the device that trains and uploads the model the slowest among all power terminal devices.

[0034] Figure 3 is a flow chart of a method for processing power data according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0035] Step S302: Sending the first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data.

[0036] In this step, the first global model may be a global model stored in a data processing center, which is connected to a first number of power terminal devices within its management area. The first global model may be used to perform functions such as power load forecasting, power forecasting, power consumption forecasting, fault diagnosis of power devices, parameter prediction and deduction, and power grid system planning and evaluation.

[0037] Step S304, receiving a second number of first local models uploaded by the power terminal device, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal device using its local power data to train the first global model.

[0038] In this step, the power terminal device generates local power data during operation, and each power terminal device can use the local power data to train the first global model it receives to obtain a first local model.

[0039] Step S306, aggregate the first global model and the second number of first local models to obtain a second global model. It should be noted that the second number of first local models may be the local models first received by the data processing center, and other power terminal devices may not have uploaded the local models to the data processing center due to slow training speed or poor network transmission. At this time, through this step, the first global model and the second number of first local models can be aggregated first, without having to wait for all local models to be uploaded before model aggregation, thereby improving the iteration efficiency of the model.

[0040] Through the above steps, in an embodiment of the present invention, the first global model is sent down to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; a second number of first local models uploaded by the power terminal devices are received, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal devices using their local power data to train the first global model; the first global model and the second number of first local models are aggregated to obtain the second global model, thereby achieving the purpose of quickly iterating the global model of the power data processing center, thereby realizing the technical effect of improving the model iteration efficiency of the global model of the power data processing center, and further solving the technical problem of low model iteration efficiency for processing power system data.

[0041] As an optional embodiment, when the second number is one, after aggregating to obtain the second global model, a third number of second local models uploaded by the power terminal device may be received; according to a predetermined rule, the second global model and the third number of second local models are aggregated to obtain a third global model, wherein the predetermined rule includes: the second global model is aggregated with one second local model each time. For the data processing center, each time an uploaded local model is received, the local model may be aggregated with the global model, and the global model may be updated step by step to improve the efficiency and flexibility of model iteration. At the same time, only one model is aggregated at a time, which may reduce the loss function and improve the model accuracy during the model iteration process.

[0042] Optionally, each power terminal device can first download the latest global model ω (or the parameters ω of the global model), and then start a new round of local training using the local data set. During the local training process, the i-th power terminal device can be denoted as D i , D i Use its local data i And the parameters ω of the global model are used to train the local model. The updating process can be expressed as Where h represents the number of local iterations, l represents the number of global model aggregations (epochs), and γ is the learning rate.

[0043] As an optional embodiment, the predetermined rule also includes that the second global model aggregates the model according to the following formula: (l) =(1-α (l) )ω (l-1) +α (l) ω new , where ω (l) is the second global model after the lth aggregation, ω (l-1) is the second global model after the l-1th aggregation, ω newrepresents a model in the second local model, α (l) Represents the proportion of a model in the second local model in the second global model.

[0044] In the above process, the data processing center reduces the loss function F(ω K ), where K represents the total training time for all devices, Where N D Indicates the number of electrical equipment, K i Indicates device D i The number of training rounds.

[0045] As an optional embodiment, receiving a second number of first local models uploaded by a power terminal device includes: generating a scheduling optimization strategy based on the scheduling optimization model; allocating bandwidth for the actions of uploading models by the first number of power terminal devices based on the scheduling optimization strategy, wherein when the first number of power terminal devices perform model training and uploading actions according to the allocated bandwidth, the overall resource loss of the first number of power terminal devices is the lowest.

[0046] In the process of interaction between the data processing center and the power terminal equipment, considering the limited resources of the wireless network environment, the overall efficiency can be improved by scheduling equipment to reduce the overall resource loss of the first number of power terminal equipment interacting with the data processing center.

[0047] As an optional embodiment, a scheduling optimization strategy is generated based on a scheduling optimization model, including: obtaining parameter information of a first number of power terminal devices; calculating the delay loss and energy loss when the power terminal devices perform model training and uploading actions according to the parameter information, the delay model and the energy consumption model; and generating a scheduling optimization strategy based on the delay loss, energy loss and the scheduling optimization model.

[0048] By establishing delay models and energy consumption models, the process of training and uploading models for power terminal equipment can be quantified.

[0049] In each iteration, each power terminal device first downloads the latest global model from the data processing center. Since the uplink bandwidth is much smaller than the downlink bandwidth, the time and bandwidth overhead of the device download can be ignored. After downloading the global model, each device trains the model locally, which incurs time overhead. After the local training process is completed, each device needs to upload its own model to the central server of the data processing center. Therefore, the total delay of each iteration process can be composed of the local training time and the time to upload the local model. The total delay is calculated by calculating the two parts of the delay. The establishment of the energy consumption model is similar to the delay model. The total energy consumption of each iteration process is composed of the computing energy consumption of local training and the communication energy consumption of uploading the local model. The total energy consumption is calculated by calculating the two parts of the energy consumption.

[0050] As an optional embodiment, it is characterized in that the delay model is expressed by the following formula: T i =T i cmp +T i com , Among them, T i represents the delay loss when the i-th power terminal device performs model training and uploading actions, T i cmp represents the time taken by the i-th power terminal device to train the local model, c i N represents the number of CPU cycles required for the i-th power terminal device to train a data sample. i represents the total number of samples in the local training set of the i-th power terminal equipment, f i represents the CPU frequency of the i-th power terminal device, T i com represents the time taken by the i-th power terminal device to upload the local model, δ represents the size of the local model, and r i represents the average data transmission rate of the i-th power terminal device; the energy consumption model is expressed by the following formula: Among them, E i represents the energy loss of the i-th power terminal device when performing model training and uploading actions, represents the energy loss of the local model obtained by training the i-th power terminal device, where β represents the effective capacitance coefficient of the computing chipset of the i-th power terminal device, represents the energy loss of the i-th power terminal device uploading the local model, p i Represents the power of the i-th power terminal equipment.

[0051] To calculate the delay loss, the local training time and the upload time can be calculated separately, and then the two can be added together. The local training time can be calculated by the following process: Since the size of each training sample of all devices is the same, the device D i The time required to complete local training is where c i Indicates device D i The number of CPU cycles required to train a data sample, which can be obtained by executing cycle monitoring; N i Indicates device D i The total number of samples in the local training set; f i Indicates device D i CPU frequency.

[0052] Calculate the upload time. Assuming that the local model size of all devices is the same, the time it takes for a device to upload a model can be expressed as: where δ is the size of the model, r i It is device D i The average transmission rate can be expressed by Shannon's formula: Where B is the bandwidth, h i It is device D i The channel gain, p i is the transmission power and N0 is the noise.

[0053] The process of calculating energy loss is similar. You can calculate the local training energy consumption and the communication energy consumption of uploading the local model separately, and then add the two together.

[0054] When calculating the local training energy consumption, the local training energy consumption can be expressed as Where β is the device D i Calculate the effective capacitance factor of the chipset.

[0055] When calculating the upload energy consumption, the upload energy consumption can be expressed as where p i For device D i of power.

[0056] As an optional embodiment, generating the scheduling optimization strategy based on the delay loss, the energy loss and the scheduling optimization model may include the following steps:

[0057] First, considering the limited power equipment resources, the optimization problem model is established as follows:

[0058]

[0059] F(ω K )<μ

[0060] f min <f i <f max

[0061]

[0062] Among them, the optimization goal is to minimize the latency energy consumption of all devices in the whole process, where λ is the balance weight between latency and energy consumption. This parameter can handle federated learning scenarios with different energy consumption and latency preferences. For example, when each device can be connected to a power source, energy consumption is no longer an important consideration, so λ can be set very small. The constraints are ① loss function constraint, which means that the loss function drops to a certain accuracy μ, ensuring the effect of federated learning; ② CPU frequency constraint, which means that the CPU frequency of the device cannot exceed its specified range; ③ total bandwidth constraint, which means that the sum of the bandwidth allocated to the device cannot exceed the total bandwidth limit.

[0063] Secondly, we can decompose the optimization problem and calculate the optimal local computing time. Due to the unpredictability of the network bandwidth environment, nonlinear constraints, and the independence and randomness of each device, the overall optimization problem is difficult to solve. Therefore, we decompose the original problem and first solve the problem of minimizing the delay and energy consumption during local training: After mathematical reasoning, we get the optimal f i * for Through the optimal f i * , get the optimal local computing time

[0064] Thirdly, based on deep reinforcement learning, we can consider adjusting bandwidth allocation for the process scheduling equipment of local training and uploading models of federated learning of power terminal equipment in a dynamic network environment, so as to achieve the goal of reducing latency and energy consumption.

[0065] As an optional embodiment, the scheduling optimization model can adopt a deep Q network model (Deep Q Net, referred to as DQN model), wherein the state, action and reward of the deep Q network model are determined according to the constraint condition of minimizing the overall resource loss of the first number of power terminal devices.

[0066] Specifically, we first model the DQN model. The basic elements such as state, action, and reward are modeled as follows:

[0067] 1) State: State information includes the following three types of information:

[0068] (a) The last upload time of each power terminal device The time of each device’s last round of upload provides a basis for selecting actions. We hope that devices that have just uploaded a round do not participate in this bandwidth allocation, because they may still be training locally at this time.

[0069] (b) The number of times each power terminal device uploads the local model Due to limited bandwidth, if one device frequently uploads models, it will take up opportunities for other devices to upload, which is a factor that needs to be considered.

[0070] (c) Local quality of power terminal equipment In the federated learning process, devices with higher local dataset quality have higher local model accuracy. For example, if the number of training samples of one device is higher than that of another device, we want it to have a larger weight.

[0071] Therefore, the state can be expressed as

[0072] 2) Action: An action can be expressed as a(t) = {a, a∈{1,2,...,N D}, where a represents the power terminal device that selects the allocated bandwidth at time slot t.

[0073] 3) Reward: When the DQN agent takes action a(t) in state s(t), it will receive a reward. Considering our optimization goal, the reward function aims to minimize the latency and power consumption of all devices while allowing DQN to meet safety and bandwidth constraints. Specifically, in time slot t, we allocate bandwidth to one of the power terminal devices. If the model can be uploaded in time slot t, then the power terminal device needs to train the local model, that is, it needs to The equipment has two states: one is that the power terminal equipment is undergoing local training and cannot upload the local model. In this case, allocating bandwidth is equivalent to wasting an opportunity, so a negative reward value is given; the other state is that the power terminal equipment can upload the model at this time, so a positive reward is given. In summary, the reward design is as follows:

[0074]

[0075] in Assume that all models have the same size, so the bandwidth required for uploading is the same, and the transmission power is the same, that is, and T i com The parameter η is a positive constant, and the parameter R is a negative constant. The reward function is designed so that the agent tends to choose idle objects with quality q i A good device allocates bandwidth and ensures that the same device does not frequently upload models, taking up the opportunity for other devices to upload.

[0076] Furthermore, DQN model training is performed on the first number of power terminal devices, so that the scheduling optimization strategy of the power terminal devices achieves the goals of optimizing delay and energy consumption.

[0077] Specifically, the training process of the DQN-based scheduling optimization strategy is as follows:

[0078] Step 1 Load the data set of power terminal equipment and the attributes of the equipment such as c i ,q i wait;

[0079] Step 2: First, initialize the experience replay pool D;

[0080] Step 2 Initialize the Q network and its neural network parameters ω Q ; Initialize the target Q network and its neural network parameters ωQ* ←ω Q ;

[0081] Step 3 loops through the period epoch=1,2,...,e:

[0082] Step 3.1 Initialize state s(t)

[0083] Step 3.2 Loop through the time slots timeslot = 1, 2, ..., T:

[0084] Step 3.2.1 Use the ∈-greedy strategy to take the action strategy a(t), select a random action with probability ∈, and select a(t) = argmax(Q(s(t),a(t);ω) with probability 1-∈. Q )

[0085] Step 3.2.2 Execute action a(t), get reward r(t) and reach the new state s(t+1);

[0086] Step 3.2.2 Go to device D selected by action a(t) i Sending business process notifications

[0087] Step 3.2.3 Store the sample (s(t), a(t), r(t), s(t+1)) into the experience replay pool D;

[0088] Step 3.2.4 Use the uniformly randomly sampled sample Minibatch (s(x), a(x), r(x), s(x+1)) in the experience replay pool to calculate the target Q value, y x = r(x) + γ max A Q*(s(x+1),r(x);ωQ*, update the Q network parameter ω to reduce the error function yx-Qs(x),a(x);ωQ2;

[0089] Step 3.2.5 Update the parameters of the base station planning target Q network every C steps, that is, ω Q* =ω Q .

[0090] Step3.3 End the timeslot loop;

[0091] Step 4 ends the epoch cycle.

[0092] After training and learning in the above steps, a scheduling optimization strategy can be generated, which can automatically allocate bandwidth to achieve the goals of optimal latency and energy consumption.

[0093] Figure 4Schematic diagram of the advantages of asynchronous federated learning provided according to an optional embodiment of the present invention, such as Figure 4 As shown, with synchronous federated learning, all power terminal devices need to complete the upload of local models before the data processing center can iterate the model, which results in a barrel effect. With the asynchronous federated learning method adopted by the present invention, power terminal devices can choose to upload local models at any time, which has the advantages of improving the convergence speed of the global model, making the model upload and download process more free, and achieving high system resource utilization.

[0094] According to an embodiment of the present invention, there is also provided a power data processing device for implementing the above power data processing method. Figure 5 is a structural block diagram of a power data processing device provided according to an embodiment of the present invention. Figure 5 As shown, the power data processing device includes: a sending module 52, a receiving module 54 and an aggregation module 56. The power data processing device is described below.

[0095] A sending module 52, used for sending the first global model to a first number of power terminal devices in sequence, wherein the first global model is used for processing power data;

[0096] A receiving module 54, connected to the sending module 52, is used to receive a second number of first local models uploaded by the power terminal device, wherein the second number is less than the first number, and the first local model is obtained by the power terminal device using its local power data to train the first global model;

[0097] The aggregation module 56 is connected to the receiving module 54 and is used to aggregate the first global model and the second number of first local models to obtain a second global model.

[0098] It should be noted that the sending module 52, receiving module 54 and aggregation module 56 correspond to steps S302 to S306 in Example 1, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0099] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one network device among multiple network devices of a computer network. The computer device includes a memory and a processor.

[0100] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the power data processing method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned power data processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0101] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: send the first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; receive a second number of first local models uploaded by the power terminal devices, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal device using its local power data to train the first global model; aggregate the first global model and the second number of first local models to obtain a second global model.

[0102] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0103] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the power data processing method provided in the first embodiment.

[0104] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0105] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: sending the first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; receiving a second number of first local models uploaded by the power terminal devices, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal devices using their local power data to train the first global model; and aggregating the first global model and the second number of first local models to obtain a second global model.

[0106] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0107] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0112] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing power data, characterized in that: include: Sending a first global model to a first number of power terminal devices in sequence, wherein the first global model is used to process power data; Receiving a second number of first local models uploaded by the power terminal device, wherein the second number is less than the first number, and the first local models are obtained by the power terminal device using its local power data to train the first global model; Aggregating the first global model and the second number of first local models to obtain a second global model; The receiving a second number of first local models uploaded by the power terminal device includes: Generate scheduling optimization strategy based on scheduling optimization model; Based on the scheduling optimization strategy, bandwidth is allocated for the first number of power terminal devices to upload the model, wherein when the first number of power terminal devices perform model training and uploading actions according to the allocated bandwidth, the overall resource loss of the first number of power terminal devices is the lowest; Among them, based on the scheduling optimization model, a scheduling optimization strategy is generated, including: Acquiring parameter information of the first number of power terminal devices; Calculate the delay loss and energy loss when the power terminal device performs model training and uploading actions according to the parameter information, the delay model and the energy consumption model; Generate the scheduling optimization strategy based on the delay loss, the energy loss and the scheduling optimization model; The delay model is expressed by the following formula: T i =T i cmp +T i com Among them, T i represents the delay loss when the i-th power terminal device performs model training and uploading actions, T i cmp represents the time taken by the i-th power terminal device to train the local model, c i N represents the number of CPU cycles required for the i-th power terminal device to train a data sample. i represents the total number of samples in the local training set of the i-th power terminal equipment, f i represents the CPU frequency of the i-th power terminal device, represents the time taken by the i-th power terminal device to upload the local model, δ represents the size of the local model, and r i represents the average data transmission rate of the i-th power terminal device; The energy consumption model is expressed by the following formula: Among them, E i represents the energy loss of the i-th power terminal device when performing model training and uploading actions, represents the energy loss of the local model obtained by training the i-th power terminal device, where β represents the effective capacitance coefficient of the computing chipset of the i-th power terminal device, represents the energy loss of the i-th power terminal device uploading the local model, p i Represents the power of the i-th power terminal equipment.

2. The method according to claim 1, characterized in that When the second number is one, after the second global model is obtained by aggregation, the method further includes: receiving a third number of second local models uploaded by the power terminal device; According to a predetermined rule, the second global model is aggregated with the third number of second local models to obtain a third global model, wherein the predetermined rule includes: the second global model is aggregated with one second local model at a time.

3. The method according to claim 2, characterized in that The predetermined rule also includes that the second global model aggregates the model according to the following formula: oh (l) =(1-a (l) )oh (l-1) +a (l) oh new , Among them, ω (l) is the second global model after the lth aggregation, ω (l-1) is the second global model after the l-1th aggregation, ω new represents a model in the second local model, α (l) Represents the proportion of a model in the second local model in the second global model.

4. The method according to claim 1, characterized in that The scheduling optimization model includes: a deep Q network model, wherein the state, action and reward of the deep Q network model are determined according to the constraint condition of minimizing the overall resource loss of the first number of power terminal devices.

5. A power data processing device, characterized in that: include: A sending module, used for sending a first global model to a first number of power terminal devices in sequence, wherein the first global model is used for processing power data; A receiving module, configured to receive a second number of first local models uploaded by the power terminal device, wherein the second number is smaller than the first number, and the first local model is obtained by the power terminal device using its local power data to train the first global model; an aggregation module, configured to aggregate the first global model and the second number of first local models to obtain a second global model; The receiving a second number of first local models uploaded by the power terminal device includes: Generate scheduling optimization strategy based on scheduling optimization model; Based on the scheduling optimization strategy, bandwidth is allocated for the first number of power terminal devices to upload the model, wherein when the first number of power terminal devices perform model training and uploading actions according to the allocated bandwidth, the overall resource loss of the first number of power terminal devices is the lowest; Among them, based on the scheduling optimization model, a scheduling optimization strategy is generated, including: Acquiring parameter information of the first number of power terminal devices; Calculate the delay loss and energy loss when the power terminal device performs model training and uploading actions according to the parameter information, the delay model and the energy consumption model; Generate the scheduling optimization strategy based on the delay loss, the energy loss and the scheduling optimization model; The delay model is expressed by the following formula: T i =T i cmp +T i com Among them, T i represents the delay loss when the i-th power terminal device performs model training and uploading actions, T i cmp represents the time taken by the i-th power terminal device to train the local model, c i N represents the number of CPU cycles required for the i-th power terminal device to train a data sample. i represents the total number of samples in the local training set of the i-th power terminal equipment, f i represents the CPU frequency of the i-th power terminal device, T i com represents the time taken by the i-th power terminal device to upload the local model, δ represents the size of the local model, and r i represents the average data transmission rate of the i-th power terminal device; The energy consumption model is expressed by the following formula: Among them, E i represents the energy loss of the i-th power terminal device when performing model training and uploading actions, represents the energy loss of the local model obtained by training the i-th power terminal device, where β represents the effective capacitance coefficient of the computing chipset of the i-th power terminal device, represents the energy loss of the i-th power terminal device uploading the local model, p i Represents the power of the i-th power terminal equipment.

6. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the power data processing method according to any one of claims 1 to 4.

7. A processor, characterized in that: The processor is used to run a program, wherein the program executes the power data processing method according to any one of claims 1 to 4 when running.