Global model generation method, device, equipment and medium based on power Internet of Things

By building a consensus matrix in the power Internet of Things and training local consensus model, the shortage of communication resources caused by the communication status of devices and servers in federated learning is solved, and the reliability and communication efficiency of the global model are improved.

CN114781540BActive Publication Date: 2025-02-07GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210500427.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2025-02-07
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

In the Internet of Things, when using federated learning training method to obtain the global model, the communication state between the device and the server can easily lead to a shortage of communication resources of the server, which in turn affects the reliability of the global model.

Method used

By obtaining the communication status between every two devices in the target cluster, determining the aggregate weight of each device, and building a consensus matrix, issuing it to each device for local consensus model training, avoiding the server's own training, thereby reducing the use of communication resources .

Benefits of technology

The collaboration capability of the consensus model is enhanced, the server communication resources are shortened, and the reliability and communication efficiency of the global model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781540B_ABST
    Figure CN114781540B_ABST
Patent Text Reader

Abstract

The present invention provides a global model generation method, device, equipment and medium based on the electric power Internet of Things. The global model generation method based on the electric power Internet of Things includes: obtaining cluster information of a target cluster. Obtaining the communication status between every two devices in the target cluster. Based on the communication status between every two devices, respectively determine the aggregation weight corresponding to each device in the target cluster, and construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster. Send the consensus matrix and the local initial model information corresponding to each device to each device. According to the distance between each device in the target cluster and the server, the device closest to the server is determined as the target device. Obtain the target consensus model information of the target device, and use the target consensus model corresponding to the target consensus model information as the global model of the target cluster. Through the present invention, the communication status of each device can be fully combined, thereby improving the reliability of the global model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a global model generation method, device, equipment and medium based on electric power Internet of Things. Background Art

[0002] The power Internet of Things is an application of the Internet of Things in the smart grid. It can improve the information level of the power system based on the integrated communication infrastructure resources and power system infrastructure resources, thereby improving the utilization efficiency of the existing infrastructure of the power system and providing important technical support for the power grid generation, transmission, transformation, distribution, and power consumption. Since the number of devices covered in the power Internet of Things is large and different devices need to meet different business requirements, in order to facilitate the server in the power Internet of Things to perform targeted management according to the requests sent by each device and reasonably allocate resources, a global model is deployed in the server so that the server can globally manage each device through the global model.

[0003] In related technologies, the global model is obtained through the training method based on federated learning. The models distributed in each device are trained separately, and the trained local initial model parameters are sent to the server for global aggregation, thereby obtaining a global model that facilitates the server to globally manage each device in the power Internet of Things.

[0004] However, when using this method to train the global model, if there are too many devices communicating with the server at the same time, it will easily lead to a shortage of communication resources on the server. As a result, during the global model training process, the model parameters obtained for global model training will be incomplete, thus affecting the reliability of the global model. Summary of the invention

[0005] Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that when a global model is obtained by a training method of federated learning, the reliability of the finally generated global model is affected by the communication status between the device and the server, thereby providing a global model generation method, device, equipment and medium based on the power Internet of Things.

[0006] According to a first aspect, the present invention provides a global model generation method based on the power Internet of Things, which is applied to a server in the power Internet of Things. The method comprises:

[0007] Acquire cluster information of a target cluster, the target cluster including a first number of devices, the cluster information including local initial model information corresponding to each device;

[0008] Obtaining the communication status between every two devices in the target cluster;

[0009] Determine the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster;

[0010] Sending the consensus matrix and local initial model information corresponding to each device to each device, so that each device generates a consensus model corresponding to the target cluster for each device based on the received local initial model information and consensus matrix corresponding to each device in the target cluster;

[0011] According to the distance between each device in the target cluster and the server, determining the device closest to the server as the target device;

[0012] The target consensus model information of the target device is obtained, and the target consensus model corresponding to the target consensus model information is used as the global model of the target cluster.

[0013] In this way, based on the communication status between every two devices in the target cluster, a consensus matrix that aggregates the local initial model information of each device in the target cluster can be determined, so that each device can fully combine the communication status between each device when generating the corresponding consensus model, thereby enhancing the collaborative ability of the consensus model. In addition, since the consensus model is a model obtained by consensus model training on the local device, it can be directly obtained from the device closest to the server without the need for the server to train itself, which helps to avoid excessive occupation of the server's communication resources during the training of the consensus model, resulting in a shortage of server communication resources, thereby helping to ensure the reasonable allocation of the server's communication resources while improving the reliability of the global model.

[0014] In combination with the first aspect, in a first embodiment of the first aspect, determining the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and constructing a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster, includes:

[0015] Determining the initial weight of each device relative to other devices in the target cluster according to the communication state of each device relative to the other devices;

[0016] Obtaining a reliability matrix corresponding to the target cluster based on the initial weights, wherein the initial weights are used to represent the reliability of each device relative to other devices in the target cluster;

[0017] Based on the communication status of each device relative to other devices in the target cluster, the reliability matrix is ​​subjected to convex optimization processing, and the matrix obtained after the processing is determined as a consensus matrix.

[0018] In this method, based on the communication status between each device, the consensus matrix corresponding to the target cluster is determined, so that the obtained consensus matrix can fully reflect the reliability of each device relative to other devices in the target cluster. When the local initial model information of each device is subsequently aggregated based on the consensus matrix, the communication status between each device can be fully combined, so that the generated consensus model can have strong collaborative capabilities and can effectively reduce the occurrence of delay effects during use.

[0019] In combination with the first aspect, in a second embodiment of the first aspect, the acquiring cluster information of the target cluster includes:

[0020] Acquire device information to be globally managed in the electric power Internet of Things, where the device information includes a second number of devices, and the second number is greater than the first number;

[0021] Divide the second number of devices into multiple clusters, and obtain cluster information of the target cluster, where the target cluster is one of the multiple clusters;

[0022] The method further comprises:

[0023] If the global model information of each cluster is obtained, based on the device information and the global model information of each cluster, an overall global model for global management of the electric power Internet of Things is obtained.

[0024] In this way, a clustered model is used to train the global model corresponding to each cluster, which can fully combine the communication status between devices, reduce the interference of invalid communication, and simplify the number of parameters for training the overall global model, thereby reducing the communication load of the server, so that the obtained overall global model is more reliable and scalable.

[0025] In combination with the second embodiment of the first aspect, in a third embodiment of the first aspect, obtaining the overall global model for global management of the power Internet of Things based on the device information and the global model information of each cluster includes:

[0026] Calculate the product of the global model information of each cluster and the corresponding first quantity respectively to obtain the aggregate model information corresponding to each cluster;

[0027] All the aggregated model information is added together and divided by the second number to obtain the total global model information used for global management of the electric power Internet of Things. The model corresponding to the total global model information is the total global model.

[0028] According to a second aspect, the present invention further provides a global model generation method based on the power Internet of Things, which is applied to a first device in the power Internet of Things, and the method includes:

[0029] Sending the local initial model information of the first device to a server in the electric power Internet of Things, so that the server obtains cluster information of a target cluster, the target cluster includes a first number of devices, the first device is one of the devices in the target cluster, and the cluster information includes the local initial model information corresponding to each device;

[0030] Respectively detecting the communication status between each device in the target cluster;

[0031] sending the communication status between each device in the target cluster to the server so that the server obtains the communication status between every two devices in the target cluster;

[0032] Receive a consensus matrix and local initial model information corresponding to each device sent by the server, wherein the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is a weight determined by the server based on the communication status between each two devices;

[0033] Generate a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster;

[0034] If the first device is the device closest to the server, the consensus model information of the consensus model is sent to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

[0035] In this way, the consensus model corresponding to the target cluster is trained by the devices in the target cluster, which helps to avoid the excessive occupation of the server's communication resources, resulting in a shortage of server communication resources. In addition, the consensus model generated by the device closest to the server is used as the global model for managing the target cluster, and then the consensus model information of the consensus model is sent to the server, which helps the server to quickly obtain the global model of the target cluster in a short time, thereby helping to reduce communication overhead and improve communication efficiency.

[0036] In combination with the second aspect, in a first embodiment of the second aspect, the local initial model information of the first device is first local initial model information;

