Model parameter determination method, program product, storage medium and electronic equipment

By processing the prior training data set of edge devices on the target cloud server and interacting with other cloud servers, better global model parameters are determined, which solves the problem of slow convergence of model parameters in federated learning, and achieves the effect of accelerating model parameter convergence.

CN120069123APending Publication Date: 2025-05-30SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510088247.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In an edge computing environment, there is a problem that model parameters converge slowly during the update process of federated learning.

Method used

By obtaining the prior training data set of the target edge device on the target cloud server, using a distributed machine learning algorithm to calculate the global model parameters, and interact with other cloud servers to determine better global model parameters, and finally sending these parameters to the edge device for training.

Benefits of technology

This method accelerates the convergence of model parameters, reduces the number of iterations and training time, and improves the training efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069123A_ABST
    Figure CN120069123A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model parameter determination method, a program product, a storage medium and electronic equipment. The method comprises the following steps: acquiring a priori training data set sent by a plurality of target edge devices in a target edge device set at an initial moment; calculating a first global model parameter of a target global model of the target cloud server by using the priori training data set, the initial training parameter and the first loss function; other global model parameters sent by other cloud servers in the cloud server network system are acquired, and second global model parameters of the target global model are determined by using the first global model parameters and the other global model parameters; and sending the second global model parameters to a plurality of target edge devices. Through the method and the device, the problem that model parameter convergence cannot be accelerated in related technologies can be solved, and the effect of accelerating model parameter convergence is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computers, and more specifically, to a method for determining model parameters, a program product, a storage medium, and an electronic device. Background Art

[0002] With the advent of the digital age, edge computing is playing an increasingly important role in fields such as the Internet of Things, the Internet of Vehicles, intelligent security, intelligent factories, and intelligent education due to its advantages of strong computing and processing capabilities, low latency, and high data security. In practical applications, in order to make the edge computing environment more efficient, stable, and secure, the federated learning technology is usually adopted in the edge computing environment. Federated learning is a distributed machine learning method. In a federated learning environment, each edge device updates the local model by using the local dataset, and then realizes the training of the entire federated learning model parameters by sharing the model parameters through the server. Since the update of the model parameters of federated learning is performed on the edge device, the model parameters are easily affected by the computing power of the edge device and the dataset. From the perspective of algorithm performance, the gradient descent method or the stochastic gradient descent method is generally used to find the optimal model parameters, but there is a problem of slow convergence of the model parameters. Summary of the Invention

[0003] Embodiments of the present application provide a method for determining model parameters, a program product, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the convergence of model parameters cannot be accelerated.

[0004] According to an embodiment of the present application, a method for determining model parameters is provided, which is applied to a target cloud server. The target cloud server is any one of multiple cloud servers included in a cloud server network system. The multiple global models of the multiple cloud servers are models trained based on a distributed machine learning algorithm. The target cloud server is connected to a target edge device set. The method includes: obtaining a prior training data set sent by multiple target edge devices in the target edge device set at an initial moment, where the prior training data set includes multiple training subsets, and one target edge device corresponds to one training subset; using the prior training data set, initial training parameters, and a first loss function to calculate first global model parameters of a target global model of the target cloud server, where the first loss function is a loss function of the target cloud server with respect to the training subset; obtaining other global model parameters sent by other cloud servers in the cloud server network system, and using the first global model parameters and the other global model parameters to determine second global model parameters of the target global model, where the other global model parameters are model parameters of other global models calculated by other cloud servers in the cloud server network system using other prior training data sets of other edge devices, other initial training parameters, and other loss functions; sending the second global model parameters to the multiple target edge devices, where the target edge devices are used to train local models using the second global model parameters, and the target global model and the multiple local models of the multiple target edge devices are models trained based on the distributed machine learning algorithm.

[0005] In an exemplary embodiment, using the prior training data set, initial training parameters, and the loss function of the target cloud server to calculate first global model parameters of the target global model of the target cloud server includes: calculating a gradient of the target cloud server based on the prior training data set, the initial training parameters, and the first loss function to obtain a first gradient; performing a first gradient descent operation on the target global model using a first preset step size and the first gradient to update the initial training parameters to obtain the first global model parameters, where the first gradient descent operation is used to update the current parameters of the target global model.

[0006] In an exemplary embodiment, obtaining other global model parameters sent by other cloud servers in the cloud server network system, and determining second global model parameters of the target global model by using the first global model parameters and the other global model parameters includes: obtaining the other global model parameters sent by a target other cloud server in the other cloud servers based on the information interaction relationship between the target cloud server and the other cloud servers, where the information interaction relationship is used to describe whether there is direct information interaction between the cloud server and the other cloud servers, and there is direct information interaction between the target other cloud server and the target cloud server; in a case where there are multiple target other cloud servers, calculating an average value of the first global model parameters and the multiple other global model parameters to obtain the second global model parameters, where at least one of the other global models is included in one of the other cloud servers.

[0007] In an exemplary embodiment, after sending the second global model parameters to multiple target edge devices, the method further includes: obtaining multiple second gradients sent by the multiple target edge devices, where the multiple second gradients are gradients respectively calculated by the multiple target edge devices based on the second global model parameters and a second loss function, the second loss function is a loss function of the target edge device with respect to the training subset, and the second loss function is where i is used to represent the target edge device, and S i is used to represent the training subset, i,(q) is used to represent the training subset corresponding to the target edge device, and X i,(q) =(x i,(q) , y i,(q) ) is used to describe the model feature x i ,(q) input to the local model and the target result y i ,(q) output by the local model, θ is used to represent the parameter, and b is used to represent any training sample in the training subset; calculating model parameters of the target global model based on the multiple second gradients and the second global model parameters to obtain third global model parameters of the target global model.

