Method, device, equipment and computer storage medium for model updating

By calculating the fluctuation of parameter similarity on edge servers, intrusion behavior is detected, ensuring the accuracy of edge parameters in federated learning. This solves the problem of model inaccuracy caused by the vulnerability of edge servers to attacks, and improves the accuracy and security of the global model.

CN117077808BActive Publication Date: 2026-04-17CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
Filing Date
2023-08-16
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In federated learning, edge servers are vulnerable to malicious attacks, which can lead to inaccurate calculation results and consequently affect the accuracy of the global model.

Method used

By calculating the similarity fluctuation of edge parameters sent by the edge server, the difference between training rounds is determined. The difference is used to detect intrusion behavior. The global model is only updated when the difference is within a preset range, thus ensuring the accuracy of the edge parameters.

Benefits of technology

It improves the accuracy of federated learning results, prevents model errors caused by external interference, and enhances data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117077808B_ABST
    Figure CN117077808B_ABST
Patent Text Reader

Abstract

The application discloses a model updating method and device, equipment and a computer storage medium. The method comprises the following steps: acquiring edge parameters sent by n first edge servers, and a round in which the n edge servers respectively send the edge parameters; calculating a first similarity between the first edge parameters and second edge parameters; calculating a standard deviation of the first similarity; in the case that the round is greater than 1 and not greater than a target value, calculating a first difference value between the standard deviation and a standard deviation of a previous round; in the case that the first difference value is within a first preset range, updating parameters of a target model based on the edge parameters sent by the n first edge servers to obtain an updated target model. In this way, only the edge parameters that pass the test are used for updating the global model, thereby improving the accuracy of the result of the federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of edge computing technology, and in particular relates to a method, apparatus, device and computer storage medium for model updating. Background Technology

[0002] Federated learning is a distributed machine learning method. Its core idea is that edge servers do not need to exchange raw data; instead, they exchange only a small amount of intermediate computational results under end-to-end encryption to train a global model based on virtual fused data. Because the raw data is stored on each edge server in federated learning, data leakage is prevented, the pressure on a single server is reduced, and multi-party collaborative modeling is better achieved.

[0003] Although each edge server does not access the raw data of other edge servers, ensuring data security, the edge servers themselves are vulnerable to attacks by malicious clients, which can lead to inaccurate results calculated on each edge server, and consequently, inaccurate results from federated learning. Summary of the Invention

[0004] This application provides a method, apparatus, device, and computer storage medium for model updating. By calculating the fluctuation degree of similarity of edge parameters sent by each edge server, the difference between the fluctuation degree of two training rounds is determined. Based on the difference, intrusion behavior is checked on the corresponding edge server. When there is external interference, the difference will be large. If the difference is within a preset range, it indicates that there is no external interference. Only edge parameters that pass the test will be used for global model updating, thereby improving the accuracy of federated learning results.

[0005] In a first aspect, embodiments of this application provide a model updating method, the method comprising:

[0006] Obtain the edge parameters sent by the n first edge servers, and the rounds in which the n edge servers send the edge parameters, where n≥2;

[0007] Calculate the first similarity between the first edge parameter and the second edge parameter. The first edge parameter is the edge parameter sent by the first target edge server. The first target edge server is any one of the n first edge servers. The second edge parameter is the edge parameter sent by any first edge server other than the target first edge server.

[0008] Calculate the standard deviation of the first similarity score; the standard deviation represents the degree of fluctuation in the first similarity score.

[0009] If the number of rounds is greater than 1 and not greater than the target value, calculate the first difference between the standard deviation and the standard deviation of the previous round. The first difference represents the degree of similarity between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round.

[0010] If the first difference is within a first preset range, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

[0011] In one possible implementation embodiment, it further includes:

[0012] If the first difference is not within the first preset range, the first similarity between the edge parameter sent by the kth first edge server and the edge parameter sent by any first edge server other than the kth first edge server is taken as the second similarity.

[0013] Calculate the standard deviation of the second similarity;

[0014] The number of targets for the second edge server is determined by using the standard deviation of the first similarity, the standard deviation of the second similarity, and the number of the first edge servers. If the number of targets is greater than or equal to 2, the second edge server is the edge server other than the n first edge servers.

[0015] The parameters of the target model are sent to the second edge server of the target number, so that the second edge server can input the parameters of the target model and the training samples into the edge model to obtain the training results, calculate the third difference between the training results and the real results, and use the third difference as the loss value.

[0016] Receive the loss value sent by the second edge server and the loss value sent by the kth first edge server to the target number of receivers;

[0017] Calculate the mean of the loss values;