[0037] The generating a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster includes:

[0038] For the current round of consensus model training, the received local initial model information and consensus matrix corresponding to each device in the target cluster are aggregated to obtain the local initial consensus model information corresponding to the first device;

[0039] Iteratively process the local initial consensus model information to obtain first consensus model information;

[0040] Comparing the first consensus model information with the first local initial model information to obtain update information of the first consensus model information;

[0041] Obtaining the convergence error of the previous round of consensus model training;

[0042] Based on the update information and the convergence error, determine the model cumulative update information of the consensus model training to obtain the model cumulative update value;

[0043] The cumulative update value of the model is compared with a specified update threshold. If the cumulative update value of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the first device corresponding to the target cluster.

[0044] In combination with the first embodiment of the second aspect, in a second embodiment of the second aspect, the method further includes:

[0045] If the cumulative update value of the model is greater than the specified update threshold, it is determined that the consensus model training is not completed;

[0046] The model cumulative update information is compressed to obtain second consensus model information, and the second consensus model information is used as the first local initial model information sent to other devices for the next round of consensus model training.

[0047] In combination with the second embodiment of the second aspect, in a third embodiment of the second aspect, before performing the current round of consensus model training, the method further includes:

[0048] Determine the first consensus model information obtained in the previous round of training as the first local initial model information for the current round of training;

[0049] If new first local initial model information sent by the other device is received, the current round of consensus model training is performed.

[0050] According to a third aspect, the present invention further provides a global model generation device based on the power Internet of Things, which is applied to a server in the power Internet of Things, and the device includes:

[0051] A first acquisition unit, configured to acquire cluster information of a target cluster, wherein the target cluster includes a first number of devices, and the cluster information includes local initial model information corresponding to each device;

[0052] A second acquisition unit, configured to acquire a communication status between every two devices in the target cluster;

[0053] A matrix construction unit, used to determine the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and to construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster;

[0054] A transmission unit, configured to send the consensus matrix and local initial model information corresponding to each device to each device, so that each device generates a consensus model corresponding to the target cluster for each device based on the received local initial model information and consensus matrix corresponding to each device in the target cluster;

[0055] a screening unit, configured to determine, according to the distance between each device in the target cluster and the server, a device closest to the server as a target device;

[0056] The third acquisition unit is used to acquire the target consensus model information of the target device, and use the target consensus model corresponding to the target consensus model information as the global model of the target cluster.

[0057] In combination with the third aspect, in a first embodiment of the third aspect, the matrix construction unit includes:

[0058] A first determining unit, configured to determine an initial weight of each device relative to other devices in the target cluster according to a communication state of each device relative to the other devices;

[0059] A matrix construction subunit, used to obtain a reliability matrix corresponding to the target cluster based on the initial weights, wherein the initial weights are used to represent the reliability of each device relative to other devices in the target cluster;

[0060] The first processing unit is used to perform convex optimization processing on the reliability matrix based on the communication state of each device relative to other devices in the target cluster, and determine the matrix obtained after the processing as a consensus matrix.

[0061] In combination with the third aspect, in a second embodiment of the third aspect, the first acquiring unit includes:

[0062] A device information acquisition unit, configured to acquire device information to be globally managed in the electric power Internet of Things, wherein the device information includes a second number of devices, and the second number is greater than the first number;

[0063] a dividing unit, configured to divide the second number of devices into a plurality of clusters, and obtain cluster information of the target cluster, where the target cluster is one of the plurality of clusters;

[0064] The device also includes:

[0065] The aggregation unit is used to obtain the global model information of each cluster in response to obtaining the global model information of each cluster, and obtain the overall global model for global management of the power Internet of Things based on the device information and the global model information of each cluster.

[0066] In combination with the second embodiment of the third aspect, in a third embodiment of the third aspect, the polymerization unit includes:

[0067] A first aggregation subunit is used to calculate the product of the global model information of each cluster and the corresponding first quantity to obtain the aggregation model information corresponding to each cluster;

[0068] The third processing unit is used to add up all the aggregated model information and divide it by the second number to obtain the total global model information used for global management of the power Internet of Things, and the model corresponding to the total global model information is the total global model.

[0069] According to a fourth aspect, the present invention further provides a global model generation device based on the power Internet of Things, which is applied to a first device in the power Internet of Things, and the device includes:

[0070] A first receiving unit is configured to send the local initial model information of the first device to a server in the electric power Internet of Things, so that the server obtains cluster information of a target cluster, the target cluster includes a first number of devices, the first device is one of the devices in the target cluster, and the cluster information includes the local initial model information corresponding to each device;

[0071] A detection unit, used to detect the communication status between each device in the target cluster respectively;

[0072] a first sending unit, configured to send a communication status between each device in the target cluster to the server, so that the server obtains a communication status between every two devices in the target cluster;

[0073] A second receiving unit is used to receive a consensus matrix issued by the server and local initial model information corresponding to each device, wherein the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is a weight determined by the server based on the communication status between each two devices;

[0074] A generating unit, configured to generate a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster;

[0075] The second sending unit is used to send the consensus model information of the consensus model to the server if the first device is the device closest to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

[0076] In combination with the fourth aspect, in a first embodiment of the fourth aspect, the local initial model information of the first device is first local initial model information, and the generating unit includes:

[0077] an aggregation unit, configured to aggregate the received local initial model information and consensus matrix corresponding to each device in the target cluster for the current round of consensus model training, to obtain the local initial consensus model information corresponding to the first device;

[0078] An iterative processing unit, configured to obtain first consensus model information by iteratively processing the local initial consensus model information;

[0079] a comparing unit, configured to compare the first consensus model information with the first local initial model information to obtain update information of the first consensus model information;

[0080] An error acquisition unit, used to obtain the convergence error of the consensus model training during the previous round of iterative processing;

[0081] An update determination unit, configured to determine the model cumulative update information of the consensus model training based on the update information and the convergence error, and obtain a model cumulative update value;

[0082] The first detection unit is used to compare the cumulative update value of the model with a specified update threshold. If the cumulative update value of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the first device corresponding to the target cluster.

[0083] In combination with the first embodiment of the fourth aspect, in a second embodiment of the fourth aspect, the device further includes:

[0084] A second detection unit, configured to determine that the consensus model training is not completed if the update information is greater than the specified update threshold;

[0085] A compression unit is used to compress the model cumulative update information to obtain second consensus model information, and use the second consensus model information as the first local initial model information sent to other devices for the next round of consensus model training.

[0086] In combination with the second embodiment of the fourth aspect, in a third embodiment of the fourth aspect, the device further includes:

[0087] An information determination unit, used to determine the first consensus model information obtained in the previous round of training as the first local initial model information for the current round of training;

[0088] A receiving detection unit is used to execute the current round of consensus model training if new first local initial model information sent by the other device is received.

[0089] According to the fifth aspect, an embodiment of the present invention also provides a computer device, including a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the global model generation method based on the power Internet of Things of the first aspect and any one of its optional embodiments, or executes the global model generation method based on the power Internet of Things of the second aspect and any one of its optional embodiments.

[0090] According to the sixth aspect, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the global model generation method based on the power Internet of Things of the first aspect and any one of its optional embodiments, or to execute the global model generation method based on the power Internet of Things of the second aspect and any one of its optional embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0092] Figure 1 It is a flowchart of a global model generation method based on the power Internet of Things proposed according to an exemplary embodiment.

[0093] Figure 2 It is a flowchart of a method for constructing a consensus matrix according to an exemplary embodiment.

[0094] Figure 3It is a flowchart of another global model generation method based on the power Internet of Things proposed according to an exemplary embodiment.

[0095] Figure 4 It is a flowchart of another global model generation method based on the power Internet of Things proposed according to an exemplary embodiment.

[0096] Figure 5 It is a flowchart of a consensus model training method proposed according to an exemplary embodiment.

[0097] Figure 6 It is a flowchart of another consensus model training method proposed according to an exemplary embodiment.

[0098] Figure 7 It is a structural block diagram of a global model generation device based on the power Internet of Things proposed according to an exemplary embodiment.