[0008] In an exemplary embodiment, calculating the model parameters of the target global model based on the multiple second gradients and the second global model parameters to obtain the third global model parameters of the target global model includes: calculating the average value of the multiple second gradients to obtain an average gradient value; performing a second gradient descent operation on the target global model by using a second preset step size and the average gradient value to update the second global model parameters to obtain the third global model parameters, where the second gradient descent operation is used to update the current parameters of the target global model.

[0009] In an exemplary embodiment, after performing a second gradient descent operation on the target global model by using a second preset step size and the average gradient value to update the second global model parameters to obtain the third global model parameters, the method further includes: calculating the difference between the third global model parameters and the second global model parameters; in a case where the difference is less than a preset threshold, determining the third global model parameters as the optimal model parameters of the target global model and the local model; in a case where the difference is greater than or equal to the preset threshold, repeatedly performing a parameter update operation until the optimal model parameters that meet the preset conditions are obtained, where the parameter update operation includes: sending the Nth global model parameters to the multiple target edge devices; obtaining the Nth gradients obtained by the multiple target edge devices based on the Nth global model parameters and the second loss function; calculating the average value of the multiple Nth gradients to obtain the average gradient value of the (N - 2)th parameter update operation; performing a gradient descent operation by using a preset step size and the average gradient value of the (N - 2)th parameter update operation to obtain the (N + 1)th global model parameters, where N is a natural number greater than or equal to 3; sending the optimal model parameters to the multiple target edge devices, where the target edge devices are used to train the local model by using the optimal model parameters.

[0010] In an exemplary embodiment, the first loss function is where j is used to represent the target cloud server, and S j is used to represent the prior training data set, and X q =(x q , y q ) is used to describe the model feature x q input into the target global model and the target result y q output by the target global model, θ is used to represent parameters, and q is used to represent any training subset in the prior training data set.

[0011] According to another embodiment of the present application, a device for determining model parameters is provided, which is applied to a target cloud server. The target cloud server is any one of a plurality of cloud servers included in a cloud server network system. The plurality of global models of the plurality of cloud servers are models trained based on a distributed machine learning algorithm. The target cloud server is connected to a target edge device set. The device includes: a first acquisition module, configured to acquire a prior training data set sent by a plurality of target edge devices in the target edge device set at an initial moment, where the prior training data set includes a plurality of training subsets, and one target edge device corresponds to one training subset; a first calculation module, configured to calculate first global model parameters of a target global model of the target cloud server by using the prior training data set, initial training parameters, and a first loss function, where the first loss function is a loss function of the target cloud server with respect to the training subset; a second acquisition module, configured to acquire other global model parameters sent by other cloud servers in the cloud server network system, and determine second global model parameters of the target global model by using the first global model parameters and the other global model parameters, where the other global model parameters are model parameters of other global models calculated by other cloud servers in the cloud server network system by using other prior training data sets of other edge devices, other initial training parameters, and other loss functions; a first sending module, configured to send the second global model parameters to the plurality of target edge devices, where the target edge devices are configured to train local models by using the second global model parameters, and the target global model and the plurality of local models of the plurality of target edge devices are models trained based on the distributed machine learning algorithm.

[0012] In an exemplary embodiment, the first calculation module includes: a first calculation sub-module, configured to calculate a gradient of the target cloud server based on the prior training data set, the initial training parameters, and the first loss function to obtain a first gradient; a first execution sub-module, configured to perform a first gradient descent operation on the target global model by using a first preset step size and the first gradient to update the initial training parameters to obtain the first global model parameters, where the first gradient descent operation is used to update the current parameters of the target global model.

[0013] In an exemplary embodiment, the second obtaining module includes: a first obtaining sub-module, configured to obtain the other global model parameters sent by a target other cloud server among the other cloud servers based on the information interaction relationship between the target cloud server and the other cloud servers, where the information interaction relationship is used to describe whether there is a direct information interaction between the cloud server and the other cloud servers, and there is a direct information interaction between the target other cloud server and the target cloud server; a second calculating sub-module, configured to calculate the average value of the first global model parameter and the multiple other global model parameters to obtain the second global model parameter when there are multiple target other cloud servers, where at least one of the other global models is included in one of the other cloud servers.

[0014] In an exemplary embodiment, the apparatus further includes: a third obtaining module, configured to obtain multiple second gradients sent by multiple target edge devices after sending the second global model parameter to the multiple target edge devices, where the multiple second gradients are gradients respectively calculated by the multiple target edge devices based on the second global model parameter and a second loss function, the second loss function is a loss function of the target edge device with respect to the training subset, and the second loss function is where i is used to represent the target edge device, and S i is used to represent the training subset, i, (q) is used to represent the training subset corresponding to the target edge device, and X i,(q) =(x i,(q) , y i,(q) ) is used to describe the model feature x i , (q) input to the local model and the target result y i , (q) output by the local model, θ is used to represent a parameter, and b is used to represent any training sample in the training subset; a second calculating module, configured to calculate the model parameter of the target global model based on the multiple second gradients and the second global model parameter to obtain the third global model parameter of the target global model.

[0015] In an exemplary embodiment, the second calculating module includes: a third calculating sub-module, configured to calculate the average value of the multiple second gradients to obtain an average gradient value; a first execution sub-module, configured to perform a second gradient descent operation on the target global model by using a second preset step size and the average gradient value to update the second global model parameter to obtain the third global model parameter, where the second gradient descent operation is used to update the current parameter of the target global model.