[0018] If the second difference between the mean and the loss value sent by the kth first edge server is within the second preset range, the first similarity between the edge parameter sent by the (k+1)th first edge server and the edge parameter sent by any first edge server other than the (k+1)th first edge server is taken as the second similarity.

[0019] In one possible implementation embodiment, it further includes:

[0020] If the second difference is not within the second preset range, target information is displayed to alert the user of intrusion.

[0021] In one possible implementation, calculating a first similarity between the first edge parameter and the second edge parameter includes:

[0022] Obtain the first Common Vulnerability Score (CVSS) value and attack detection log for each system vulnerability in n first-edge servers;

[0023] Based on the attack behavior information in the attack detection log, determine the second CVSS value involved in the attack behavior from the first CVSS value;

[0024] The similarity weight between any two first edge servers is calculated using the maximum value of the first CVSS value and the maximum value of the second CVSS value.

[0025] The first similarity between the first edge parameter and the second edge parameter is calculated using the similarity weight, the first edge parameter, and the second edge parameter.

[0026] In one possible implementation, before obtaining the edge parameters sent by the n first edge servers and the rounds in which the n edge servers each send the edge parameters, the method further includes:

[0027] The parameters of the target model are sent to n first edge servers so that the n first edge servers can train the edge model based on the parameters of the target model and use the training samples to determine the edge parameters of the edge model.

[0028] In one possible implementation embodiment, it further includes:

[0029] If the number of rounds exceeds the target value, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

[0030] In one possible implementation embodiment, it further includes:

[0031] In the case of round 1, the parameters of the target model are updated based on the edge parameters sent by n first edge servers to obtain the updated target model.

[0032] Secondly, embodiments of this application provide a model updating apparatus, comprising:

[0033] The acquisition module includes acquiring the edge parameters sent by n first edge servers, and the rounds in which the n edge servers send the edge parameters respectively;

[0034] The calculation module is used to calculate the first similarity between the first edge parameter and the second edge parameter respectively. The first edge parameter is the edge parameter sent by the first target edge server. The first target edge server is any one of the n first edge servers. The second edge parameter is the edge parameter sent by any first edge server other than the target first edge server.

[0035] The calculation module is also used to calculate the standard deviation of the first similarity, which represents the degree of fluctuation of the first similarity;

[0036] The calculation module is also used to calculate the first difference between the standard deviation and the standard deviation of the previous round when the round number is greater than 1 and not greater than the target value. The first difference represents the degree of closeness between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round.

[0037] The update module is used to update the parameters of the target model based on the edge parameters sent by n first edge servers, when the first difference is within a first preset range, so as to obtain the updated target model.

[0038] Thirdly, embodiments of this application provide an electronic device, the device comprising:

[0039] Processor and memory storing computer program instructions;

[0040] A method for updating the model of any one of the above when the processor executes computer program instructions.

[0041] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, wherein the computer program instructions, when executed by a processor, implement a method for updating the model as described above.

[0042] Fifthly, embodiments of this application provide a computer program product, characterized in that, when the instructions in the computer program product are executed by the processor of an electronic device, the electronic device is able to perform any of the above-mentioned model update methods.

[0043] The method, apparatus, device, and computer storage medium for model updating according to embodiments of this application include: acquiring edge parameters sent by n first edge servers and the rounds in which the n edge servers send edge parameters, where n≥2; calculating a first similarity between the first edge parameters and a second edge parameter, wherein the first edge parameter is an edge parameter sent by a first target edge server, the first target edge server is any one of the n first edge servers, and the second edge parameter is an edge parameter sent by any first edge server other than the target first edge server; calculating the standard deviation of the first similarity, wherein the standard deviation characterizes the degree of fluctuation of the first similarity; when the round is greater than 1 and not greater than a target value, calculating a first difference between the standard deviation and the standard deviation of the previous round, wherein the first difference characterizes the closeness between the degree of fluctuation of the first similarity in the current round and the degree of fluctuation of the first similarity in the previous round; and updating the parameters of the target model based on the edge parameters sent by the n first edge servers when the first difference is within a first preset range, thereby obtaining an updated target model. In this way, by calculating the fluctuation of the similarity of the edge parameters sent by each edge server, the difference between the fluctuation of the two training rounds is determined. Based on this difference, the corresponding edge server is tested for intrusion behavior. When there is external interference, the difference will be large. If the difference is within the preset range, it means that there is no external interference. Only the edge parameters that pass the test will be used for the update of the global model, thus improving the accuracy of the federated learning results. Attached Figure Description

[0044] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart illustrating a model update method provided in one embodiment of this application;

[0046] Figure 2 This is a flowchart illustrating a model update method provided in another embodiment of this application;