[0099] Figure 8 It is a structural block diagram of another global model generation device based on the power Internet of Things proposed according to an exemplary embodiment.

[0100] Fig. 9 It is a schematic diagram of the hardware structure of a computer device proposed according to an exemplary embodiment. DETAILED DESCRIPTION

[0101] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. 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 are within the scope of protection of the present invention.

[0102] In related technologies, the global model is obtained through the training method based on federated learning. The models distributed in each device are trained separately, and the trained local initial model parameters are sent to the server for global aggregation, thereby obtaining a global model that facilitates the server to globally manage each device in the power Internet of Things.

[0103] However, when using this method to train the global model, if there are too many devices communicating with the server at the same time, it will easily lead to a shortage of communication resources on the server. As a result, during the global model training process, the model parameters obtained for global model training will be incomplete, thus affecting the reliability of the global model.

[0104] In order to solve the above problems, a global model generation method based on the power Internet of Things is provided in an embodiment of the present invention, which is used in a computer device. It should be noted that its execution subject can be a global model generation device based on the power Internet of Things, and the device can be implemented as part or all of the computer device through software, hardware, or a combination of software and hardware. The computer device can be a terminal, a client, or a server. The server can be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer, a wearable device, and other smart hardware devices such as an intelligent robot. In the following method embodiments, the execution subject is taken as an example for explanation.

[0105] The server in this embodiment is applied to the electric power Internet of Things, and can perform targeted global management of multiple devices through a global model. The global model generation method based on the electric power Internet of Things provided by the present invention can determine the aggregation weight for aggregating the local initial model information of each device in the target cluster based on the communication status between every two devices in the target cluster, and then obtain the consensus matrix of the target cluster used for consensus model training. In order to save the communication resources of the server, the consensus matrix and the local initial model of each device are sent to each device respectively, and then each device is trained separately to obtain the consensus model of each device corresponding to the target cluster, which helps to avoid the situation in which the training process is affected by the shortage of communication resources of the server during the training process, and helps to improve the reliability of global model training. Using the consensus model trained by the device closest to the server in the target cluster as the global model of the target cluster helps to reduce the transmission delay of the server receiving the global model, thereby improving the transmission efficiency.

[0106] Figure 1 FIG. 1 is a flow chart of a method for generating a global model based on the power Internet of Things according to an exemplary embodiment. Figure 1 As shown, the global model generation method based on the power Internet of Things is applied to a server in the power Internet of Things, including the following steps S101 to S106.

[0107] In step S101 , cluster information of a target cluster is obtained.

[0108] In the embodiment of the present invention, the target cluster includes a first number of devices, which can be understood as the first number of devices being devices for global model training. The family information of the target cluster includes local initial model information corresponding to each device, which helps to determine the relevant information of the local initial model of each device.

[0109] In one example, the first number of devices may be devices in the power Internet of Things, where the communication distance between each two devices are within the same specified distance range. When the aggregation weight corresponding to each device is subsequently determined, the impact of the communication distance can be reduced and the collaborative efficiency can be improved.

[0110] In step S102, the communication status between every two devices in the target cluster is obtained.

[0111] In an embodiment of the present invention, the communication status between every two devices in the target cluster is obtained, so that the communication status of each device in the target cluster relative to other devices in the target cluster can be determined, and then it can be determined whether the device can interact normally with other devices when interacting with each other, and whether a delay effect is generated in the process of mutual communication.

[0112] In step S103, the aggregation weight corresponding to each device in the target cluster is determined based on the communication state between every two devices, and a consensus matrix corresponding to the target cluster is constructed through the aggregation weight corresponding to each device in the target cluster.

[0113] In an embodiment of the present invention, by determining the communication status between every two devices in the target cluster, the communication status between each device and other devices in the target cluster can be determined, which helps to determine whether the communication status between each device and other devices is stable during communication interaction.

[0114] Therefore, in order to avoid the situation where devices with abnormal communication status affect the effective aggregation of the consensus model during the training of the consensus model, the aggregation weight of each device relative to other devices is determined according to the communication status between every two devices, and then the consensus matrix used for consensus model training is obtained, so that the obtained consensus matrix can fully combine the communication status between each device during the consensus model training process, thereby enhancing the collaborative ability of the consensus model.

[0115] In step S104, the consensus matrix and the local initial model information corresponding to each device are sent to each device.

[0116] In an embodiment of the present invention, in order to avoid excessive communication resources of the server being occupied during the training of the global model of the target cluster, thereby affecting the communication interaction between the server and other devices outside the target cluster, the consensus matrix and the local initial model information corresponding to each device are sent to each device respectively, so that each device can perform consensus model training based on the received local initial model information and consensus matrix corresponding to each device in the target cluster, and generate a consensus model of each device corresponding to the target cluster, thereby reducing the communication load of the server.

[0117] In one example, since the consensus matrix is ​​constructed based on the aggregation weights corresponding to each device, when the consensus model is trained in the current device, the local initial model information of each device can be aggregated according to the aggregation weights of the current device relative to other devices in the consensus matrix, thereby generating a consensus model of the current device corresponding to the target cluster through multiple rounds of iterative processing.

[0118] In step S105 , according to the distance between each device in the target cluster and the server, the device closest to the server is determined as the target device.

[0119] In an embodiment of the present invention, in order to improve communication efficiency and reduce communication overhead, the device closest to the server is determined as the target device based on the distance between each device in the target cluster and the server, so that the server can quickly obtain the global model of the target cluster in a short time.

[0120] In step S106, the target consensus model information of the target device is obtained, and the target consensus model corresponding to the target consensus model information is used as the global model of the target cluster.

[0121] In the embodiment of the present invention, since the consensus model corresponding to the target cluster generated in each device is trained based on the local initial model of all devices in the target cluster, each consensus model can perform global management on each device in the target cluster. Therefore, when the target device is determined, the target consensus model information generated by the target device is obtained, and the target consensus model corresponding to the target consensus model information is used as the global model of the target cluster, so that the server can quickly obtain the global model of the target cluster, which helps to reduce the cost of generating the global model based on the power Internet of Things generated by the server.

[0122] Through the above embodiments, it is possible to determine a consensus matrix that aggregates the local initial model information of each device in the target cluster based on the communication status between every two devices in the target cluster, so that each device can fully combine the communication status between each device when generating the corresponding consensus model, thereby enhancing the collaborative ability of the consensus model. In addition, since the consensus model is a model obtained by consensus model training on a local device, it can be directly obtained from the device closest to the server without the need for the server to train itself, which helps to avoid excessive occupation of the server's communication resources during the consensus model training process, resulting in a shortage of server communication resources, thereby helping to ensure the reasonable allocation of the server's communication resources while improving the reliability of the global model.

[0123] The following examples will specifically illustrate the process of building a consensus matrix.

[0124] Figure 2FIG. 1 is a flowchart of a method for constructing a consensus matrix according to an exemplary embodiment. Figure 2 As shown, the method for constructing a consensus matrix includes the following steps.

[0125] In step S201, the initial weight of each device relative to other devices is determined according to the communication status of each device relative to other devices in the target cluster.

[0126] In the embodiment of the present invention, during the communication interaction, the channel gain between the two devices can be determined according to the communication distance between the current device and the other device through the Rayleigh fading parameter. For example, through the formula: Determine the channel gain between the two devices. Where i and j represent two different devices in the target cluster k, o ij is the Rayleigh fading parameter, is the distance between device i and device j in target cluster k, is the channel gain between device i and device j in target cluster k.

[0127] According to the channel gain, it can be determined whether the communication status between the two devices is stable. If the channel gain value is high, it means that the data transmission loss is small when the two devices are communicating and interacting, which helps to ensure the integrity of the communication data and is not prone to delay effects. If the channel gain value is low, it means that the data transmission loss is large when the two devices are communicating and interacting, and the integrity of the communication data cannot be guaranteed, which is prone to delay effects.