[0016] In an exemplary embodiment, the above-mentioned device further includes: a third calculation module, configured to perform a second gradient descent operation on the above-mentioned target global model by using a second preset step size and the above-mentioned gradient average value, so as to update the above-mentioned second global model parameters. After obtaining the above-mentioned third global model parameters, calculate the difference between the above-mentioned third global model parameters and the above-mentioned second global model parameters; a first determination module, configured to, when the above-mentioned difference is less than a preset threshold, determine the above-mentioned third global model parameters as the optimal model parameters of the above-mentioned target global model and the above-mentioned local model; a first execution module, configured to, when the above-mentioned difference is greater than or equal to the above-mentioned preset threshold, repeatedly execute the parameter update operation until the above-mentioned optimal model parameters that meet the preset conditions are obtained, where the above-mentioned parameter update operation includes: sending the above-mentioned Nth global model parameters to a plurality of the above-mentioned target edge devices; obtaining the Nth gradients obtained by the plurality of the above-mentioned target edge devices based on the above-mentioned Nth global model parameters and the above-mentioned second loss function; calculating the average value of the plurality of the above-mentioned Nth gradients to obtain the gradient average value of the (N-2)th above-mentioned parameter update operation; using a preset step size and the gradient average value of the (N-2)th above-mentioned parameter update operation to perform a gradient descent operation to obtain the above-mentioned (N+1)th global model parameters, where N is a natural number greater than or equal to 3; a second sending module, configured to send the above-mentioned optimal model parameters to a plurality of the above-mentioned target edge devices, where the above-mentioned target edge devices are configured to train the above-mentioned local model by using the above-mentioned optimal model parameters.

[0017] In an exemplary embodiment, the above-mentioned first loss function is The above-mentioned j is used to represent the above-mentioned target cloud server, and the S j is used to represent the above-mentioned prior training data set, and the X q =(x q , y q ) is used to describe the model feature x input to the above-mentioned target global model q and the target result y output by the above-mentioned target global model q , the above-mentioned θ is used to represent parameters, and the q is used to represent any training subset in the above-mentioned prior training data set.

[0018] According to another embodiment of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is set to execute the steps in any one of the above-mentioned method embodiments when running.

[0019] According to another embodiment of the present application, there is also provided an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is set to run the computer program to execute the steps in any one of the above-mentioned method embodiments.

[0020] According to another embodiment of the present application, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0021] Through the present application, the target cloud server first obtains a prior training data set composed of a training subset of the target edge device, and uses the prior training data set, initial training parameters, and the first loss function to calculate the first global model parameters of the target global model of the target cloud server. Then, using the prior training data set, initial training parameters, and the first loss function, calculate the first global model parameters of the target global model of the target cloud server, and use the first global model parameters and other global model parameters to determine the second global model parameters of the target global model. Finally, send the second global model parameters to multiple target edge devices, and the target edge devices use the second global model parameters to train the local model. Since the present application uses the training subset of the target edge device as the training object of the target cloud server to obtain the first global model parameters, and shares the other global model parameters obtained by other cloud servers, and uses the first global model parameters and other global model parameters to determine the second global model parameters of the target global model as the initial value of the parameter update iteration between the target cloud server and the target edge device, it is possible to solve the problem that the model parameter convergence cannot be accelerated in the related art, and the effect of accelerating the model parameter convergence is achieved. Description of the Drawings

[0022] Figure 1 is a hardware structure block diagram of a server device for a method of determining model parameters according to an embodiment of the present application;

[0023] Figure 2 is a flowchart of a method of determining model parameters according to an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of a method of determining model parameters according to a specific embodiment of the present application Figure 1 ;

[0025] Figure 4 is a schematic diagram of a method of determining model parameters according to a specific embodiment of the present application Figure 2 ;

[0026] Figure 5 is a flowchart of a method of determining model parameters according to a specific embodiment of the present application;

[0027] Figure 6 is a structure block diagram of a device for determining model parameters according to an embodiment of the present application. Detailed Embodiments

[0028] Embodiments of the present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.

[0030] The method embodiments provided in the embodiments of the present application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 is a hardware structure block diagram of a server device for a method of determining model parameters according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned server device. For example, the server device may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.

[0031] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to a method of determining model parameters in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a method for determining model parameters is provided, which is applied to a target cloud server. The above target cloud server is any one of multiple cloud servers included in a cloud server network system. The multiple global models of the multiple above cloud servers are models trained based on a distributed machine learning algorithm. The above target cloud server is connected to a target edge device set. Figure 2 It is a flowchart of a method for determining model parameters according to an embodiment of the present application, as Figure 2 shown. The process includes the following steps:

[0034] Step S202: Obtain a priori training data sets sent by multiple target edge devices in the above target edge device set at an initial moment. Among them, the above a priori training data sets include multiple training subsets, and one above target edge device corresponds to one above training subset;

[0035] Optionally, a target edge device refers to an intelligent terminal or device selected to participate in the federated learning or data training process in an edge computing environment. The target edge device may be a user device, such as a personal mobile phone, a smart watch, an Internet of Things sensor, a sensor in a car, a home smart device, etc. The target edge device has its own training subset and computing power, and can perform data processing and model training locally. The target edge device set includes multiple target edge devices, and the training subset includes multiple training samples.

[0036] Optionally, the a priori training data set is data collected offline.

[0037] Step S204: Calculate first global model parameters of the target global model of the above target cloud server by using the above a priori training data set, initial training parameters, and a first loss function. Among them, the above first loss function is a loss function of the above target cloud server with respect to the above training subset;

[0038] Optionally, the initial training parameters are parameter values set at the beginning of model training for the target global model. The initial training parameters may be based on certain assumptions or a set of predefined random values.