[0047] Figure 3 This is a flowchart illustrating a model update method provided in yet another embodiment of this application;

[0048] Figure 4 This is a schematic diagram of the structure of a model updating device provided in another embodiment of this application;

[0049] Figure 5 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0050] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended only to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0051] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0052] Federated learning is a distributed machine learning method. Its core idea is that edge servers do not need to exchange raw data; instead, they exchange only a small amount of intermediate computational results under end-to-end encryption to train a global model based on virtual fused data. Because the raw data is stored on each edge server in federated learning, data leakage is prevented, the pressure on a single server is reduced, and multi-party collaborative modeling is better achieved.

[0053] In federated learning, there is one cloud server and multiple edge servers. A complete round of federated learning involves the following steps: First, the cloud server initializes a global model and sends its parameters to each edge server. Second, the edge servers use the received global model parameters and training samples to train their own edge models, and then send the trained edge model parameters back to the cloud server. Third, after receiving the edge parameters from each edge server, the cloud server processes the edge parameters and updates the global model. After completing one round, the updated global model parameters are sent back to each edge server, and the process repeats for the next round. In this way, even without data exchange, only model parameter exchange, the model can be trained using data from multiple edge servers.

[0054] Although each edge server does not access the raw data of other edge servers, ensuring data security, the edge servers themselves are vulnerable to attacks by malicious clients, which can lead to inaccurate results calculated on each edge server, and consequently, inaccurate results from federated learning.

[0055] To address the problems of the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for model updating. This model updating method can be applied to cloud servers. The model updating method provided in this application embodiment is described below.

[0056] Figure 1 A schematic flowchart of a model update method provided in one embodiment of this application is shown.

[0057] like Figure 1 As shown, the model update method provided in this application embodiment includes S110 to S150.

[0058] S110. Obtain the edge parameters sent by the n first edge servers, and the rounds in which the n edge servers send the edge parameters respectively, where n≥2.

[0059] Here, the first edge server includes the edge server that performs the federated learning process.

[0060] In some embodiments, a round counter is used to record the round in which each of the n edge servers sends edge parameters. The system receives the edge parameters sent by the n first edge servers and obtains the round in which each of the n edge servers sent the edge parameters.

[0061] S120. Calculate the first similarity between the first edge parameter and the second edge parameter. The first edge parameter is the edge parameter sent by the first target edge server. The first target edge server is any one of the n first edge servers. The second edge parameter is the edge parameter sent by any first edge server other than the target first edge server.

[0062] As an example, if n edge servers send edge parameters in m rounds, calculate the first similarity between the first edge parameter sent by the first target edge server i and the second edge parameter sent by any first edge server j other than the target first edge server.

[0063] S130. Calculate the standard deviation of the first similarity. The standard deviation represents the degree of fluctuation of the first similarity.

[0064] In some embodiments, the standard deviation of all first similarities is calculated.

[0065] As an example, the standard deviation of the first similarity is calculated using formula (1). Formula (1) is as follows:

[0066]

[0067] in, Sim represents the standard deviation of the first similarity in the m-th round. m N represents the average of all first similarities in round m. sim This indicates the number of first-order similarities.

[0068] S140. When the number of rounds is greater than 1 and not greater than the target value, calculate the first difference between the standard deviation and the standard deviation of the previous round. The first difference represents the degree of closeness between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round.

[0069] In some embodiments, if the number of epochs is greater than 1 and not greater than the target value, the standard deviation of the previous epoch is obtained. The first difference between the standard deviation of the current epoch and the standard deviation of the previous epoch is calculated. Here, the target value can be a minimum number of model training epochs required to complete the federated learning process.

[0070] As an example, obtain the standard deviation of the (m-1)th round. Calculate the standard deviation of round (m-1) and the standard deviation of round (m). The first difference between them.

[0071] S150. If the first difference is within the first preset range, update the parameters of the target model based on the edge parameters sent by the n first edge servers to obtain the updated target model.

[0072] In some embodiments, if the standard deviation between two rounds is not significantly different (i.e., the difference (fluctuation) between the edge parameters sent by the n first edge servers in the two rounds is not significantly different), it indicates that there is no external interference, and the edge parameters sent by the n edge servers are considered normal, thus passing the intrusion behavior verification. If the intrusion behavior verification is passed, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model. Here, the target model is a global model. The update process of the global model is not unique and is not specifically limited here.

[0073] As an example, if Then, based on the edge parameters sent by the n first edge servers, the parameters of the target model are updated. For example, the global model is a finite optimization that satisfies formula (2), which is as follows:

[0074]