[0128] Since the devices in the power Internet of Things communicate with each other based on the wireless communication network, when determining the channel gain between each two devices, the initial weight of each device relative to other devices can be determined based on the communication bandwidth, noise power spectrum density and device transmission power between the two devices. For example, the following formula is used to calculate the initial weight of each device relative to other devices: Where m is the threshold parameter, B is the bandwidth of inter-device communication, N0 is the noise power spectrum density, and P0 is the device transmit power; is the channel gain between device i and device j in target cluster k. In one implementation scenario, the noise power spectrum density, device transmission power and bandwidth of communication with other devices of each device in the target cluster may be assumed to be the same.

[0129] In step S202, a reliable matrix corresponding to the target cluster is obtained based on the initial weights.

[0130] In the embodiment of the present invention, the initial weight is used to represent the reliability of each device relative to other devices in the target cluster. In order to reduce the impact of devices with low reliability on the consensus model training, reduce the delay effect of the consensus model, and improve the collaborative efficiency, the initial weights of each device relative to other devices are aggregated and expressed in the form of a matrix to obtain the reliability matrix corresponding to the target cluster, so that the communication status between each device can be fully considered when determining the consensus matrix.

[0131] For example: If This means that the communication between device i and device j in target cluster k is completely reliable and error-free. This means that there is no connection between device i and device j, and communication and model transmission are impossible. Therefore, through the reliability matrix P (k) , which can determine the reliability of communication between every two devices in the target cluster k. Since in the model consensus process within the target cluster, each device can only communicate and exchange models with the devices with which it is connected. Therefore, through this reliable matrix, it is helpful to clarify the devices in the target cluster that can communicate and exchange models with the current device, and then when the consensus matrix is ​​determined later, the interference of devices that cannot communicate with the current device can be reduced, so that the obtained consensus matrix is ​​more helpful to reduce the interference of invalid communication.

[0132] In step S203, based on the communication status of each device relative to other devices in the target cluster, a convex optimization process is performed on the reliability matrix, and the matrix obtained after the process is determined as a consensus matrix.

[0133] In the embodiment of the present invention, based on the communication status of each device relative to other devices in the target cluster, the following formula is used to perform convex optimization processing on the reliability matrix:

[0134] Among them, λ max (·) represents the maximum eigenvalue of the matrix; is the matrix C (k) The element in row i and column j; N is the number of devices contained in the target cluster k, that is, the first number, 11 T Represents the consensus matrix to be obtained.

[0135] D (k) Obtained by the following method:

[0136]

[0137] in, is the matrix D (k) The element in the i-th row and j-th column of ; The matrix C (k) The element in the i-th row and l-th column of ; The matrices P are (k) The element in the i-th row and l-th column of .

[0138] In one example, the consensus matrix C (k) Elements in It represents the weighted value of the local initial model information received from device j on device i when the target cluster k is performing intra-cluster model consensus. When the model consensus within the cluster is expressed, the sum weight of the model of device j on device i is 1. When the model consensus is reached within the cluster, device i will not use the local initial model information of device j to update its local initial model.

[0139] Through the above embodiment, based on the communication status between each device, the consensus matrix corresponding to the target cluster is determined, so that the obtained consensus matrix can fully reflect the reliability of each device relative to other devices in the target cluster, and then when the local initial model information of each device is subsequently aggregated based on the consensus matrix, the communication status between each device can be fully combined, so that the generated consensus model can have strong coordination ability and can effectively reduce the occurrence of delay effect during use.

[0140] Figure 3 FIG. 1 is a flowchart of another method for generating a global model based on the power Internet of Things according to an exemplary embodiment. Figure 3 As shown, the global model generation method based on the power Internet of Things is applied to the server in the power Internet of Things, including the following steps.

[0141] In step S301, the device information to be globally managed in the electric power Internet of Things is obtained.

[0142] In the embodiment of the present invention, since there are a large number of devices to be globally managed in the power Internet of Things, and in order to facilitate the server to fully utilize the user data in each device during global management, the device information to be globally managed in the power Internet of Things is acquired so that the server can clearly identify the devices to be globally managed in the power Internet of Things. The device information includes a second number of devices, and the second number is greater than the first number.

[0143] In step S302, the second number of devices are divided into a plurality of clusters, and cluster information of a target cluster is acquired.

[0144] In the embodiment of the present invention, in order to reduce the complexity of training the overall global model and improve the training efficiency of the overall global model, the second number of devices is divided into multiple clusters to reduce the number of parameters for training the overall global model, thereby reducing the computational cost. The multiple clusters include the target cluster.

[0145] In one example, the number of clusters to be divided can be predetermined, and then the second number of devices can be clustered according to the determined number of clusters by using a clustering function to obtain multiple clusters. In one implementation scenario, the number of clusters to be divided is predetermined to be K, and the second number of devices can be divided by using a K-means function (a clustering function) to obtain K clusters. The cluster The number of devices included is N k The first number in each cluster may be different. In one example, clustering may be performed based on the communication distance between each two devices.

[0146] In step S303, the aggregation weight corresponding to each device in the target cluster is determined based on the communication state between every two devices, and a consensus matrix corresponding to the target cluster is constructed through the aggregation weight corresponding to each device in the target cluster.

[0147] In step S304, the consensus matrix and the local initial model information corresponding to each device are sent to each device.

[0148] In step S305, according to the distance between each device in the target cluster and the server, the device closest to the server is determined as the target device.

[0149] In step S306, the target consensus model information of the target device is obtained, and the target consensus model corresponding to the target consensus model information is used as the global model of the target cluster.

[0150] In step S307, in response to obtaining the global model information of each cluster, an overall global model for global management of the electric power Internet of Things is obtained based on the device information and the global model information of each cluster.

[0151] In the embodiment of the present invention, since the global model information of each cluster is the information of the global model for global management of all devices in the cluster, it is not suitable for global management of the second number of devices. Therefore, in order to make full use of the user information in the second number of devices and improve the decision-making efficiency of the total global model, based on the device information and the global model information of each cluster, the global models are aggregated again to obtain the total global model for global management of the power Internet of Things, so that the obtained total global model can fully coordinate the resource allocation of each device.

[0152] In one implementation scenario, the product of the global model information of each cluster and the corresponding first quantity is calculated respectively to obtain the aggregate model information corresponding to each cluster. All the aggregate model information is added together and divided by the second quantity to obtain the total global model information used for global management of the power Internet of Things. The model corresponding to the total global model information is the total global model. That is, the total global model is obtained using the following formula: Where D is the total number of devices to be globally managed in the power Internet of Things, that is, the second number, D k is the number of devices in the kth cluster, i.e., the first number; is the global model corresponding to the k-th cluster, The overall global model.

[0153] Through the above embodiment, the clustered model is used to train the global model corresponding to each cluster, which can fully combine the communication status between the devices, reduce the interference of invalid communication, and simplify the number of parameters for training the overall global model, thereby reducing the communication load of the server, so that the obtained overall global model is more reliable and scalable.

[0154] Based on the same inventive concept, the present invention also provides another global model generation method based on the power Internet of Things, which is applied to a first device in the power Internet of Things, wherein the first device can be any device in the cluster to which it belongs.

[0155] In the global model generation method based on the electric power Internet of Things provided by the present invention, each device in the target cluster sends the local initial model information to the server in advance so that the server can obtain the cluster information of the target cluster. In the target cluster, each device detects the communication status between other devices in the target cluster respectively, and sends the communication status between other devices in the target cluster to the server, so that the server can determine the aggregation weight corresponding to each device based on the communication status between every two devices in the target cluster, and then obtain the consensus matrix for training the consensus model. In order to save the communication resources of the server, each device in the target cluster generates the consensus model corresponding to the target cluster according to the consensus matrix issued by the server and the local initial model information corresponding to each device, so as to avoid the situation that the training is affected by the shortage of communication resources of the server in the process of generating the consensus model, thereby helping to improve the reliability of the global model training. If the current device is the device closest to the server in the target cluster, the consensus model information of the consensus model generated by the current device is sent to the server, so that the server uses the received consensus model information as the global model of the target cluster, thereby helping to reduce the transmission delay of the server receiving the global model, thereby improving the transmission efficiency.

[0156] Figure 4 FIG. 1 is a flowchart of a consensus model training method proposed according to an exemplary embodiment. Figure 4 As shown, the consensus model training method includes the following steps S401 to S406.