[0039] Step S206: Obtain other global model parameters sent by other cloud servers in the cloud server network system, and determine the second global model parameters of the target global model by using the first global model parameters and the other global model parameters. The other global model parameters are the model parameters of other global models calculated by other cloud servers in the cloud server network system by using other prior training data sets, other initial training parameters, and other loss functions of other edge devices.

[0040] Optionally, the other loss function is a function of the cloud server with respect to other training subsets.

[0041] Optionally, the method for other cloud servers to calculate other global model parameters is the same as that of the target cloud server.

[0042] Step S208: Send the second global model parameters to multiple target edge devices. The target edge devices are used to train local models by using the second global model parameters. The target global model and multiple local models of the multiple target edge devices are models trained based on the distributed machine learning algorithm.

[0043] Optionally, as Figure 3 shown, Figure 3 is a schematic diagram of a method for determining model parameters according to a specific embodiment of the present application Figure 1 , for example, Cloud Server 1 is the target cloud server, and Cloud Server 2 and Cloud Server 3 are other cloud servers. Cloud Server 1, Cloud Server 2, and Cloud Server 3 constitute a cloud server network system. User Devices 1 to 100 constitute the target edge device set of Cloud Server 1, and the training subsets of User Devices 1 to 100 constitute the prior training data set of Cloud Server 1. User Devices 101 to 200 constitute the other edge device set of Cloud Server 2, and the training subsets of User Devices 101 to 200 constitute the other prior training data set of Cloud Server 2. User Devices 201 to 300 constitute the other edge device set of Cloud Server 3, and the training subsets of User Devices 201 to 300 constitute the other prior training data set of Cloud Server 3. Cloud Server 1 determines the first global model parameters based on the prior training data set, and obtains other global model parameters determined by Cloud Server 2 and Cloud Server 3 based on other prior training data sets. Cloud Server 1 determines the second global model parameters sent to User Devices 1 to 100 based on the first global model parameters and the other global model parameters.

[0044] Through the above steps, the target cloud server first obtains a prior training data set composed of training subsets of the target edge devices, and uses the prior training data set, the initial training parameters, and the first loss function to calculate the first global model parameters of the target global model of the target cloud server. Then, using the prior training data set, the initial training parameters, and the first loss function, calculate the first global model parameters of the target global model of the target cloud server, and use the first global model parameters and other global model parameters to determine the second global model parameters of the target global model. Finally, send the second global model parameters to multiple target edge devices, and the target edge devices use the second global model parameters to train the local model. Since in this embodiment, the training subsets of the target edge devices are used as the training objects of the target cloud server to obtain the first global model parameters, and the other global model parameters obtained by other cloud servers are shared, and the first global model parameters and other global model parameters are used to determine the second global model parameters of the target global model as the initial values for parameter update iteration between the target cloud server and the target edge devices, the problem of unable to accelerate the convergence of model parameters in the related art can be solved, and the effect of accelerating the convergence of model parameters is achieved.

[0045] In an exemplary embodiment, calculating the first global model parameters of the target global model of the target cloud server by using the above prior training data set, the initial training parameters, and the loss function of the target cloud server includes: calculating the gradient of the target cloud server based on the prior training data set, the initial training parameters, and the first loss function to obtain a first gradient; performing a first gradient descent operation on the target global model by using a first preset step size and the first gradient to update the initial training parameters to obtain the first global model parameters, where the first gradient descent operation is used to update the current parameters of the target global model.

[0046] Optionally, the first loss function is the loss function of the target cloud server with respect to the training subset, and the first gradient is the partial derivative of the first loss function with respect to the initial training parameters.

[0047] Optionally, calculate the gradient of the target cloud server based on the above prior training dataset, the above initial training parameters, and the above first loss function to obtain a first gradient, including: input the training subset in the prior training dataset and the initial training parameters into the first loss function to obtain a first loss function value; calculate the partial derivative of the first loss function value with respect to the initial training parameters to obtain the first gradient. Optionally, perform a first gradient descent operation on the target global model using the first preset step size and the above first gradient to update the above initial training parameters to obtain the above first global model parameters, including: calculate the product of the first preset step size and the first gradient to obtain a first product; calculate the difference between the initial training parameters and the first product to obtain the first global model parameters. By inputting the training subset in the prior training dataset and the initial training parameters into the first loss function together to calculate the first gradient, a more accurate gradient estimate can be obtained, which reflects the deviation between the model and the data distribution under the current parameter settings, and realizes more accurate iteration in the direction of minimizing the loss.

[0048] Optionally, the first gradient descent operation is used to adjust the current parameters of the target global model according to the direction of the gradient, for example, by using the gradient descent method to update the model parameters.

[0049] In this embodiment, by obtaining the prior training dataset, the target cloud server can obtain preliminary information about the data distribution from the diverse training subsets of the target edge devices, enabling the determination of model parameters to start from a more reasonable and closer-to-optimal solution point. At the same time, the first gradient descent operation can more quickly guide the model parameters towards the optimal solution, achieving the purpose of reducing the number of iterations and training time and accelerating convergence.

[0050] In an exemplary embodiment, obtain the other global model parameters sent by other cloud servers in the above cloud server network system, and use the above first global model parameters and the above other global model parameters to determine the second global model parameters of the target global model, including: based on the information interaction relationship between the target cloud server and the other cloud servers, obtain the above other global model parameters sent by the target other cloud server in the other cloud servers, where the information interaction relationship is used to describe whether there is a direct information interaction between the cloud server and the other cloud servers, and the target other cloud server has a direct information interaction with the target cloud server; in the case where there are multiple target other cloud servers, calculate the average value of the first global model parameters and the multiple above other global model parameters to obtain the second global model parameters, where one of the above other cloud servers includes at least one of the above other global models.