[0075] Where G(ω) is the target model after the m-th round update, n is the number of first edge servers, and i represents the first edge server i. Let i be the model parameters sent by the first edge server i in the m-th round. It is characterized by employing a batch stochastic gradient model, where the minimum gradient point is the optimal solution.

[0076] In this way, by calculating the fluctuation of the similarity of the edge parameters sent by each edge server, the difference between the fluctuation levels of two training rounds is determined. This difference is then used to perform intrusion behavior checks on the corresponding edge server. Under conditions of external interference, this difference will be large; if the difference is within a preset range, it indicates no external interference, and the test passes. Only edge parameters that pass the test are used to update the global model, improving the accuracy of the federated learning results.

[0077] Based on this, in some embodiments, such as Figure 2 As shown, the method may also include S210 to S270.

[0078] S210. If the first difference is not within the first preset range, the first similarity between the edge parameter sent by the kth first edge server and the edge parameter sent by any first edge server other than the kth first edge server is taken as the second similarity.

[0079] In some embodiments, if the first difference is not within a first preset range, that is, the standard deviation between the two rounds differs significantly, or the degree of difference (fluctuation) between the edge parameters sent by the n first edge servers in the two rounds differs significantly, it indicates the presence of external interference. In other words, the edge parameters sent by the n edge servers are considered abnormal and cannot pass the intrusion detection. Further, the abnormal edge parameters are searched for.

[0080] In some embodiments, during the process of searching for edge parameters that are abnormal, the first similarity between the edge parameter sent by the kth first edge server and the edge parameter sent by any first edge server other than the kth first edge server is used as the second similarity, and the parameters are verified one by one.

[0081] As an example, the second similarity between the edge parameters sent by the k-th first edge server and the edge parameters sent by any first edge server b other than the k-th first edge server can be used... This indicates that the second similarity includes n-1 similarities.

[0082] S220. Calculate the standard deviation of the second similarity.

[0083] As an example, calculate all second similarities. Standard deviation

[0084] S230. Determine the target number of the second edge server using the standard deviation of the first similarity, the standard deviation of the second similarity, and the number of the first edge servers. The target number is greater than or equal to 2. The second edge server is the edge server other than the n first edge servers.

[0085] As an example, based on the standard deviation of the first similarity, the standard deviation of the second similarity, and the number of the first edge servers, the target number of the second edge servers is calculated using formula (3), which is as follows:

[0086]

[0087] The second edge server is any edge server other than the n first edge servers. The second edge server is one that meets the target conditions, allowing for the determination of abnormal edge parameters among the first edge servers based on the second edge server's performance. The target conditions include that the edge server's system vulnerability information and attack information are similar to those of the first edge servers. It should be noted that the second edge server can be selected from a pre-selected pool of edge servers, where all pre-selected edge servers meet the target conditions.

[0088] S240. Send the parameters of the target model to the second edge server of the target number, so that the second edge server can input the parameters of the target model and the training samples into the edge model to obtain the training results, calculate the third difference between the training results and the true results, and use the third difference as the loss value.

[0089] In some embodiments, the edge model in the second edge server is the same as the edge model in the first edge server. The parameters of the target model are sent to a target number of second edge servers. The second edge servers input the parameters of the target model and training samples into the edge model, and after model training, the training result is obtained. Here, the model training process is the same as the model training process in the first edge server. A third difference between the training result and the true result is calculated, and this third difference is used as the loss value.

[0090] As an example, in the m-th round, the loss value obtained by the second edge server corresponding to the k-th first edge server is...

[0091] S250, Receive the loss value sent by the target number of second edge servers and the loss value sent by the kth first edge server.

[0092] In some embodiments, a second edge server receives a loss value, and the total number of loss values ​​is the target number. The loss values ​​sent by the target number of second edge servers may be the same or different.

[0093] S260, Calculate the mean of the loss values.

[0094] As an example, the total loss value for round m is calculated. mean

[0095] S270. If the second difference between the mean and the loss value sent by the kth first edge server is within the second preset range, the first similarity between the edge parameter sent by the (k+1)th first edge server and the edge parameter sent by any first edge server other than the (k+1)th first edge server is taken as the second similarity.

[0096] In some embodiments, the total loss value for the m-th round is calculated. The second difference between the mean of the edge parameters and the loss value sent by the kth first edge server is considered normal if the second difference falls within a second preset range. After determining that the edge parameters sent by the kth first edge server are normal, the first similarity between the edge parameters sent by the (k+1)th first edge server and the edge parameters sent by any other first edge server is used as the second similarity. This process continues to determine whether the edge parameters sent by the (k+1)th first edge server are normal until an abnormal edge parameter is found.