[0157] In step S401, local initial model information of the first device is sent to a server in the electric power Internet of Things, so that the server obtains cluster information of the target cluster.

[0158] In an embodiment of the present invention, in order to facilitate the server to obtain cluster information of the target cluster, the local initial model information of the first device is sent to the server, so that the local initial model information of each device can be obtained during subsequent training of the consensus model.

[0159] In step S402, the communication status with each device in the target cluster is detected respectively.

[0160] In an embodiment of the present invention, in order to determine whether the first device can interact normally with other devices in the target cluster, the communication status between the first device and each device in the target cluster is detected respectively, so as to determine whether a delay effect will be generated during the communication between each two devices in the target cluster.

[0161] In step S403, the communication status between each device in the target cluster is sent to the server, so that the server obtains the communication status between every two devices in the target cluster.

[0162] In step S404, the consensus matrix sent by the server and the local initial model information corresponding to each device are received.

[0163] In an embodiment of the present invention, the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is the weight determined by the server based on the communication status between each two devices.

[0164] In order to facilitate the first device to obtain the local initial model information of other devices in the target cluster when training the consensus model, and to fully combine the communication status between each device during the training process to enhance the collaborative ability of the consensus model, the constructed consensus matrix and the local initial model information corresponding to each device are sent to the first device, and the first device generates a consensus model corresponding to the target cluster to avoid excessive occupation of the server's communication resources during the consensus model training process.

[0165] In step S405, a consensus model corresponding to the target cluster is generated based on the received local initial model information and consensus matrix corresponding to each device in the target cluster.

[0166] In an embodiment of the present invention, since the consensus matrix is ​​a matrix constructed based on the aggregation weights corresponding to each device, when consensus model training is performed in the first device, the local initial model information of each device can be aggregated according to the aggregation weights of the first device relative to other devices in the target cluster in the consensus matrix, and then the consensus model of the current device corresponding to the target cluster is generated through multiple rounds of iterative processing.

[0167] In step S406, if the first device is the device closest to the server, the consensus model information of the consensus model is sent to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

[0168] In the embodiment of the present invention, since the consensus model corresponding to the target cluster generated in each device is trained based on the local initial model of all devices in the target cluster, each consensus model can perform global management on each device in the target cluster. Therefore, in order to improve communication efficiency and reduce the communication overhead between the server and the device, the consensus model generated by the first device closest to the server is used as the global model of the target cluster. The consensus model information of the consensus model is sent to the server so that the server can quickly obtain the global model for managing the target cluster, which helps to reduce the cost of generating a global model based on the power Internet of Things generated by the server.

[0169] Through the above embodiment, the consensus model corresponding to the target cluster is trained by the devices in the target cluster, which helps to avoid the excessive occupation of the server's communication resources, resulting in a shortage of server communication resources. In addition, the consensus model generated by the device closest to the server is used as the global model for managing the target cluster, and then the consensus model information of the consensus model is sent to the server, which helps the server to quickly obtain the global model of the target cluster in a short time, thereby helping to reduce communication overhead and improve communication efficiency.

[0170] The following embodiments will specifically illustrate the training process of each device in the target cluster training the consensus model.

[0171] In the target cluster, the principle of training the corresponding consensus model of each device is the same, so the process of training the consensus model of one device in the target cluster is taken as an example. For the convenience of description, the device is called the first device, and the local initial model information corresponding to the first device is called the first local initial model information.

[0172] Figure 5 FIG. 1 is a flowchart of a consensus model training method proposed according to an exemplary embodiment. Figure 5 As shown, the training method of the consensus model includes the following steps.

[0173] In step S501, for the current round of consensus model training, the received local initial model information and consensus matrix corresponding to each device in the target cluster are aggregated to obtain the local initial consensus model information corresponding to the first device.

[0174] In the embodiment of the present invention, the received local initial model information and the consensus matrix corresponding to each device in the target cluster are aggregated to obtain the local initial consensus model information corresponding to the first device, which can be expressed by the following formula: in, is the local initial consensus model information of device i in the target cluster k obtained by aggregation, is the initial local initial model of device i in cluster k before aggregation, is the consensus matrix C (k) The element in the ith row and lth column of is used to represent the weighted value of the local initial model information received from device j on device i when the target cluster k performs intra-cluster model consensus.

[0175] In step S502, the local initial consensus model information is iteratively processed to obtain first consensus model information.

[0176] In an embodiment of the present invention, during the consensus model training process, an iterative processing method is used to converge the local initial consensus model information of the current round to complete the model update of the current round, thereby obtaining the first consensus model information. In one example, during the iterative processing, the local initial consensus model information can be compressed by a local stochastic gradient descent method, thereby achieving the convergence of the local initial consensus model information.

[0177] In step S503, the first consensus model information is compared with the first local initial model information to obtain update information of the first consensus model information.

[0178] In the embodiment of the present invention, by comparing the first consensus model information with the first device model information, it is possible to determine the model update information newly added to the first consensus model information obtained after the current round of convergence compared to the first local initial model information before convergence.

[0179] In one implementation scenario, the model update information may be determined using the following formula: in, Update the model information for device i in cluster k in the tth iteration. It is the first consensus model information obtained after local stochastic gradient descent of device i in cluster k. is the first device model information of device i in cluster k in the tth iteration.

[0180] In step S504, the convergence error of the previous round of consensus model training is obtained.

[0181] In the embodiment of the present invention, the convergence error can reflect the number of iterations performed by the first device to train the consensus model of the target cluster corresponding to the first device. For example, the larger the convergence error value, the fewer the number of aggregation iterations of the first device converge, and the smaller the convergence error value, the more the number of aggregation iterations of the first device converge.

[0182] Therefore, in order to determine whether the convergence of the first consensus model information meets the training completion requirements, the convergence error of the previous round of consensus model training is used to determine the number of iterations through the error value of the convergence error.

[0183] In step S505, based on the update information and the convergence error, the model cumulative update information of the consensus model training is determined to obtain the model cumulative update value.

[0184] In an embodiment of the present invention, the model cumulative update information can be determined using the following formula: in, is the cumulative update information of the model of device i in cluster k in the tth iteration; γ is the decay weight; is the compression error obtained by the t-1th iteration of device i in cluster k, is the total model update information of device i in cluster k in the tth iteration. The value corresponding to the model cumulative update information is the model cumulative update value.

[0185] By obtaining the cumulative update value of the model, it is helpful to determine the iteration status of the first device in the process of training the consensus model, and then it is helpful to timely determine whether there is any convergence abnormality, so as to ensure that the consensus model training can proceed in an orderly manner.

[0186] In step S506, the cumulative update value of the model is compared with the specified update threshold. If the cumulative update information of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the target cluster corresponding to the first device.

[0187] In an embodiment of the present invention, the specified update threshold is the maximum convergence value used to determine whether the local initial model information of the current round has completed training. If the cumulative update value of the model after the local initial consensus model information completes the current round of iterations is greater than the specified update threshold, it indicates that the consensus model of the first device corresponding to the target cluster has not been trained and the next round of training is still required. If the cumulative update value of the model after the local initial consensus model information completes the current round of iterations is less than or equal to the specified update threshold, it indicates that the consensus model of the first device corresponding to the target cluster has been trained and there is no need to perform the next round of consensus model training. Therefore, in order to determine whether the consensus model of the first device corresponding to the target cluster has completed training, the cumulative update value of the model after the current round of iterations is compared with the specified update threshold to determine whether the consensus model training is completed.

[0188] By comparison, when it is determined that the cumulative update information of the model is less than or equal to the specified update threshold, it is determined that the consensus model training of the first device corresponding to the target cluster is completed, and then the first consensus model information is determined as the consensus model information of the first device, and the model corresponding to the first consensus model information is determined as the consensus model of the first device.

[0189] Through the above embodiments, the local initial model information of each device in the target cluster can be aggregated based on the consensus matrix, and then the consensus model training can be performed in an iterative processing manner, so that in the process of consensus model training, the communication status between each device can be fully combined to reduce the occurrence of unreliable communication between devices, thereby enhancing the collaborative ability of the consensus model.