[0051] Optionally, the information interaction relationship can be obtained through a directed graph, and the directed graph can be obtained through a directed graph model.

[0052] Optionally, before obtaining the other global model parameters sent by the target other cloud server among the other cloud servers based on the information interaction relationship between the target cloud server and the other cloud servers, the method further includes: constructing a directed graph between the target cloud server and the other cloud servers, where the directed graph is a strongly connected graph composed of the union of a vertex set and an edge set, the vertex set is used to represent the target cloud server and the other cloud servers, and the union of the edge sets is used to represent the connection relationship between the target cloud server and the other cloud servers; obtaining the information interaction relationship between the target cloud server and the other cloud servers through the directed graph.

[0053] In this embodiment, through the information interaction relationship, the target cloud server and other target cloud servers can transmit their own model parameters, and the target cloud server uses the other global model parameters sent by the other target cloud servers to achieve the purpose of sharing and consensus of the prior training dataset and other prior training datasets.

[0054] In an exemplary embodiment, after sending the second global model parameters to multiple target edge devices, the method further includes: obtaining multiple second gradients sent by the multiple target edge devices, where the multiple second gradients are gradients respectively calculated by the multiple target edge devices based on the second global model parameters and a second loss function, the second loss function is the loss function of the target edge device with respect to the training subset, and the second loss function is where i is used to represent the target edge device, Si is used to represent the training subset, i,(q) is used to represent the training subset corresponding to the target edge device, and X i,(q) =(x i,(q) , y i,(q) ) is used to describe the model feature x i ,(q) input to the local model and the target result y i ,(q) output by the local model, θ is used to represent the parameter, and b is used to represent any training sample in the training subset; calculating the model parameters of the target global model based on the multiple second gradients and the second global model parameters to obtain the third global model parameters of the target global model.

[0055] Optionally, the second gradient is the partial derivative of the second loss function with respect to the second global model parameters.

[0056] Optionally, the second gradient calculated by the target edge device based on the above-mentioned second global model parameters and the second loss function respectively includes: inputting the training samples in the training subset and the second global model parameters into the second loss function to obtain a second loss function value; calculating the partial derivative of the second loss function value with respect to the second global model parameters to obtain the second gradient.

[0057] Optionally, as Figure 4 shown, Figure 4 is a schematic diagram of a method for determining model parameters according to a specific embodiment of the present application Figure 2 , for example, cloud server 1 is the target cloud server, and the training subsets of user devices 1 to 100 constitute the prior training data set of cloud server 1. After cloud server 1 determines the second global model parameters based on the prior training data set, it sends the second global model parameters to user devices 1 to 100. User devices 1 to 100 replace the current parameters of the local model with the second global model parameters, and feedback the second gradient calculated based on the second global model parameters and the second loss function to cloud server 1.

[0058] In this embodiment, by sending the optimized second global model parameters to the target edge device, the target edge device can obtain a better second gradient based on the better model parameters, achieving the purpose of accelerating the convergence of model parameters and reducing the number of iterations. At the same time, the calculation of the second gradient is based on the respective training subsets of the target edge devices, and these training subsets may represent different application fields. Collecting these second gradients to the target cloud server and combining them with the second global model parameters to calculate the third global model parameters helps the model better understand the diversity and complexity of the data, achieving the purpose of enhancing the generalization ability of the model.

[0059] In an exemplary embodiment, calculating the model parameters of the target global model based on multiple above-mentioned second gradients and the above-mentioned second global model parameters to obtain the third global model parameters of the target global model includes: calculating the average value of multiple above-mentioned second gradients to obtain an average gradient value; using a second preset step size and the above-mentioned average gradient value to perform a second gradient descent operation on the target global model to update the above-mentioned second global model parameters to obtain the above-mentioned third global model parameters, where the above-mentioned second gradient descent operation is used to update the current parameters of the target global model.

[0060] Optionally, using a second preset step size and the above-mentioned average gradient value to perform a second gradient descent operation on the target global model to update the above-mentioned second global model parameters to obtain the above-mentioned third global model parameters includes: calculating the product of the second preset step size and the second gradient to obtain a second product; calculating the difference between the second global model parameters and the second product to obtain the third global model parameters.

[0061] Optionally, a second gradient descent operation is used to adjust the current parameters of the target global model according to the direction of the gradient, for example, by using the gradient descent method to update the model parameters.

[0062] In this embodiment, by calculating the average value of the second gradient and using the gradient average value for gradient descent, compared with single gradient update, gradient averaging can more stably guide the parameter update direction, reduce the fluctuations caused by local data distribution imbalance, enable the global model parameters to approach the optimal solution faster, and achieve the purpose of accelerating convergence.

[0063] In an exemplary embodiment, after performing a second gradient descent operation on the target global model by using a second preset step size and the above-mentioned gradient average value to update the second global model parameters and obtaining the third global model parameters, the method further includes: calculating the difference between the third global model parameters and the second global model parameters; when the difference is less than a preset threshold, determining the third global model parameters as the optimal model parameters of the target global model and the local model; when the difference is greater than or equal to the preset threshold, repeating the parameter update operation until the optimal model parameters that meet the preset conditions are obtained, where the parameter update operation includes: sending the Nth global model parameters to a plurality of the target edge devices; obtaining the Nth gradient obtained by the plurality of target edge devices based on the Nth global model parameters and the second loss function; calculating the average value of the plurality of Nth gradients to obtain the gradient average value of the (N - 2)th parameter update operation; using the preset step size and the gradient average value of the (N - 2)th parameter update operation to perform a gradient descent operation to obtain the (N + 1)th global model parameters, where N is a natural number greater than or equal to 3; sending the optimal model parameters to a plurality of the target edge devices, where the target edge devices are used to train the local model by using the optimal model parameters.