[0097] In this way, it is possible to determine whether the edge parameters sent by the first edge server are normal one by one, and then find the abnormal edge parameters.

[0098] Based on this, in some embodiments, the method may further include:

[0099] If the second difference is not within the second preset range, target information is displayed to alert the user of intrusion.

[0100] Here, the target information can be a message alerting the user to an intrusion, and the target information includes information about the first edge server.

[0101] In some embodiments, if the total loss value in the m-th round If the second difference between the mean value and the loss value sent by the kth first edge server is not within the second preset range, it indicates that the edge parameters sent by the kth first edge server are abnormal. Display target information to alert the user of any intrusion activity.

[0102] In this way, displaying target information for abnormal edge parameters can prompt the user to specify which edge server has been compromised.

[0103] Based on this, in some embodiments, such as Figure 3 As shown, the above S120 may specifically include:

[0104] S121. Obtain the first general vulnerability score system (CVSS) value and attack detection log for each system vulnerability in n first edge servers.

[0105] System vulnerabilities refer to flaws or errors in the logical design of application software or operating system software, which can be exploited by malicious actors to attack or control the entire computer by implanting Trojans, viruses, etc., stealing important data and information, or even damaging the system. CVSS is an industry-open standard designed to assess the severity of system vulnerabilities and help determine the urgency and importance of the required response. Its main purpose is to help establish a standard for measuring the severity of system vulnerabilities, allowing for comparison of the severity of system vulnerabilities and thus determining the priority of handling. CVSS scores are based on measurements across multiple dimensions, called metrics. The final score for a system vulnerability ranges from 0 to 10. System vulnerabilities with scores of 7-10 are generally considered relatively severe, those with scores between 4 and 6.9 are considered medium-level system vulnerabilities, and those between 0 and 3.9 are considered low-level system vulnerabilities.

[0106] Here, the first CVSS value and attack detection log of each system vulnerability are stored in n first edge servers, and the first general vulnerability scoring system CVSS value and attack detection log of each system vulnerability in the n first edge servers can be directly obtained.

[0107] S122. Based on the attack behavior information in the attack detection log, determine the second CVSS value involved in the attack behavior from the first CVSS value.

[0108] In some embodiments, based on the attack detection log, the CVSS value involved in the attack behavior information is found in the first CVSS value and used as the second CVSS value.

[0109] S123. Calculate the similarity weight between any two first edge servers using the maximum value of the first CVSS value and the maximum value of the second CVSS value.

[0110] In some embodiments, similarity weights need to be determined before calculating the first similarity.

[0111] As an example, based on the maximum value of the first CVSS value and the maximum value of the second CVSS value, the similarity weight of any two first edge servers is calculated using formula (4), which is as follows:

[0112]

[0113] in, The maximum value of the first CVSS value for all system vulnerabilities of the first edge server i. The maximum value of the first CVSS value for all system vulnerabilities on the first edge server j. The maximum value of the second CVSS value for the system vulnerability involved in the attack behavior in the first edge server i. The maximum value of the second CVSS value for the system vulnerability involved in the attack behavior in the first edge server j.

[0114] It should be noted that w ij The similarity weight between first edge server i and first edge server j is determined by the maximum first CVSS value of all system vulnerabilities of first edge server i, the maximum first CVSS value of all system vulnerabilities of first edge server j, the maximum second CVSS value involved in all attack behaviors of first edge server i, and the maximum second CVSS value involved in all attack behaviors of first edge server j. The CVSS value of a system vulnerability is obtained based on the vulnerability situation of the first edge server itself, with each system vulnerability corresponding to a CVSS value. The CVSS value involved in an attack behavior is determined by the attack behavior and the attacked system vulnerability. If a system vulnerability is attacked, the first CVSS value of that system vulnerability is used as the second CVSS value involved in the attack behavior.

[0115] S124. Calculate the first similarity between the first edge parameter and the second edge parameter using the similarity weight, the first edge parameter, and the second edge parameter.

[0116] As an example, based on the similarity weight, the first edge parameter, and the second edge parameter, the first similarity between the first edge parameter and the second edge parameter is calculated using formula (5), which is as follows:

[0117]

[0118] in, The model parameters sent to the first edge server i, i.e., the first parameters; The edge parameters sent to the first edge server j (excluding the first edge server i), i.e., the second parameter; w ij The similarity weight between the edge parameters sent by the first edge server i and the edge parameters sent by the first edge server j, that is, the similarity weight between the first parameter and the second parameter.