[0190] Figure 6 FIG. 1 is a flowchart of another consensus model training method proposed according to an exemplary embodiment. Figure 6 As shown, the training method of the consensus model includes the following steps.

[0191] In step S601, for the current round of consensus model training, the received local initial model information and consensus matrix corresponding to each device in the target cluster are aggregated to obtain the local initial consensus model information corresponding to the first device.

[0192] In step S602, the local initial consensus model information is iteratively processed to obtain first consensus model information.

[0193] In step S603, the first consensus model information is compared with the first local initial model information to obtain update information of the first consensus model information.

[0194] In step S604, the convergence error of the previous round of consensus model training is obtained.

[0195] In step S605, based on the update information and the convergence error, the model cumulative update information of the consensus model training is determined to obtain the model cumulative update value.

[0196] In step S606 , the model cumulative update value is compared with a specified update threshold.

[0197] In step S607, if the cumulative update value of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the target cluster corresponding to the first device.

[0198] In step S608, if the model cumulative update value is greater than the specified update threshold, it is determined that the consensus model training is not completed.

[0199] In an embodiment of the present invention, if the cumulative update value of the model after the local initial consensus model information completes the current round of iterations is greater than the specified update threshold, it indicates that the consensus model of the first device corresponding to the target cluster has not been trained and the next round of consensus model training is still required.

[0200] In step S609, the model cumulative update information is compressed to obtain second consensus model information, and the second consensus model information is used as the first local initial model information sent to other devices for the next round of consensus model training.

[0201] In the embodiment of the present invention, since part of the information in the model cumulative update information belongs to the model information of cumulative repeated training, in order to avoid the situation of repeated data training in the next round of training, the model cumulative update information is compressed to obtain the first local initial model information for sending to other devices for consensus training, that is, the second consensus model information. Since the second consensus model information includes less model information than the first consensus model information, when the second consensus model is used as the first local initial model information for the next round of training, it helps to avoid the situation of repeated training of redundant data, thereby helping to save training costs, improve the training efficiency of local initial model information, and reduce communication overhead between devices.

[0202] When compressing the cumulative update information of the model, invalid information can be compressed by adding a mask during the compression process, so as to quickly obtain the second consensus model information. For example, the following formula is used to compress the cumulative update information of the model:

[0203]

[0204]

[0205] in, When the compression threshold is set to τ, the device i in cluster k compresses the mask in the tth iteration; is the cumulative update information of the model after compression of device i in cluster k in the tth iteration when the compression threshold is set to τ; τ is the compression threshold; Comp(·) is the compression operation used to retain non-zero elements; ⊙ is the Hadamard product. The Compression-Mask operation indicates that for An element in like but The value of the element at the corresponding position in is 1, otherwise the value is 0.

[0206] Through the above-mentioned embodiment, the cumulative update compression method is adopted. In the process of intra-cluster aggregation, the compressed model cumulative update information is used as the second consensus information for updating the local initial model information, which helps to reduce the repeated training of redundant data, and further helps to reduce the communication overhead between devices, thereby helping to improve training efficiency.

[0207] In one example, the convergence error can be obtained based on the difference between the model cumulative update information and the model update information, and the calculation formula is as follows: in, Cumulative update information for the model of device i in cluster k in the tth iteration, is the cumulative update information of the model after compression of device i in cluster k in the tth iteration when the compression threshold is set to τ, is the convergence error in the tth iteration. The convergence error of the first consensus model of device i in the t+1th iteration can be obtained according to the sum of the first consensus model in the tth iteration and the convergence error in the tth iteration. For example, it can be calculated by the following formula: in, is the convergence error used to update device i in the t+1th iteration.

[0208] In one embodiment, in order to improve the accuracy of training, the first consensus model information obtained from the previous round of training is determined as the first local initial model information for the current round of training. If new first local initial model information sent by other devices is received, the consensus model training of the current round is performed. That is, for each round of training, an iterative process is performed in each device to generate the first consensus model corresponding to each device. If the model cumulative update value of the first consensus model of at least one device in the target cluster is greater than the specified update threshold, the device whose consensus model has not been trained in the target cluster is determined, and then the second consensus model of each device is obtained again, and the second consensus model of each device is used as the first local initial model information of the corresponding device for the next round, until the model cumulative update value of the first consensus model of all devices in the target cluster is less than or equal to the specified update threshold, and the training of the consensus model of each device in the target cluster is terminated. In one example, in order to facilitate supervision, the iterative process is determined, and a count is performed each time a new round of training is performed to determine the specific round.

[0209] In one implementation scenario, the overall global variable model may be obtained by the following process:

[0210] First, the second number of devices are divided into K clusters using the K-means algorithm. The cluster The number of devices included is N k .

[0211] Secondly, calculate each cluster separately The corresponding reliability matrix P (k) and the consensus matrix C (k) For each cluster All devices in the cluster perform local initial model initialization aggregation, that is, in each cluster, Aggregate the local initial model information within the cluster in each device: is the local initial consensus model information of device i in the target cluster k obtained by aggregation, is the initial local initial model of device i in cluster k before aggregation, is the consensus matrix C (k) The element in the ith row and lth column of is used to represent the weighted value of the local initial model information received from device j on device i when the target cluster k performs intra-cluster model consensus.

[0212] Again, perform a local stochastic gradient descent on all devices in the cluster and calculate the cumulative update value of the model after iterative processing for each device The cumulative update value of the model after compression of device i in cluster k in the tth iteration when the compression threshold is set to τ.

[0213] From this, each device in each cluster is based on the consensus matrix C (k) Aggregate the local initial models of each device, use multiple rounds of iterative processing, and accumulate update values ​​for each round of models. Train the consensus model of each device corresponding to its cluster until each cluster The cumulative update value of the model corresponding to each device in is less than or equal to the specified update threshold σ, completing each cluster Consensus model training for each device in.

[0214] Finally, from each cluster Select the device i that is closest to the server * , using its consensus model Perform global aggregation to obtain the overall global model Where D is the total number of devices to be globally managed in the power Internet of Things, that is, the second number, D k is the number of devices in the kth cluster, i.e., the first number; is the global model corresponding to the k-th cluster, The overall global model.

[0215] Finally, the trained overall global model is deployed to the power Internet of Things for online operation, thereby effectively managing the second number of devices globally.

[0216] The global model generation method based on the electric power Internet of Things provided by the present invention can overcome the communication bottleneck of centralized federated learning and reduce the impact of single point failures while achieving rapid convergence based on a semi-distributed federated learning architecture. When training the consensus model of each cluster, in order to reduce the interference of unreliable factors in the communication state, a consensus matrix for aggregating the local initial model information of each device in the cluster can be constructed based on the communication state between each device. In the training process, the communication conditions of each device can be fully combined so that the obtained consensus model can improve the collaborative efficiency and reduce the generation of delay effects.

[0217] Based on the same inventive concept, the present invention also provides a global model generation device based on the power Internet of Things for use in a server in the power Internet of Things.

[0218] Figure 7 is a structural block diagram of a global model generation device based on the power Internet of Things proposed according to an exemplary embodiment. Figure 7As shown, the global model generation device based on the power Internet of Things includes a first acquisition unit 701, a second acquisition unit 702, a matrix construction unit 703, a transmission unit 704, a screening unit 705 and a third acquisition unit 706.

[0219] A first acquisition unit 701 is used to acquire cluster information of a target cluster, where the target cluster includes a first number of devices, and the cluster information includes local initial model information corresponding to each device;

[0220] The second acquisition unit 702 is used to acquire the communication status between every two devices in the target cluster;

[0221] A matrix construction unit 703 is used to determine the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and to construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster;

[0222] The transmission unit 704 is used to send the consensus matrix and the local initial model information corresponding to each device to each device, so that each device generates a consensus model corresponding to the target cluster for each device based on the received local initial model information and the consensus matrix corresponding to each device in the target cluster;

[0223] A screening unit 705, configured to determine the device closest to the server as the target device according to the distance between each device in the target cluster and the server;

[0224] The third acquisition unit 706 is used to acquire the target consensus model information of the target device, and use the target consensus model corresponding to the target consensus model information as the global model of the target cluster.