[0064] Optionally, the preset condition may be that the difference between the (N + 1)th global model parameters and the Nth global model parameters is less than the preset threshold.

[0065] In an exemplary embodiment, the first loss function is The above j is used to represent the target cloud server, and the S j is used to represent the prior training data set, and the X q =(x q , y q ) is used to describe the model feature x input to the target global model q and the target result y output by the target global model q, where the above θ is used to represent a parameter, and the above q is used to represent any training subset in the above prior training dataset.

[0066] Optionally, the first loss function measures the risk brought by the model parameters and the training subset.

[0067] The present application will be described below with reference to specific embodiments:

[0068] In this specific embodiment, for example, there are N user devices in the network, and the N users are evenly divided into p groups (in specific applications, the users may not be evenly distributed). Therefore, each group includes users. For each group of user devices, a cloud server is equipped. A cloud server and users form a federated learning subsystem. Different cloud servers build a sparse cloud server network system, and there is information transmission between each cloud server and other cloud servers. The cloud server network is defined as G=(V, E(k), A(k)), where V is a set composed of p cloud servers, E(k) is a set of directed edges, and the edges connect each cloud server. is the weight matrix and the elements therein are For any i ∈ V, we define the user device set U [i] such that The specific implementation is as follows:

[0069] Figure 5 is a flowchart of a method for determining model parameters according to a specific embodiment of the present application. As Figure 5 shown, it specifically includes the following steps:

[0070] S502, each user device saves a certain number of training samples The user device randomly and uniformly samples training samples from the training samples to form a training subset That is and sends the training subset to the target cloud server j;

[0071] When the target cloud server J obtains the training subsets sent by all user devices in the federated learning subsystem at the initial moment after that, a prior training dataset S j is obtained:

[0072] S504, define the first loss function of the target cloud server j: where X q =(x q , y q ) ∈ R d ×R is a feature and target pair, is a set of model parameters.

[0073] Then, the target server j uses the initial training parameters to calculate the first gradient Then, the target cloud server j selects the first preset step size η and performs the following gradient descent method: to calculate the first global model parameters

[0074] S506. The cloud servers share parameters with each other to obtain the second global model parameters:

[0075] The information exchange in the cloud server network system can be modeled as a directed graph. Specifically: If at time k, (j, i) ∈ E(k), then Otherwise First, for example, there exists a constant α > 0 such that And At k ≥ 0, it satisfies Second, construct the weight such that for all j ∈ V, and for all i ∈ V, Finally, for example, there exists an integer B > 0 such that for any initial time k 0 ≥ 0, the directed graph is strongly connected.

[0076] Considering the static average consensus algorithm problem, here other cloud servers and the target cloud server j transmit to each other the calculated by themselves, so that the model parameters converge to the average value of the initial training parameters. Specifically, at each time k, the target cloud server j receives the current estimates from other cloud servers and updates its own estimate in a convex hull. A more accurate mathematical representation is that the update law of the target cloud server j ∈ V is: where is the state of the j-th cloud server, used to estimate the in the cloud server network system, that is, when the time scale iterates infinitely many steps, the state of each cloud server can approach the average initial value of the states of all cloud servers in the cloud server network system. Expressed in a mathematical formula as:

[0077] To achieve the average consensus of gradients in the cloud server network system, let In the cloud server network system, when the static average consensus algorithm iterates infinitely many steps, the final first global model parameters of the cloud servers reach a consensus, that is, the second global model parameters are the average of the first global model parameters and multiple other global model parameters:

[0078] S508, the target cloud server j sends the second global model parameters to the user devices. After all user devices receive the parameter θ * , they perform the calculation of the second gradient and send the calculated second gradient to the target cloud server j.

[0079] S510, obtain the second gradient obtained by the target edge device based on the second global model parameters;

[0080] S512, after the target cloud server j receives multiple , it performs the average operation of the gradients For the convenience of description, define the average value of the gradients as The target cloud server j updates the model parameters by using the gradient descent method to obtain the third global model parameters

[0081] S514, calculate the difference between the third global model parameters and the second global model parameters. When the difference is less than the preset threshold, the third global model parameters are the optimal model parameters of the target global model and the local model, and go to S518. Otherwise, go to S516;

[0082] S516, repeatedly execute the parameter update operation to obtain the optimal model parameters. One step of the parameter update operation: send the third global model parameters to the user devices, the user devices calculate the third gradient based on the third global model parameters, the target cloud server obtains the fourth global model parameters based on the third gradient and the third global model parameters, calculate the difference between the fourth global model parameters and the third global model parameters, and when the difference is less than the preset threshold, determine the fourth global model parameters as the optimal model parameters.

[0083] S518, send the optimal model parameters to multiple target edge devices, where the target edge devices are used to train the local model by using the optimal model parameters.

[0084] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.

[0085] In this embodiment, a device for determining model parameters is further provided, which is applied to a target cloud server. The target cloud server is any one of multiple cloud servers included in a cloud server network system. The multiple global models of the multiple cloud servers are models trained based on a distributed machine learning algorithm. The target cloud server is connected to a target edge device set. This device is used to implement the above embodiment and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0086] Figure 6 It is a structural block diagram of a device for determining model parameters according to an embodiment of the present application. As Figure 6 shown, the device includes:

[0087] A first acquisition module 602, configured to acquire a prior training data set sent by multiple target edge devices in the target edge device set at an initial moment. Among them, the prior training data set includes multiple training subsets, and one target edge device corresponds to one training subset;