[0119] In this way, by calculating the similarity weight based on the system vulnerability, and then calculating the first similarity between the first edge parameter and the second edge parameter through the similarity weight, the value of the similarity is determined more accurately, thereby making the verification of intrusion behavior more accurate.

[0120] Based on this, in some embodiments, prior to the above S110, the method may further include:

[0121] The parameters of the target model are sent to n first edge servers so that the n first edge servers can train the edge model based on the parameters of the target model and use the training samples to determine the edge parameters of the edge model.

[0122] In some embodiments, the round counter is initially set to 0. If a first edge server is determined, the parameters of the target model are sent to n first edge servers. After sending the parameters of the target model to the n first edge servers, the round counter increments by 1.

[0123] In some embodiments, n first edge servers train an edge model using training samples based on the parameters of the target model, obtain a trained edge model, and determine the edge parameters of the edge model.

[0124] In some embodiments, if the round number is greater than 1 but not greater than the target value, the parameters of the target model updated in the m-th round are sent to n first edge servers. These n first edge servers then use the updated target model parameters to train an edge model using training samples, determining the edge parameters of the edge model, i.e., determining the edge parameters for round m+1. If m+1 is not greater than the target value, intrusion behavior verification continues. It can be understood that after sending the parameters of the target model updated in the m-th round to the n first edge servers, the round number recorded by the round counter is incremented by 1.

[0125] As an example, for the first edge server i, if it adopts a batch stochastic gradient model The formula (6) for calculating the edge parameters obtained after model training of the first edge server i is as follows:

[0126]

[0127] Where m is the round number, i.e., the current value of the round counter. The edge parameters are obtained after model training for the first edge server i in the m-th round. The edge parameters η are obtained after model training of the first edge server i in the (m-1)th round. i Let D be the learning rate of the first edge server i during model training. i These are the training samples in the first edge server i.

[0128] In this way, by setting initial model parameters and sending them to the first edge server, the first edge server can perform multiple rounds of model training to determine the federated learning results.

[0129] Based on this, in some embodiments, the method may further include:

[0130] If the number of rounds exceeds the target value, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

[0131] In some embodiments, when the number of rounds exceeds the target value, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model, thereby completing the training of the model in federated learning. The federated learning task can be performed based on the trained federated learning model.

[0132] In this way, the training process of the model in federated learning is completed when the number of rounds reaches a minimum that allows the model to complete the federated learning process.

[0133] Based on this, in some embodiments, the method may further include:

[0134] In the case of round 1, the parameters of the target model are updated based on the edge parameters sent by n first edge servers to obtain the updated target model.

[0135] In some embodiments, when the round is 1, there is no need to verify the intrusion behavior. The parameters of the target model are directly updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

[0136] In this way, by taking the edge parameters obtained in the first round as the normal state, we can verify whether the edge parameters in subsequent rounds are normal.

[0137] Based on the model updating method provided in the above embodiments, this application also provides specific implementations of the model updating apparatus. Please refer to the following embodiments.

[0138] First see Figure 4 The model update apparatus 300 provided in this application embodiment includes:

[0139] The acquisition module 310 includes acquiring the edge parameters sent by n first edge servers, and the rounds in which the n edge servers send the edge parameters respectively;

[0140] The calculation module 320 is used to calculate the first similarity between the first edge parameter and the second edge parameter. The first edge parameter is the edge parameter sent by the first target edge server. The first target edge server is any one of the n first edge servers. The second edge parameter is the edge parameter sent by any first edge server other than the target first edge server.

[0141] The calculation module 320 is also used to calculate the standard deviation of the first similarity, which represents the degree of fluctuation of the first similarity;

[0142] The calculation module 320 is also used to calculate the first difference between the standard deviation and the standard deviation of the previous round when the round is greater than 1 and not greater than the target value. The first difference represents the degree of closeness between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round.

[0143] The update module 330 is used to update the parameters of the target model based on the edge parameters sent by n first edge servers when the first difference is within a first preset range, so as to obtain the updated target model.

[0144] Accordingly, in some embodiments, the device 300 further includes:

[0145] The determining module is used to determine the first similarity between the edge parameter sent by the kth first edge server and the edge parameter sent by any first edge server other than the kth first edge server as the second similarity when the first difference is not within the first preset range.

[0146] Calculation module 320 is also used to calculate the standard deviation of the second similarity;

[0147] The determination module is also used to determine the target number of the second edge server using the standard deviation of the first similarity, the standard deviation of the second similarity, and the number of the first edge server. The target number is greater than or equal to 2, and the second edge server is the edge server other than the n first edge servers.

[0148] The sending module is used to send the parameters of the target model to the target number of second edge servers, so that the second edge servers can input the parameters of the target model and the training samples into the edge model, obtain the training results, calculate the third difference between the training results and the real results, and use the third difference as the loss value.