[0225] In one embodiment, the matrix construction unit 703 includes: a first determination unit, used to determine the initial weight of each device relative to other devices according to the communication status of each device relative to other devices in the target cluster. A matrix construction subunit, used to obtain a reliable matrix corresponding to the target cluster based on the initial weight, wherein the initial weight is used to represent the reliability of each device relative to other devices in the target cluster. A first processing unit, used to perform convex optimization processing on the reliable matrix based on the communication status of each device relative to other devices in the target cluster, and determine the matrix obtained after processing as a consensus matrix.

[0226] In another embodiment, the first acquisition unit 701 includes: a device information acquisition unit, used to acquire device information to be globally managed in the power Internet of Things, the device information includes a second number of devices, and the second number is greater than the first number. A division unit, used to divide the second number of devices into multiple clusters, and acquire cluster information of a target cluster, where the target cluster is one of the multiple clusters. The device also includes: an aggregation unit, used to obtain the global model information of each cluster, and obtain the overall global model for global management of the power Internet of Things based on the device information and the global model information of each cluster in response to obtaining the global model information of each cluster.

[0227] In another embodiment, the aggregation unit includes: a first aggregation subunit, which is used to calculate the product of the global model information of each cluster and the corresponding first quantity, respectively, to obtain the aggregate model information corresponding to each cluster. A third processing unit, which is used to add all the aggregate model information and divide it by the second quantity to obtain the total global model information used for global management of the power Internet of Things, and the model corresponding to the total global model information is the total global model.

[0228] The specific limitations and beneficial effects of the above-mentioned global model generation device based on the power Internet of Things can be found in the above-mentioned limitations on the global model generation method based on the power Internet of Things, which will not be repeated here. The above-mentioned modules can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0229] Figure 8 is a structural block diagram of a global model generation device based on the power Internet of Things proposed according to an exemplary embodiment. Figure 8 As shown, a global model generation device based on the power Internet of Things is applied to a first device in the power Internet of Things, including a first receiving unit 801, a detection unit 802, a first sending unit 803, a second receiving unit 804, a generating unit 805 and a second sending unit 806.

[0230] The first receiving unit 801 is used to send the local initial model information of the first device to the server in the power Internet of Things, so that the server obtains cluster information of a target cluster, where the target cluster includes a first number of devices, the first device is one of the devices in the target cluster, and the cluster information includes the local initial model information corresponding to each device;

[0231] A detection unit 802, configured to detect the communication status with each device in the target cluster respectively;

[0232] The first sending unit 803 is used to send the communication status between each device in the target cluster to the server, so that the server obtains the communication status between every two devices in the target cluster;

[0233] The second receiving unit 804 is used to receive the consensus matrix and the local initial model information corresponding to each device sent by the server, where the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is a weight determined by the server based on the communication status between each two devices;

[0234] A generating unit 805, configured to generate a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster;

[0235] The second sending unit 806 is configured to send the consensus model information of the consensus model to the server if the first device is the device closest to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

[0236] In one embodiment, the local initial model information of the first device is the first local initial model information, and the generation unit 805 includes: an aggregation unit, for aggregating the local initial model information and the consensus matrix corresponding to each device in the target cluster received for the current round of consensus model training, to obtain the local initial consensus model information corresponding to the first device. An iterative processing unit, for obtaining the first consensus model information by iteratively processing the local initial consensus model information. A comparison unit, for comparing the first consensus model information with the first local initial model information, to obtain update information of the first consensus model information. An error acquisition unit, for obtaining the convergence error of the consensus model training during the iterative processing in the previous round. An update determination unit, for determining the model cumulative update information of the consensus model training based on the update information and the convergence error, to obtain the model cumulative update value. A first detection unit, for comparing the model cumulative update value with the specified update threshold, if the model cumulative update value is less than or equal to the specified update threshold, then terminating the consensus model training, and determining the model corresponding to the first consensus model information as the consensus model of the target cluster corresponding to the first device.

[0237] In another embodiment, the apparatus further includes: a second detection unit, configured to determine that the consensus model training is not completed if the update information is greater than a specified update threshold; a compression unit, configured to compress the model cumulative update information to obtain second consensus model information, and use the second consensus model information as the first local initial model information sent to other devices for the next round of consensus model training.

[0238] In another embodiment, the apparatus further includes: an information determination unit, configured to determine the first consensus model information obtained from the previous round of training as the first local initial model information for the current round of training; and a receiving detection unit, configured to perform the consensus model training of the current round if new first local initial model information sent by other devices is received.

[0239] The specific limitations and beneficial effects of the above-mentioned global model generation device based on the power Internet of Things can be found in the above-mentioned limitations on the global model generation method based on the power Internet of Things, which will not be repeated here. The above-mentioned modules can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0240] Fig. 9 FIG. 1 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment. Fig. 9 As shown, the device includes one or more processors 910 and a memory 920, and the memory 920 includes a persistent memory, a volatile memory, and a hard disk. Fig. 9 A processor 910 is taken as an example. The device may also include: an input device 930 and an output device 940.

[0241] The processor 910, the memory 920, the input device 930 and the output device 940 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0242] The processor 910 may be a central processing unit (CPU). The processor 910 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips. A general-purpose processor may be a microprocessor or the processor may be any conventional processor.

[0243] The memory 920, as a non-transient computer-readable storage medium, includes a persistent memory, a volatile memory, and a hard disk, and can be used to store non-transient software programs, non-transient computer executable programs, and modules, such as program instructions / modules corresponding to the business management method in the embodiment of the present application. The processor 910 executes various functional applications and data processing of the server by running the non-transient software programs, instructions, and modules stored in the memory 920, that is, any of the above-mentioned global model generation methods based on the power Internet of Things is realized.

[0244] The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data required for use, etc. In addition, the memory 920 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 920 may optionally include a memory remotely arranged relative to the processor 910, and these remote memories may be connected to the data processing device 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.

[0245] The input device 930 can receive input digital or character information and generate key signal input related to user settings and function control. The output device 940 can include display devices such as display screens.

[0246] One or more modules are stored in the memory 920, and when executed by one or more processors 910, the execution is as follows: Figure 1-Figure 6 The method shown.

[0247] The above-mentioned product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to Figure 1-Figure 6 Related description of the illustrated embodiment.

[0248] The embodiment of the present invention also provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions can execute the authentication method in any of the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

[0249] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.

Claims

1. A global model generation method based on power Internet of Things, characterized in that: Applied to a server in the electric power Internet of Things, the method comprises: Acquire cluster information of a target cluster, the target cluster including a first number of devices, the cluster information including local initial model information corresponding to each device; Obtaining the communication status between every two devices in the target cluster; Determine the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster; Sending the consensus matrix and local initial model information corresponding to each device to each device, so that each device generates a consensus model corresponding to the target cluster for each device based on the received local initial model information and consensus matrix corresponding to each device in the target cluster; According to the distance between each device in the target cluster and the server, determining the device closest to the server as the target device; The target consensus model information of the target device is obtained, and the target consensus model corresponding to the target consensus model information is used as the global model of the target cluster.

2. The method according to claim 1, characterized in that The step of respectively determining the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and constructing a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster includes: Determining the initial weight of each device relative to other devices in the target cluster according to the communication state of each device relative to the other devices; Obtaining a reliability matrix corresponding to the target cluster based on the initial weights, wherein the initial weights are used to represent the reliability of each device relative to other devices in the target cluster; Based on the communication status of each device relative to other devices in the target cluster, the reliability matrix is ​​subjected to convex optimization processing, and the matrix obtained after the processing is determined as a consensus matrix.

3. The method according to claim 1, characterized in that The step of obtaining cluster information of the target cluster includes: Acquire device information to be globally managed in the electric power Internet of Things, where the device information includes a second number of devices, and the second number is greater than the first number; Divide the second number of devices into multiple clusters, and obtain cluster information of the target cluster, where the target cluster is one of the multiple clusters; The method further comprises: In response to obtaining the global model information of each cluster, an overall global model for global management of the electric power Internet of Things is obtained based on the device information and the global model information of each cluster.