[0088] A first calculation module 604, configured to calculate first global model parameters of the target global model of the target cloud server by using the prior training data set, initial training parameters, and a first loss function. Among them, the first loss function is a loss function of the target cloud server with respect to the training subset;

[0089] A second acquisition module 606, configured to acquire other global model parameters sent by other cloud servers in the cloud server network system, and determine second global model parameters of the target global model by using the first global model parameters and the other global model parameters. Among them, the other global model parameters are model parameters of other global models calculated by other cloud servers in the cloud server network system by using other prior training data sets of other edge devices, other initial training parameters, and other loss functions;

[0090] A first sending module 608, configured to send the second global model parameters to multiple target edge devices. Among them, the target edge devices are used to train local models by using the second global model parameters, and the target global model and multiple local models of the multiple target edge devices are models trained based on the distributed machine learning algorithm.

[0091] In an exemplary embodiment, the above-mentioned first calculation module includes: a first calculation sub-module, configured to calculate the gradient of the target cloud server based on the above-mentioned prior training data set, the above-mentioned initial training parameters, and the above-mentioned first loss function, to obtain a first gradient; a first execution sub-module, configured to perform a first gradient descent operation on the above-mentioned target global model by using a first preset step size and the above-mentioned first gradient, so as to update the above-mentioned initial training parameters, and obtain the above-mentioned first global model parameters, where the above-mentioned first gradient descent operation is used to update the current parameters of the above-mentioned target global model.

[0092] In an exemplary embodiment, the above-mentioned second acquisition module includes: a first acquisition sub-module, configured to acquire the above-mentioned other global model parameters sent by a target other cloud server in the above-mentioned other cloud servers based on the information interaction relationship between the above-mentioned target cloud server and the above-mentioned other cloud servers, where the above-mentioned information interaction relationship is used to describe whether there is a direct information interaction between the above-mentioned cloud server and the above-mentioned other cloud servers, and there is a direct information interaction between the above-mentioned target other cloud server and the above-mentioned target cloud server; a second calculation sub-module, configured to calculate the average value of the above-mentioned first global model parameters and multiple above-mentioned other global model parameters to obtain the above-mentioned second global model parameters when there are multiple above-mentioned target other cloud servers, where at least one of the above-mentioned other global models is included in one of the above-mentioned other cloud servers.

[0093] In an exemplary embodiment, the above-mentioned device further includes: a third acquisition module, configured to acquire multiple second gradients sent by multiple above-mentioned target edge devices after sending the above-mentioned second global model parameters to the multiple above-mentioned target edge devices, where the multiple above-mentioned second gradients are gradients respectively calculated by the multiple above-mentioned target edge devices based on the above-mentioned second global model parameters and a second loss function, the above-mentioned second loss function is a loss function of the above-mentioned target edge device with respect to the above-mentioned training subset, and the above-mentioned second loss function is where the above-mentioned i is used to represent the above-mentioned target edge device, and the above-mentioned S i is used to represent the above-mentioned training subset, the above-mentioned i,(q) is used to represent the above-mentioned training subset corresponding to the above-mentioned target edge device, the above-mentioned X i,(q) =(x i,(q) ,y i,(q) ) is used to describe the model feature x i ,(q) input to the above-mentioned local model and the target result y i ,(q) output by the above-mentioned local model, the above-mentioned θ is used to represent parameters, and the above-mentioned b is used to represent any training sample in the above-mentioned training subset; a second calculation module, configured to calculate the model parameters of the above-mentioned target global model based on the multiple above-mentioned second gradients and the above-mentioned second global model parameters, and obtain the above-mentioned third global model parameters of the above-mentioned target global model.

[0094] In an exemplary embodiment, the second computing module includes: a third computing sub-module configured to calculate an average value of the plurality of second gradients to obtain a gradient average value; a first execution sub-module configured to perform a second gradient descent operation on the target global model by using a second preset step size and the gradient average value to update the second global model parameters to obtain the third global model parameters, wherein the second gradient descent operation is used to update the current parameters of the target global model.

[0095] In an exemplary embodiment, the apparatus further includes: a third computing module configured to perform a second gradient descent operation on the target global model by using a second preset step size and the gradient average value to update the second global model parameters, and after obtaining the third global model parameters, calculate a difference between the third global model parameters and the second global model parameters; a first determination module configured to, when the difference is less than a preset threshold, determine the third global model parameters as the optimal model parameters of the target global model and the local model; a first execution module configured to, when the difference is greater than or equal to the preset threshold, repeatedly execute a parameter update operation until the optimal model parameters that meet the preset conditions are obtained, wherein the parameter update operation includes: sending the Nth global model parameters to a plurality of the target edge devices; obtaining the Nth gradients obtained by the plurality of the target edge devices based on the Nth global model parameters and the second loss function; calculating an average value of the plurality of the Nth gradients to obtain a gradient average value of the (N - 2)th parameter update operation; performing a gradient descent operation by using a preset step size and the gradient average value of the (N - 2)th parameter update operation to obtain the (N + 1)th global model parameters, where N is a natural number greater than or equal to 3; a second sending module configured to send the optimal model parameters to a plurality of the target edge devices, wherein the target edge devices are configured to train the local model by using the optimal model parameters.

[0096] In an exemplary embodiment, the first loss function is where j is used to represent the target cloud server, and S j is used to represent the prior training data set, and X q =(x q , y q ) is used to describe the model feature x q input to the target global model and the target result y q output by the target global model, θ is used to represent parameters, and q is used to represent any training subset in the prior training data set.

[0097] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0098] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0099] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs that can store computer programs.