[0149] The receiving module is used to receive the loss value sent by the target number of second edge servers and the loss value sent by the kth first edge server;

[0150] The calculation module 320 is also used to calculate the mean of the loss value;

[0151] The determining module is further configured to, when the second difference between the mean and the loss value sent by the kth first edge server is within a second preset range, use the first similarity between the edge parameter sent by the (k+1)th first edge server and the edge parameter sent by any first edge server other than the (k+1)th first edge server as the second similarity.

[0152] Based on this, in some embodiments, the device 300 may further include:

[0153] The display module is used to display target information when the second difference is not within the second preset range, so as to alert the user to the existence of intrusion behavior.

[0154] Based on this, in some embodiments, the computing module 320 includes:

[0155] The acquisition unit is used to acquire the first Common Vulnerability Score System (CVSS) value and attack detection log for each system vulnerability in n first edge servers;

[0156] The determining unit is used to determine the second CVSS value involved in the attack behavior from the first CVSS value based on the attack behavior information in the attack detection log;

[0157] The calculation unit is used to calculate the similarity weight of any two first edge servers using the maximum value of the first CVSS value and the maximum value of the second CVSS value.

[0158] The calculation unit is used to calculate the first similarity between the first edge parameter and the second edge parameter using similarity weight, first edge parameter and second edge parameter.

[0159] Based on this, in some embodiments, the device 300 may further include:

[0160] The sending module is also used to send the parameters of the target model to the n first edge servers before obtaining the edge parameters sent by the n first edge servers and the rounds in which the n edge servers send the edge parameters respectively, so that the n first edge servers can train the edge model based on the parameters of the target model using training samples and determine the edge parameters of the edge model.

[0161] Based on this, in some embodiments, the device 300 may further include:

[0162] The update module 330 is also used to update the parameters of the target model based on the edge parameters sent by the n first edge servers when the number of rounds is greater than the target value, so as to obtain the updated target model.

[0163] Based on this, in some embodiments, the device 300 may further include:

[0164] The update module 330 is also used to update the parameters of the target model based on the edge parameters sent by the n first edge servers when the round is 1, so as to obtain the updated target model.

[0165] Each module of the model update apparatus provided in this application embodiment can realize the functions of each step of the above-described model update method and achieve its corresponding technical effects. For the sake of brevity, it will not be described in detail here.

[0166] Based on the same inventive concept, embodiments of this application also provide an electronic device.

[0167] Figure 5 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0168] An electronic device may include a processor 401 and a memory 402 storing computer program instructions.

[0169] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0170] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory.

[0171] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0172] The processor 401 implements any of the model update methods in the above embodiments by reading and executing computer program instructions stored in the memory 402.

[0173] In one example, the electronic device may also include a communication interface 403 and a bus 410. For example, Figure 5 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.

[0174] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0175] Bus 410 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VESA Local Bus, VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application contemplates any suitable bus or interconnection. The electronic device can perform the model update method in the embodiments of the present invention, thereby implementing the above-described model update method.

[0176] Furthermore, in conjunction with the model update methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the model update methods in the above embodiments.

[0177] This application also provides a computer program product in which the instructions, when executed by a processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described model update method embodiments.

[0178] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0179] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0180] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0181] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0182] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for updating a model, characterized in that, include: Obtain the edge parameters sent by n first edge servers, and the round in which the n first edge servers each sent the edge parameters, where n 2; Calculate the first similarity between the first edge parameter and the second edge parameter, wherein the first edge parameter is the edge parameter sent by the first target edge server, the first target edge server is any one of the n first edge servers, and the second edge parameter is the edge parameter sent by any first edge server other than the target first edge server; Calculate the standard deviation of the first similarity, whereby the standard deviation characterizes the degree of fluctuation of the first similarity; When the number of rounds is greater than 1 and not greater than the target value, the first difference between the standard deviation and the standard deviation of the previous round is calculated. The first difference represents the degree of closeness between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round. If the first difference is within a first preset range, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model; The calculation of the first similarity between the first edge parameter and the second edge parameter includes: Obtain the first CVSS value and attack detection log for each system vulnerability in the n first edge servers; Based on the attack behavior information in the attack detection log, determine the second CVSS value involved in the attack behavior from the first CVSS value; Based on the maximum value of the first CVSS value and the maximum value of the second CVSS value, the similarity weight of any two first edge servers is calculated using the following formula: in, For the first edge server and the first edge server Similarity weights between them The maximum value of the first CVSS value for all system vulnerabilities of the first edge server i. For the first edge server The maximum value of the first CVSS value for all system vulnerabilities. For the first edge server The maximum value of the second CVSS value of the system vulnerability involved in the attack. For the first edge server The maximum value of the second CVSS value of the system vulnerability involved in the attack behavior; the CVSS value of the system vulnerability is obtained based on the vulnerability situation of the first edge server itself, and the CVSS value is used to assess the severity of the system vulnerability; The first similarity between the first edge parameter and the second edge parameter is calculated using the similarity weight, the first edge parameter, and the second edge parameter.