4. The method according to claim 3, characterized in that The method of obtaining a total global model for global management of the electric power Internet of Things based on the device information and the global model information of each cluster includes: Calculate the product of the global model information of each cluster and the corresponding first quantity respectively to obtain the aggregate model information corresponding to each cluster; All the aggregated model information is added together and divided by the second number to obtain the total global model information used for global management of the electric power Internet of Things. The model corresponding to the total global model information is the total global model.

5. A global model generation method based on power Internet of Things, characterized in that: A first device applied to an electric power Internet of Things, the method comprising: Sending the local initial model information of the first device to a server in the electric power Internet of Things, so that the server obtains cluster information of a target cluster, the target cluster includes a first number of devices, the first device is one of the devices in the target cluster, and the cluster information includes the local initial model information corresponding to each device; Respectively detecting the communication status between each device in the target cluster; sending the communication status between each device in the target cluster to the server so that the server obtains the communication status between every two devices in the target cluster; Receive a consensus matrix and local initial model information corresponding to each device sent by the server, wherein the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is a weight determined by the server based on the communication status between each two devices; Generate a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster; If the first device is the device closest to the server, the consensus model information of the consensus model is sent to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

6. The method according to claim 5, characterized in that The local initial model information of the first device is first local initial model information; The generating a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster includes: For the current round of consensus model training, the received local initial model information and consensus matrix corresponding to each device in the target cluster are aggregated to obtain the local initial consensus model information corresponding to the first device; Iteratively process the local initial consensus model information to obtain first consensus model information; Comparing the first consensus model information with the first local initial model information to obtain update information of the first consensus model information; Obtaining the convergence error of the previous round of consensus model training; Based on the update information and the convergence error, determine the model cumulative update information of the consensus model training to obtain the model cumulative update value; The cumulative update value of the model is compared with a specified update threshold. If the cumulative update value of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the first device corresponding to the target cluster.

7. The method according to claim 6, characterized in that The method further comprises: If the cumulative update value of the model is greater than the specified update threshold, it is determined that the consensus model training is not completed; The model cumulative update information is compressed to obtain second consensus model information, and the second consensus model information is used as the first local initial model information sent to other devices for the next round of consensus model training.

8. The method according to claim 7, characterized in that Before performing the current round of consensus model training, the method further includes: Determine the first consensus model information obtained in the previous round of training as the first local initial model information for the current round of training; If new first local initial model information sent by the other device is received, the current round of consensus model training is performed.

9. A global model generation device based on power Internet of Things, characterized in that: A server applied to the electric power Internet of Things, the device comprising: A first acquisition unit, configured to acquire cluster information of a target cluster, wherein the target cluster includes a first number of devices, and the cluster information includes local initial model information corresponding to each device; A second acquisition unit, configured to acquire a communication status between every two devices in the target cluster; A matrix construction unit, used to determine the aggregation weight corresponding to each device in the target cluster based on the communication state between each two devices, and to construct a consensus matrix corresponding to the target cluster through the aggregation weight corresponding to each device in the target cluster; A transmission unit, configured to send the consensus matrix and local initial model information corresponding to each device to each device, so that each device generates a consensus model corresponding to the target cluster for each device based on the received local initial model information and consensus matrix corresponding to each device in the target cluster; a screening unit, configured to determine, according to the distance between each device in the target cluster and the server, a device closest to the server as a target device; The third acquisition unit is used to acquire the target consensus model information of the target device, and use the target consensus model corresponding to the target consensus model information as the global model of the target cluster.

10. The device according to claim 9, characterized in that The matrix construction unit comprises: A first determining unit, configured to determine an initial weight of each device relative to other devices in the target cluster according to a communication state of each device relative to the other devices; A matrix construction subunit, used to obtain a reliability matrix corresponding to the target cluster based on the initial weights, wherein the initial weights are used to represent the reliability of each device relative to other devices in the target cluster; The first processing unit is used to perform convex optimization processing on the reliability matrix based on the communication state of each device relative to other devices in the target cluster, and determine the matrix obtained after the processing as a consensus matrix.

11. The device according to claim 9, characterized in that The first acquiring unit includes: A device information acquisition unit, configured to acquire device information to be globally managed in the electric power Internet of Things, wherein the device information includes a second number of devices, and the second number is greater than the first number; a dividing unit, configured to divide the second number of devices into a plurality of clusters, and obtain cluster information of the target cluster, where the target cluster is one of the plurality of clusters; The device also includes: The aggregation unit is used to obtain the global model information of each cluster in response to obtaining the global model information of each cluster, and obtain the overall global model for global management of the power Internet of Things based on the device information and the global model information of each cluster.

12. The device according to claim 11, characterized in that The polymeric unit comprises: A first aggregation subunit is used to calculate the product of the global model information of each cluster and the corresponding first quantity to obtain the aggregation model information corresponding to each cluster; The third processing unit is used to add up all the aggregated model information and divide it by the second number to obtain the total global model information used for global management of the power Internet of Things, and the model corresponding to the total global model information is the total global model.

13. A global model generation device based on power Internet of Things, characterized in that: A first device applied to the electric power Internet of Things, the device comprising: A first receiving unit is configured to send the local initial model information of the first device to a server in the electric power Internet of Things, so that the server obtains cluster information of a target cluster, the target cluster includes a first number of devices, the first device is one of the devices in the target cluster, and the cluster information includes the local initial model information corresponding to each device; A detection unit, used to detect the communication status between each device in the target cluster respectively; a first sending unit, configured to send a communication status between each device in the target cluster to the server, so that the server obtains a communication status between every two devices in the target cluster; A second receiving unit is used to receive a consensus matrix issued by the server and local initial model information corresponding to each device, wherein the consensus matrix is ​​a matrix constructed by the server through the aggregation weight corresponding to each device in the target cluster, and the aggregation weight corresponding to each device in the target cluster is a weight determined by the server based on the communication status between each two devices; A generating unit, configured to generate a consensus model corresponding to the target cluster based on the received local initial model information and consensus matrix corresponding to each device in the target cluster; The second sending unit is used to send the consensus model information of the consensus model to the server if the first device is the device closest to the server, so that the server uses the consensus model as the global model of the target cluster according to the received consensus model information.

14. The device according to claim 13, characterized in that The local initial model information of the first device is first local initial model information, and the generating unit includes: an aggregation unit, configured to aggregate the received local initial model information and consensus matrix corresponding to each device in the target cluster for the current round of consensus model training, to obtain the local initial consensus model information corresponding to the first device; An iterative processing unit, configured to obtain first consensus model information by iteratively processing the local initial consensus model information; a comparing unit, configured to compare the first consensus model information with the first local initial model information to obtain update information of the first consensus model information; An error acquisition unit, used to obtain the convergence error of the consensus model training during the previous round of iterative processing; An update determination unit, configured to determine the model cumulative update information of the consensus model training based on the update information and the convergence error, and obtain a model cumulative update value; The first detection unit is used to compare the cumulative update value of the model with a specified update threshold. If the cumulative update value of the model is less than or equal to the specified update threshold, the consensus model training is terminated, and the model corresponding to the first consensus model information is determined as the consensus model of the first device corresponding to the target cluster.

15. The device according to claim 14, characterized in that The device also includes: A second detection unit, configured to determine that the consensus model training is not completed if the update information is greater than the specified update threshold; A compression unit is used to compress the model cumulative update information to obtain second consensus model information, and use the second consensus model information as the first local initial model information sent to other devices for the next round of consensus model training.

16. The device according to claim 15, characterized in that The device also includes: An information determination unit, used to determine the first consensus model information obtained in the previous round of training as the first local initial model information for the current round of training; A receiving detection unit is used to execute the current round of consensus model training if new first local initial model information sent by the other device is received.

17. A computer device, characterized in that: It includes a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the global model generation method based on the electric power Internet of Things described in any one of claims 1-4 or the global model generation method based on the electric power Internet of Things described in any one of claims 5-8 by executing the computer instructions.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the global model generation method based on the power Internet of Things described in any one of claims 1-4 or the global model generation method based on the power Internet of Things described in any one of claims 5-8.

Citation Information

Patent Citations

  • Internet of things method and device based on block chain

    CN108234127A

  • Data sharing method, computer equipment applying same and readable storage medium

    CN111931242A