[0100] An embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0101] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0102] An embodiment of the present application also provides a computer program product. The above computer program product includes a computer program, and the above computer program implements the steps in any one of the above method embodiments when executed by a processor.

[0103] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The above non-volatile computer-readable storage medium stores a computer program, and the above computer program implements the steps in any one of the above method embodiments when executed by a processor.

[0104] An embodiment of the present application also provides a computer program. The above computer program includes computer instructions, and the above computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the above computer instructions from the computer-readable storage medium, and the processor executes the above computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0105] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0106] Obviously, those skilled in the art should understand that the various modules or steps of the present application described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0107] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for determining model parameters, characterized in that: Applied to a target cloud server, the target cloud server is any one of a plurality of cloud servers included in a cloud server network system, a plurality of global models of the plurality of cloud servers are models trained based on a distributed machine learning algorithm, the target cloud server is connected to a target edge device set, and the method comprises: Obtain a priori training data set sent by multiple target edge devices in the target edge device set at an initial moment, wherein the priori training data set includes multiple training subsets, and one target edge device corresponds to one training subset; Calculating first global model parameters of a target global model of the target cloud server using the prior training data set, initial training parameters, and a first loss function, wherein the first loss function is a loss function of the target cloud server with respect to the training subset; Obtain other global model parameters sent by other cloud servers in the cloud server network system, and determine second global model parameters of the target global model using the first global model parameters and the other global model parameters, wherein the other global model parameters are model parameters of other global models calculated by other cloud servers in the cloud server network system using other prior training data sets, other initial training parameters, and other loss functions of other edge devices; The second global model parameters are sent to the multiple target edge devices, wherein the target edge devices are used to train local models using the second global model parameters, and the target global model and the multiple local models of the multiple target edge devices are models trained based on the distributed machine learning algorithm.

2. The method according to claim 1, characterized in that Calculating a first global model parameter of a target global model of the target cloud server by using the prior training data set, the initial training parameters, and the loss function of the target cloud server includes: Calculate the gradient of the target cloud server based on the prior training data set, the initial training parameters and the first loss function to obtain a first gradient; A first gradient descent operation is performed on the target global model using a first preset step size and the first gradient to update the initial training parameters to obtain the first global model parameters, wherein the first gradient descent operation is used to update the current parameters of the target global model.

3. The method according to claim 1, characterized in that Acquiring other global model parameters sent by other cloud servers in the cloud server network system, and determining second global model parameters of the target global model using the first global model parameters and the other global model parameters, including: Based on the information interaction relationship between the target cloud server and the other cloud servers, obtaining the other global model parameters sent by the target other cloud servers among the other cloud servers, wherein the information interaction relationship is used to describe whether there is direct information interaction between the cloud server and the other cloud servers, and the target other cloud servers have direct information interaction with the target cloud server; In the case where the target other cloud servers include multiple ones, the first global model parameter and the average value of the multiple other global model parameters are calculated to obtain the second global model parameter, wherein one of the other cloud servers includes at least one other global model.

4. The method according to claim 1, characterized in that: After sending the second global model parameters to the plurality of target edge devices, the method further includes: Obtain multiple second gradients sent by multiple target edge devices, wherein the multiple second gradients are gradients calculated by multiple target edge devices based on the second global model parameters and the second loss function, respectively, the second loss function is the loss function of the target edge device with respect to the training subset, and the second loss function is The i is used to represent the target edge device, the S i is used to represent the training subset, the i, (q) is used to represent the training subset corresponding to the target edge device, the X i,(q) =(x i,(q) ,y i,(q) ) is used to describe the model features x input to the local model i,(q) And the target result y output by the local model i,(q) , the θ is used to represent a parameter, and the b is used to represent any training sample in the training subset; The model parameters of the target global model are calculated based on the plurality of second gradients and the second global model parameters to obtain third global model parameters of the target global model.

5. The method according to claim 4, characterized in that Calculating the model parameters of the target global model based on the plurality of the second gradients and the second global model parameters to obtain third global model parameters of the target global model comprises: Calculate an average value of a plurality of the second gradients to obtain a gradient average value; A second gradient descent operation is performed on the target global model using a second preset step size and the gradient average to update the second global model parameters to obtain the third global model parameters, wherein the second gradient descent operation is used to update the current parameters of the target global model.

6. The method according to claim 5, characterized in that After performing a second gradient descent operation on the target global model using a second preset step size and the gradient average to update the second global model parameters and obtaining the third global model parameters, the method further includes: calculating a difference between the third global model parameter and the second global model parameter; When the difference is less than a preset threshold, determining the third global model parameter as the optimal model parameter of the target global model and the local model; In the case where the difference is greater than or equal to the preset threshold, the parameter update operation is repeatedly performed until the optimal model parameters that meet the preset conditions are obtained, wherein the parameter update operation includes: sending the Nth global model parameter to multiple target edge devices; obtaining the Nth gradient obtained by multiple target edge devices based on the Nth global model parameter and the second loss function; calculating the average value of multiple Nth gradients to obtain the gradient average value of the N-2th parameter update operation; using the preset step size and the gradient average value of the N-2th parameter update operation, performing a gradient descent operation to obtain the N+1th global model parameter, where N is a natural number greater than or equal to 3; The optimal model parameters are sent to the plurality of target edge devices, wherein the target edge devices are used to train the local model using the optimal model parameters.

7. The method according to claim 2, characterized in that: The first loss function is The j is used to represent the target cloud server, the S j is used to represent the prior training data set, the X q =(x q ,y q ) is used to describe the model features x input into the target global model q And the target result y output by the target global model q , the θ is used to represent the parameter, and the q is used to represent any training subset in the prior training data set.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.