2. The model update method according to claim 1, characterized in that, Also includes: If the first difference is not within the first preset range, the first similarity between the edge parameter sent by the kth first edge server and the edge parameter sent by any first edge server other than the kth first edge server is taken as the second similarity. Calculate the standard deviation of the second similarity; The target number of second edge servers is determined by using the standard deviation of the first similarity, the standard deviation of the second similarity, and the number of the first edge servers. The target number is greater than or equal to 2, and the second edge servers are edge servers other than the n first edge servers. The parameters of the target model are sent to the second edge server of the target number, so that the second edge server can input the parameters of the target model and the training samples into the edge model to obtain the training result, calculate the third difference between the training result and the real result, and use the third difference as the loss value; Receive the loss value sent by the target number of second edge servers and the loss value sent by the kth first edge server; Calculate the mean of the loss values; If the second difference between the mean and the loss value sent by the kth first edge server is within a second preset range, the first similarity between the edge parameter sent by the (k+1)th first edge server and the edge parameter sent by any first edge server other than the (k+1)th first edge server is taken as the second similarity.

3. The model update method according to claim 2, characterized in that, Also includes: If the second difference is not within the second preset range, target information is displayed to alert the user of intrusion.

4. The model update method according to claim 1, characterized in that, Before obtaining the edge parameters sent by the n first edge servers and the rounds in which the n first edge servers send the edge parameters, the method further includes: The parameters of the target model are sent to the n first edge servers so that the n first edge servers can train the edge model using training samples based on the parameters of the target model and determine the edge parameters of the edge model.

5. The model updating method according to any one of claims 1 to 4, characterized in that, Also includes: If the number of rounds exceeds the target value, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

6. The model update method according to claim 1, characterized in that, Also includes: In the case of round 1, the parameters of the target model are updated based on the edge parameters sent by the n first edge servers to obtain the updated target model.

7. A model updating apparatus, characterized in that, include: The acquisition module includes acquiring edge parameters sent by n first edge servers, and the round in which the n first edge servers each send edge parameters; The calculation module is used to calculate the first similarity between the first edge parameter and the second edge parameter, wherein the first edge parameter is the edge parameter sent by the first target edge server, the first target edge server is any one of the n first edge servers, and the second edge parameter is the edge parameter sent by any first edge server other than the target first edge server; The calculation of the first similarity between the first edge parameter and the second edge parameter includes: obtaining the first CVSS value and attack detection log of each system vulnerability in the n first edge servers; determining the second CVSS value involved in the attack behavior from the first CVSS value based on the attack behavior information in the attack detection log; and calculating the similarity weight of any two first edge servers using the following formula based on the maximum value of the first CVSS value and the maximum value of the second CVSS value: in, For the first edge server and the first edge server Similarity weights between them The maximum value of the first CVSS value for all system vulnerabilities of the first edge server i. For the first edge server The maximum value of the first CVSS value for all system vulnerabilities. For the first edge server The maximum value of the second CVSS value of the system vulnerability involved in the attack. For the first edge server The maximum value of the second CVSS value of the system vulnerability involved in the attack behavior; the CVSS value of the system vulnerability is obtained based on the system vulnerability situation of the first edge server itself, and the CVSS value is used to evaluate the severity of the system vulnerability; the first similarity between the first edge parameter and the second edge parameter is calculated using the similarity weight, the first edge parameter and the second edge parameter; The calculation module is also used to calculate the standard deviation of the first similarity, wherein the standard deviation represents the degree of fluctuation of the first similarity; The calculation module is further configured to calculate a first difference between the standard deviation and the standard deviation of the previous round when the round number is greater than 1 and not greater than the target value. The first difference represents the degree of closeness between the fluctuation of the first similarity in the current round and the fluctuation of the first similarity in the previous round. The update module is used to update the parameters of the target model based on the edge parameters sent by the n first edge servers when the first difference is within a first preset range, so as to obtain the updated target model.

8. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the model update method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the model update method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Federal learning method and device

    CN114091356A

  • Optimization method for modeling based on federated learning, and electronic device, storage medium and program product

    WO2023092792A1