Model updating method, working node and model updating system

By transferring model parameters, gradients and impulses between working nodes in the same sub-network for model updating, it solves the privacy security and efficiency issues of traditional distributed machine learning systems, achieves decentralized and personalized model updating, and improves Computing speed and privacy security.

CN112651510BActive Publication Date: 2024-09-06HUAWEI TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN201911025363.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-10-12
Filing Date
2019-10-25
Publication Date
2024-09-06
Estimated Expiration
2039-10-25

AI Technical Summary

Technical Problem

The centralized structure of traditional distributed machine learning systems leads to privacy security issues and intensive computing resources, and relies on network requests and responses, affecting efficiency.

Method used

Provides a decentralized model update method that directly transfers model parameters, gradients and impulses between working nodes within the same sub-network for model updates, avoiding reliance on central nodes and ensuring that user data is not uploaded to the cloud and uses local data. Personalized model updates.

Benefits of technology

It achieves flexible and efficient optimization of decentralized distributed AI systems, guarantees user privacy and security, reduces network communication overhead, and improves model update speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112651510B_ABST
    Figure CN112651510B_ABST
Patent Text Reader

Abstract

The present application relates to a model updating method in the field of artificial intelligence (AI), which can provide flexible and efficient optimization technology for decentralized distributed AI systems. The method can update the local model through the interaction of working nodes in the neighborhood. The present application can update the model by receiving one or more information of at least one parameter, gradient and impulse of the model transmitted by other working nodes in the neighborhood, combined with the local model and data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence (AI), and mainly to a model updating method, a working node and a model updating system. Background Art

[0002] Machine learning system is the most important branch of AI system. Distributed machine learning (DML) system is currently a commonly used system for processing large-scale artificial intelligence application tasks. Traditional distributed machine learning system is a centralized system that uses computing clusters to obtain prediction models by training massive user data. Specifically, the central node schedules each working node to calculate the gradient of the loss function with respect to the model; after the calculation is completed, all working nodes upload the gradient to the central node; the central node updates the model after receiving the uploaded gradient. During use, users need to request services from the system. The system makes decisions based on the model trained by the central node for the user's request, and then transmits the decision results to the user for execution. The whole process depends on the network, and there is network delay between requests and responses. Such centralized systems often require intensive computing resources, and massive user data is uploaded to the cloud for storage, which is very likely to cause privacy and security issues. Furthermore, federated learning technology has been proposed, using solutions such as homomorphic encryption and differential privacy to solve user privacy and security issues, so that users do not need to share original data, but only need to share models and model-related information to implicitly use group user information to update the model. However, existing federated learning technology still relies on central nodes. Summary of the invention

[0003] The embodiments of the present application provide a model updating method, a working node, and a model updating system, which can provide flexible and efficient optimization technology for decentralized distributed AI systems without relying on central nodes.

[0004] In a first aspect, an embodiment of the present application provides a model updating method, comprising: a first working node receives first information sent by at least one second working node; wherein the at least one second working node is a working node belonging to the same subnetwork as the first working node; the first working node updates the model according to the first information and the model and data stored by the first working node; wherein each of the first information includes at least one item of the following information of the second working node that sends the first information: at least one parameter of the model, the gradient and the impulse of the model; the model stored by the first working node has at least partially the same model structure as the model stored by the at least one second working node.

[0005] Possibly, the first working node or the second working node may be any intelligent terminal device, or may be a virtual node composed of several intelligent terminal devices.

[0006] In the embodiment of the present application, the model stored by the first working node and the model stored by the second working node have at least partially the same model structure. For the partially identical model structure, the first working node can update the model through the first information sent by the second working node belonging to the same neighborhood as the first working node and the data stored by the first working node. Among them, the first information may include at least one of the following information of the second working node that sends the first information: at least one parameter of the model, the gradient, and the impulse of the model. Compared with the prior art, the model updating method provided in the embodiment of the present application is a decentralized model updating method, that is, the method can be independent of the central node, and the first working node updates the model on the first working node by using the model-related information corresponding to the second working node transmitted by one or more second working nodes in the same sub-network to which it belongs. In addition, the method does not need to upload user data to the cloud, and only needs to update the model of the first working node through the parameters such as the model, gradient, and impulse of the model of the second working node, which can ensure the privacy security of the user. In addition, each working node can update the model of the first working node in combination with its stored user data and the first information, and the model update based on its stored user data can customize a personalized model for the working node, thereby providing users with more accurate services. In addition, in the present application, the first working node can directly use the data it saves to update the data without waiting for the calculation results of other working nodes, and the calculation speed is fast and the delay is small.

[0007] In a possible implementation, the model stored in the first working node and the model stored in the at least one second working node have the same model structure.

[0008] In a possible implementation, the number of the second working nodes is k; before the first working node receives the first information sent by at least one second working node, the method further includes: when the update condition is met, the first working node sends a first request to other working nodes belonging to the same subnet as the first working node; wherein the first request is used to request the other working nodes to participate in the model update of the first working node; the first working node receives a first response sent by the other working nodes; wherein the first response is used to characterize whether the other working nodes participate in the model update of the first working node, and the number of other working nodes participating in the model update of the first working node is m; the first working node selects k working nodes from the m other working nodes, and sends a request to the k working nodes to obtain the first information; wherein the k working nodes are the second working nodes.

[0009] Possibly, the update condition is that the first working node is currently in an idle state, that is, the first working node is not currently used by the user. This ensures that the first working node does not affect user use when the model is updated.

[0010] Possibly, the update condition is that the network environment currently located by the first working node is a non-mobile data network environment. This can ensure that the first working node saves user costs when performing model updates, and does not generate additional network fees.

[0011] Possibly, the update condition is that the first working node is currently in an idle state and the network environment currently located by the first working node is a non-mobile data network environment. This ensures that when the first working node updates the model, it neither affects user use nor generates additional network fees, thus saving user costs.

[0012] In a possible implementation, after the first working node updates the model according to the first information and the model and data stored by the first working node, the method further includes: the first working node sends the impulse for updating the model to the at least one second working node, so that the at least one second working node updates the model.

[0013] The embodiment of the present application can send the impulse of the model updated by the first working node to the second working node, so that the second working node also updates the model, thereby ensuring the accuracy of the model output of the second working node and providing users with more accurate services.

[0014] In a possible implementation, before the first working node receives the first information sent by at least one second working node, the method further includes: the first working node sends a request to the at least one second working node to obtain the first information of the at least one second working node.

[0015] In an embodiment of the present application, after determining the second working node participating in the update, the first working node can send a request to the second working node to obtain its first information, so as to update the model according to the first information of the second working node. During the entire model update process, calculations are only performed on the first working node, and there is no need to wait for the calculation process of other working nodes. The calculation speed is fast and the delay is small.

[0016] In another possible implementation, the first information includes at least one parameter and gradient of a model of the second working node that sends the first information.

[0017] The first working node updating the model according to the first information and the model and data stored by the first working node includes:

[0018] The first working node updates the model by performing one or more gradient descents using any parameter of the model of each second working node received, the mean of the parameter corresponding to the any parameter in the first working node, and the gradient of each second working node received; or,

[0019] The first working node performs one or more gradient descents to update the model using at least one parameter of the model of each second working node received and the mean of the gradients of each second working node received; or,

[0020] The first working node updates the model by performing one or more gradient descents using any parameter of the model of each second working node received, the mean of the parameter corresponding to the above-mentioned any parameter in the first working node, and the mean of the gradients of each second working node received.

[0021] In another possible implementation, the first information includes a gradient of a second working node that sends the first information.

[0022] The first working node updating the model according to the first information and the model and data stored by the first working node includes:

[0023] The first working node uses the received gradients of each second working node to perform one or more gradient descents to update the model.

[0024] The embodiments of the present application provide a variety of methods for updating the model based on the first information. The first working node can update the model of the first working node through the model and impulse of the second working node without obtaining user data. The model can be updated through implicit data such as the model and impulse, thereby ensuring the privacy and security of the user.

[0025] In another possible implementation, the first information is compressed or truncated information.

[0026] In the embodiment of the present application, the data transmitted between the first working node and the second working node is compressed or truncated, which can reduce network communication overhead.

[0027] In another possible implementation, the first information is information encrypted using homomorphic encryption or semi-homomorphic encryption, or the first information is information encrypted using a differential privacy method in a trusted computing environment.

[0028] In the embodiment of the present application, encrypting the data transmitted between the first working node and the second working node can further ensure data security, thereby ensuring the privacy security of the user.

[0029] In another possible implementation, the model stored in the first working node is a machine learning model.

[0030] In another possible implementation, the above-mentioned machine learning model is a machine learning model based on gradient update, and the above-mentioned machine learning model based on gradient update includes a deep neural network model or a support vector machine (SVM) model.

[0031] In a second aspect, an embodiment of the present application provides a working node, which includes a processor and a memory, the memory being used to store computer program instructions. When the device is running, the processor executes the computer program instructions in the memory so that the device executes the method provided by the first aspect of the embodiment of the present application or any one of the implementations of the first aspect.

[0032] In a possible implementation manner, the working node is an electronic device or a part of the electronic device.

[0033] In another possible implementation, the working node is a system on a chip (SoC).

[0034] In a third aspect, an embodiment of the present application provides a model updating system, the system comprising a first working node and at least one second working node. The first working node is a working node provided by the second aspect of the embodiment of the present application or any one of the implementations of the second aspect, and the second working node is a working node belonging to the same subnetwork as the first working node.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on an electronic device, the electronic device executes the method provided by the first aspect or any one of the implementations of the first aspect.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method provided by the first aspect or any one of the implementations of the first aspect.

[0037] In a sixth aspect, an embodiment of the present application provides a device, comprising a processing system, wherein the processing system is used to execute program instructions so that the device executes the method provided by the above-mentioned first aspect or any one of the implementations of the first aspect.

[0038] In a possible implementation manner, the processing system includes at least one processor.

[0039] In a possible implementation manner, the device further includes at least one memory, where the at least one memory is used to store the program instructions, and the at least one memory is coupled to the processing system.

[0040] In a possible implementation manner, the device is an electronic device or a part of the electronic device.

[0041] In a possible implementation manner, the device is a system on chip (SoC).

[0042] It can be understood that the working node provided in the second aspect, the model updating system provided in the third aspect, the computer storage medium provided in the fourth aspect, the computer program product provided in the fifth aspect, or the device provided in the sixth aspect can all be used to execute the model updating method provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0044] Figure 1A schematic diagram of the structure of a model updating system provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of the structure of an electronic device involved in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a process for selecting a second working node provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of a process in which a first working node and a second working node respectively update a stored model provided in an embodiment of the present application;

[0048] Figure 5 A flowchart of a model updating method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described clearly and in detail below with reference to the accompanying drawings.

[0050] The embodiment of the present application provides a method for model updating, a working node and a model updating system. The method can be independent of the central node. After being executed on a working node, the machine learning model on the working node (for example, a machine learning model based on gradient update such as a deep neural network model, a support vector machine (SVM) model, etc.) can be updated in combination with the data (local data) stored by the working node and the information requested from other working nodes in the neighborhood (other working nodes belonging to the same subnetwork as the working node). In this way, there is no need to upload massive user data to the cloud, and the privacy and security of the user can be guaranteed. In addition, the working node in the method is updated in combination with its local data, so that the model of each working node can be a personalized model, which conforms to the usage habits of the user using the working node, and provides accurate services for the user. In addition, using local data for updating can be done without waiting for the calculation results of other working nodes, so that the model of the working node is updated quickly and with low latency.

[0051] In an embodiment of the present application, the updated model of the first working node can be used for prediction or reasoning. For example, the updated model can be applied to reasoning in scenarios such as image recognition and speech recognition to improve the accuracy of image recognition or speech recognition. For another example, the updated model can be used to predict the application (application, APP) that the user is going to use, and load the predicted APP into the memory in advance to improve the response speed of the device. Not limited to the usage scenarios listed above, in an embodiment of the present application, the updated model of the first working node can also be applied to other usage scenarios, which are not limited by the comparison of the embodiment of the present application.

[0052] Next, combine Figure 1 The model updating system provided in the embodiment of the present application is introduced. Figure 1 The structural diagram of the model updating system provided in the embodiment of the present application is exemplified.

[0053] like Figure 1 As shown, the model updating system 10 may include a first working node 11 and at least one second working node ( Figure 1 , the second working nodes 12a, 12b, 12c, 12d, and 12e are exemplarily shown in FIG. Each second working node can transmit data with the first working node. The data transmission method can be wired transmission or wireless transmission. The wired transmission can be transmitted through a data line, and the wireless transmission can be transmitted through a mobile data network or through short-range wireless transmission (for example, but not limited to Bluetooth, wireless high fidelity (wireless fidelity, Wi-Fi), etc.).

[0054] Specifically, each first working node or second working node can become a virtual node, and the virtual node can be composed of one or more electronic devices ( Figure 1 In the example, the first virtual node includes an electronic device. If the virtual node is composed of multiple electronic devices, one of the electronic devices can be used as a gateway to complete the data interaction between the virtual node and other virtual nodes.

[0055] Specifically, the first working node and the second working node belong to the same subnet. The scope of the subnet can be the connection scope of the same router, or the connection scope of the same base station. The higher the convergence speed requirement of the model update system for calculation, that is, the faster the convergence, the larger the scope of the subnet. The second working node is directly connected to the first working node in the same subnet, and these directly connected working nodes constitute a neighborhood N. Other working nodes belonging to the same subnet as the first working node can be called neighborhood nodes.

[0056] The first working node may store a model (which may be referred to as a local model of the first working node), and the second working node may also store a model (which may be referred to as a local model of the second working node). The local model of the first working node and the local model of the second working node have the same model type, and the local model of the first working node and the local model of the second working node have at least partially the same model structure.

[0057] The local model of the first working node may be a machine model, specifically a machine learning model based on gradient updating, such as but not limited to a deep neural network model or a SVM model.

[0058] Next, the model structure is explained by taking the deep neural network as a convolutional neural network as an example. The convolutional neural network may include an input layer, a convolutional layer, an activation function, a pooling layer, and a fully connected layer. Among them, the input layer can be used to input user data; the convolutional layer can be used to extract local features; the activation function can be used to add nonlinear factors; the pooling layer is used to downsample the features, extract the main features, simplify the complexity of network calculations, and increase robustness; the fully connected layer is used to connect all features and send the output value to the classifier. In the present application, the local model of the first working node and the local model of the second working node have the same model structure in part, which can at least be a layer containing updateable weight parameters, such as a convolutional layer and a fully connected layer.

[0059] The first working node or the second working node involved in the present application may be an electronic device, or the working node may be a part of the electronic device (such as a processor). The first working node or the second working node involved in the present application may also be a SoC.

[0060] In the embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, or a virtual reality device, etc.

[0061] In the following embodiments of the present application, the working node is an electronic device as an example for explanation. Figure 2 The structure of a working node (electronic device) provided in an embodiment of the present application is introduced.

[0062] Figure 2 A schematic structural diagram of an electronic device 100 is shown.

[0063] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0064] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0065] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0066] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0067] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0068] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0069] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0070] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0071] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0072] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0073] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0074] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0075] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0076] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0077] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0078] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0079] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0080] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0081] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110. In the embodiment of the present application, the mobile communication module 150 can be used to transmit data with other working nodes, such as receiving requests sent by other working nodes, or sending first information to other working nodes.

[0082] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0083] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In the embodiment of the present application, the wireless communication module 160 can be used to transmit data with other working nodes, such as receiving requests sent by other working nodes, or sending first information to other working nodes.

[0084] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0085] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0086] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0087] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0088] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193. In the embodiment of the present application, ISP can process the image containing user gestures collected by camera 193.

[0089] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. In an embodiment of the present application, the camera 193 can be used to capture an image stream at a first frequency, and when the NPU recognizes that the image stream contains the starting part of a gesture supported by the electronic device, the image stream is captured at a second frequency. Among them, the first frequency is lower than the second frequency. The camera 193 involved in the embodiment of the present application may be a front camera.

[0090] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0091] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0092] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. NPU can be used to realize applications such as intelligent cognition of electronic device 100, such as image recognition, face recognition, speech recognition, text understanding, etc. In an embodiment of the present application, NPU can be used to process images captured by camera 193, analyze whether the gesture contained in the image is the starting part of a gesture supported by electronic device 100, or analyze whether the gesture contained in the image is a gesture supported by electronic device 100. In an embodiment of the present application, NPU can be used to store the model of the working node, that is, the local model of the working node, and update the model.

[0093] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0094] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor. In an embodiment of the present application, the internal memory 121 may be used to store models of gestures supported by the electronic device 100, and functions corresponding to each supported gesture. Possibly, the supported gestures may be different in the application interface of different applications, and the functions implemented by the same gesture may also be different.

[0095] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0096] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0097] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0098] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0099] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0100] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0101] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0102] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0103] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0104] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0105] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0106] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0107] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0108] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0109] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0110] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0111] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0112] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0113] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0114] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0115] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0116] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0117] The model updating method provided in the embodiment of the present application can be roughly divided into two parts: 1. The first working node selects the second working node to participate in the update; 2. The first working node and the second working node respectively update their own stored models.

[0118] Figure 3 The process of the first working node selecting the second working node to participate in the update is exemplified. Figure 3 As shown, the process may include the following steps:

[0119] S301: When an update condition is met, the first working node sends a first request to other working nodes belonging to the same subnet as the first working node.

[0120] The first request is used to request the other working nodes to participate in the model update of the first working node. The number of other working nodes can be one or more.

[0121] Possibly, the above-mentioned update condition may be that the first working node is currently in an idle state, that is, the first working node is currently not used by the user. In this way, it can be ensured that the first working node does not affect the use of the user when the model is updated.

[0122] Possibly, the above-mentioned update condition may be that the network environment currently located by the first working node is a non-mobile data network environment. In this way, it can be ensured that the first working node saves user costs when updating the model, and does not generate additional network fees.

[0123] Possibly, the above update condition may be that the first working node is currently in an idle state and the network environment in which the first working node is currently located is a non-mobile data network environment. This ensures that when the first working node updates the model, it neither affects user use nor generates additional network fees, thus saving user costs.

[0124] Specifically, the scope of the subnet can refer to the aforementioned Figure 1 The relevant description in is not repeated here.

[0125] S302: Other working nodes determine that they are in an updateable state.

[0126] Specifically, the updateable state may be that the working node is not currently participating in the model update of other working nodes, and the working node meets the update condition. The description of the update condition can refer to the description of the update condition of the first working node in S301, which is not repeated here.

[0127] S303: Other working nodes randomly choose whether to participate in the model update of the first working node.

[0128] Specifically, for a certain other working node, it may receive model update requests initiated by multiple first working nodes at the same time. At this time, the first working node can randomly select a working node from the multiple first working nodes to participate in its model update.

[0129] S304: If you choose to participate in the model update of the first working node, send a first response to the first working node.

[0130] Specifically, after determining to participate in the model update of the first working node, a first response is sent to the first working node. The first response is used to indicate that the other working nodes can participate in the model update of the first working node.

[0131] Possibly, if the other working node is in a non-updatable state, or the other working node is in an updatable state but does not choose to participate in the model update of the first working node, the other working node may also send a first response to the first working node, indicating that the other working node does not participate in the model update of the first working node.

[0132] S305: The first working node selects k other working nodes from the m first responses as second working nodes.

[0133] Possibly, the first working node may receive m first responses, indicating that there are m other working nodes that can participate in the model update of the first working node, and the first working node may mark the m other working nodes as nodes participating in the update. Specifically, the first response may carry the identification information of the other working nodes. The first working node may mark the working node as a node participating in the update through the identification information carried in the first response.

[0134] Specifically, after sending the first request, the first working node may wait for t time. That is, the working node that returns the first response within t time is the node participating in the update. The value of t may be, for example but not limited to, 5 milliseconds (ms), 10ms, 100ms, etc.

[0135] The first working node may randomly select k nodes from the m nodes participating in the update as the second working nodes, wherein m and k are both positive integers, and m is greater than or equal to k.

[0136] Specifically, the first working node may randomly sample k responses from the m first responses and respond again S(·). For details on how to respond again, see S306.

[0137] In this application, the first working node can be denoted as n i , the first working node n i The neighboring nodes (including the selected second working node) are recorded as n j , where n j ∈N(n i ).

[0138] Figure 4 The example shows the process in which the first working node and the second working node update their own stored models respectively. Figure 4 As shown, the process may include the following steps:

[0139] S306: The first working node sends a second request to the second working node.

[0140] Specifically, the first working node randomly samples k responses from the m first responses and responds again S(·). Specifically, the first working node sends a second request to the second working node. The second request may be a request to obtain the parameters of at least one model of the second working node and the gradient of the model. The parameters of at least one model may be the parameters of the model of the part with the same structure in the models stored by the first working node and the second working node.

[0141] S307: The second working node calculates at least one parameter of its model and a gradient of the model.

[0142] Specifically, after receiving the second request, the second working node calculates at least one parameter of its local model (ie, the model stored in the second working node) and the gradient of the model.

[0143] At least one parameter of the model of the second working node is denoted as {w j |n j ∈S(N(n i ))}. Among them, w j At least one parameter of the model representing the second working node.

[0144] Specifically, the model gradient calculated by the second working node can be based on the gradient on the mini-batch data, and the gradient is recorded as {g j |n j ∈S(N(n i ))}.

[0145] Specifically, since the amount of user data (or sample data) of each working node is large, the subset of the entire user data (or sample data) can be divided into multiple small batches of data. At this time, the gradient of the second working node model can be calculated based on one of the small batches of data, which can reduce the calculation time, improve the speed of model training, and ensure the accuracy of the calculation results.

[0146] S308: The second working node sends at least one parameter and gradient of its model to the first working node.

[0147] S309: The first working node updates the model for the first time and calculates the first impulse.

[0148] Specifically, after the first model update, the parameter expression of the model of the first working node is as follows:

[0149]

[0150] Among them, η is a constant, representing the learning rate of the model. The larger the value of η, the greater the degree of model update. k is the number of second working nodes. It can be seen that the number of model parameters can be multiple, and different parameters have their own corresponding gradients. The above expression can be applied to each model parameter.

[0151] Exemplarily, the parameters of the model may include parameter 1, parameter 2, and parameter 3. The model of the first working node and the model of the second working node both include parameter 1, parameter 2, and parameter 3. The updated parameter 1 of the first working node is recorded as The original parameter 1 of the first working node is recorded as w i,1 , the parameter 1 of the second working node is recorded as w j,1 . Regarding the parameter 1w in the first working node i,1 The gradient is g i,1 Regarding parameter 1w in the second working node j,1 The gradient is g j,1 Then the first working node According to w i,1 、w j,1 , g i,1 and j,1 Calculated.

[0152] Specifically, the impulse is the difference between the model after the update and before the update.

[0153] Possibly, in the actual process of updating the model, the first working node may not perform the first model update, but only calculate the value of the first impulse.

[0154] S310: The first working node sends a first impulse to the second working node.

[0155] S311: The second working node updates the model for the first time according to the first impulse.

[0156] Specifically, after receiving the first impulse, the second working node changes at least one parameter w of the model of the second working node to j Updated to

[0157] S312: The first working node sends a third request to the second working node.

[0158] Specifically, the first working node may send a third request to all neighboring nodes participating in the update (including the k second working nodes mentioned above). The third request may be used to request the acquisition of a new gradient of the model of the second working node

[0159] S313: The second working node calculates the gradient on the entire data subset.

[0160] Specifically, the neighboring nodes (including the k second working nodes) that receive the third request calculate the new gradient on their entire data subset

[0161] 314: The second working node sends the gradient on the entire data subset to the first working node.

[0162] Specifically, all the neighboring nodes participating in the update (including the k second working nodes) can return their new gradients to the first working node.

[0163] S315: The first working node updates the model for the second time and calculates the second impulse.

[0164] Specifically, after collecting new gradients returned by ρ% (for example, but not limited to 50%, 80%, etc.) of neighboring nodes (denoted as P), the first working node can perform a second update on the local model of the first working node:

[0165] The impulse after the first working node updates the model for the second time That is, the first working node can use the mean of the gradients received from each second working node to perform gradient descent to obtain the impulse for model update of the first working node. And the model of the first working node is updated according to the impulse.

[0166] The model parameters after the first working node updates the model for the second time can be expressed as Specifically, the model parameters w before updating can be i Replace with Recorded as

[0167] S316: The first working node sends a second impulse to the second working node.

[0168] Specifically, the impulse after the first working node updates the model for the second time is This is the second impulse.

[0169] S317: The second working node updates the model for the second time according to the second impulse.

[0170] Specifically, the second working section updates the parameters of its model according to the second impulse, and the updated model parameters can be expressed as Specifically, the model parameters w before updating can be j Replace with Recorded as

[0171] It can be seen from S309 to S315 that the first working node can update the model by using at least one parameter of the model received from each second working node and the mean of the gradients received from each second working node.

[0172] S309-S315 above lists the process of updating the model by performing one gradient descent. In the actual updating process, multiple gradient descents may be performed to update the model.

[0173] Possibly, the above-mentioned multiple gradient descents to perform model updating may be that in S307, the second working node calculates the gradient g on its small batch data multiple times j The first working node is made to execute S309 multiple times to implement multiple gradient updates.

[0174] Possibly, the above-mentioned multiple gradient descents to perform model updating can also be performed by the second working node calculating its new gradient on the entire data subset multiple times in S313 The first working node is made to execute S315 multiple times to implement multiple gradient updates.

[0175] Possibly, the above-mentioned multiple gradient descents to perform model updating can be a combination of the above two situations (i.e., multiple calculations of the gradient g in S307 j And the new gradient is calculated multiple times in S313 ). The number of gradient descents in the two cases may be the same or different. The embodiment of the present application does not limit the number of gradient descents.

[0176] The updating methods listed in S309-S315 above are not limited thereto. In a specific implementation, there may be the following methods for updating the model:

[0177] Method 1: The first working node can use the gradients received from each second working node to perform one or more gradient descents to update the model.

[0178] Specifically, when performing multiple gradient descents, when the sub-gradient descent is the last gradient descent It can be recorded as

[0179] Method 2: The first working node uses any parameter of the model of each second working node received and the mean of the parameter corresponding to the any parameter in the first working node and the gradient of each second working node received to perform one or more gradient descents to update the model.

[0180] make Represents the average of a parameter of the model of each second working node and the corresponding parameter of the model of the first node. For example, if the first working node receives the parameters of the models of three second working nodes. The model of the first working node includes parameter 1, parameter 2, and parameter 3, and the parameters of the model sent by each second working node also include parameter 1, parameter 2, and parameter 3. Then is the average of the parameter 1 of the three second working nodes and the parameter 1 of the first working node, or is the average of the parameter 2 of the three second working nodes and the parameter 2 of the first working node, or is the average of the parameter 3 of the three second working nodes and the parameter 3 of the first working node. That is:

[0181]

[0182] Specifically, after the first model update, the parameters of the model of the first working node are

[0183] Specifically, when performing multiple gradient descents, when the sub-gradient descent is the last gradient descent It can be recorded as in,

[0184] Method three: The first working node uses any parameter of the model of each second working node received, the mean of the parameter corresponding to the any parameter in the first working node, and the mean of the gradients of each second working node received to perform one or more gradient descents to update the model.

[0185] make Represents the mean of a parameter of the model of each second working node and the corresponding parameter of the model of the first node. For examples, please refer to the example in method 2, which will not be repeated here.

[0186] Specifically, after the first model update, the parameters of the model of the first working node are

[0187] Specifically, when performing multiple gradient descents, when the sub-gradient descent is the last gradient descent It can be recorded as in,

[0188] In addition, when the second working node transmits the first information to the first working node (such as S308 or S314), it may occupy a relatively large bandwidth. At this time, the first information can be compressed or truncated. Specifically, the second working node can arrange the absolute values ​​of the gradients of various parameters in descending order, select some parameters with the highest absolute values ​​of the gradients according to the network communication overhead budget for transmission, and then update these parameters. In this way, the data of the most important or most active parts of the model can be selected for transmission, thereby reducing network communication overhead.

[0189] Possibly, the data transmission between the first working node and the second working node (such as steps S308, S310, S314, S316, etc.) can use an encryption algorithm to process the transmitted data to ensure data security, further increase system security, form a decentralized horizontal federated learning method, and ensure user privacy.

[0190] Specifically, the above encryption algorithm can be homomorphic encryption, semi-homomorphic encryption, or a differential privacy method in a trusted computer environment.

[0191] In the embodiment of the present application, the model stored by the first working node and the model stored by the second working node have at least partially the same model structure. For the partially identical model structure, the first working node can update the model through the first information sent by the second working node belonging to the same neighborhood as the first working node and the data stored by the first working node. Among them, the first information may include at least one of the following information of the second working node that sends the first information: at least one parameter of the model, the gradient, and the impulse of the model. Compared with the prior art, the model updating method provided in the embodiment of the present application is a decentralized model updating method, that is, the method can be independent of the central node, and the first working node updates the model on the first working node by using the model-related information corresponding to the second working node transmitted by one or more second working nodes in the same sub-network to which it belongs. In addition, the method does not need to upload user data to the cloud, and only needs to update the model of the first working node through the parameters such as the model, gradient, and impulse of the model of the second working node, which can ensure the privacy security of the user. In addition, each working node can update the model of the first working node in combination with its stored user data and the first information, and the model update based on its stored user data can customize a personalized model for the working node, thereby providing users with more accurate services. In addition, in the present application, the first working node can directly use the data it saves to update the data without waiting for the calculation results of other working nodes, and the calculation speed is fast and the delay is small.

[0192] Next, combine Figure 3-Figure 4, introduces a model updating method provided in an embodiment of the present application.

[0193] like Figure 5 As shown, the model updating method may include the following steps:

[0194] S501: A first working node receives first information sent by at least one second working node.

[0195] S502: The first working node updates the model according to the first information and the model and data stored in the first working node.

[0196] Specifically, the at least one second working node is a working node belonging to the same sub-network as the first working node. The first information may include at least one of the following information of the second working node sending the first information: at least one parameter of the model, a gradient, and an impulse of the model.

[0197] Specifically, the model stored in the first working node and the model stored in the second working node have at least partially the same model structure.

[0198] Possibly, the model stored in the first working node and the model stored in the second working node have the same model structure.

[0199] In a possible embodiment, the number of the second working nodes is k. Before the above S501, the method may also include a process of selecting the second working node, which process may refer to the above Figure 3 The relevant description will not be repeated here.

[0200] In a possible embodiment, after S502, the method may further include: the first working node sends the impulse of the updated model to the at least one second working node, so that the second working node updates the model.

[0201] Specifically, the impulse of the model updated by the first working node is the first impulse mentioned in S309 For the specific calculation process, please refer to the relevant description in S309, which will not be repeated here.

[0202] The process of the second working node performing model updating can refer to the relevant description of S310-S311, which will not be repeated here.

[0203] In a possible embodiment, after the first working node selects k second working nodes, before the above S501, the method may further include: the first working node sends a request to the second working node to obtain its first information.

[0204] In a possible embodiment, the first information includes at least one parameter and a gradient of a model of the second working node that sends the first information.

[0205] The first working node may update the model according to the first information and the model and data stored in the first working node in the following ways:

[0206] Method 1: The first working node uses the gradients received from each second working node to perform one or more gradient descents to update the model.

[0207] The specific process of this method can be found in Figure 4 The calculation process of method 1 listed in the embodiment will not be repeated here.

[0208] Method 2: The first working node uses any parameter of the model of each second working node received and the mean of the parameter corresponding to the any parameter in the first working node and the gradient of each second working node received to perform one or more gradient descents to obtain the impulse for updating the model of the first working node, and updates the model of the first working node according to the impulse.

[0209] The specific process of method 2 can be found in Figure 4 The calculation process of the second method listed in the embodiment will not be repeated here.

[0210] Method three: The first working node uses any parameter of the model of each second working node received, the mean of the parameter corresponding to the any parameter in the first working node, and the mean of the gradients of each second working node received to perform one or more gradient descents to update the model.

[0211] The specific process of method 3 can be found in Figure 4 The calculation process of method 3 listed in the embodiment will not be repeated here.

[0212] Method 4: The first working node uses at least one parameter of the model of each second working node received and the mean of the gradients of each second working node received to perform one or more gradient descents to obtain the impulse for updating the model of the first working node, and updates the model of the first working node according to the impulse.

[0213] The specific process of method 4 can be found in Figure 4 The calculation process listed in S309-S315 in the embodiment will not be repeated here.

[0214] In a possible embodiment, the first information is compressed or truncated information.

[0215] In a possible embodiment, the first information is information encrypted using homomorphic encryption or semi-homomorphic encryption, or the first information is information encrypted using a differential privacy method in a trusted computing environment.

[0216] In the embodiment of the present application, the model stored by the first working node and the model stored by the second working node have at least partially the same model structure. For the partially identical model structure, the first working node can update the model through the first information sent by the second working node belonging to the same neighborhood as the first working node and the data stored by the first working node. Among them, the first information may include at least one of the following information of the second working node that sends the first information: at least one parameter of the model, the gradient, and the impulse of the model. Compared with the prior art, the model updating method provided in the embodiment of the present application is a decentralized model updating method, that is, the method can be independent of the central node, and the first working node updates the model on the first working node by using the model-related information corresponding to the second working node transmitted by one or more second working nodes in the same sub-network to which it belongs. In addition, the method does not need to upload user data to the cloud, and only needs to update the model of the first working node through the parameters such as the model, gradient, and impulse of the model of the second working node, which can ensure the privacy security of the user. In addition, each working node can update the model of the first working node in combination with its stored user data and the first information, and the model update based on its stored user data can customize a personalized model for the working node, thereby providing users with more accurate services. In addition, in the present application, the first working node can directly use the data it saves to update the data without waiting for the calculation results of other working nodes, and the calculation speed is fast and the delay is small.

[0217] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0218] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0219] The method provided in the embodiment of the present application can perform each step through corresponding units or modules. The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0220] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A model updating method, characterized in that: The method comprises: The first working node receives first information sent by at least one second working node; wherein the at least one second working node is a working node belonging to the same sub-network as the first working node; The first working node updates the model according to the first information and the model and data stored by the first working node; Each of the first information includes at least one of the following information of the second working node that sends the first information: at least one parameter of the model, a gradient, and an impulse of the model; wherein the gradient refers to the gradient of the at least one parameter, the impulse of the model is the difference between the parameter after the model is updated and the parameter before the update, and the model stored in the first working node and the model stored in the at least one second working node have at least partially the same model structure; the impulse of the updated model is determined according to the difference between the parameter after the model is updated and the parameter before the model is updated stored in the first working node; The first working node sends the impulse for updating the model to the at least one second working node, so that the at least one second working node updates the model.

2. The method according to claim 1, characterized in that The model stored in the first working node and the model stored in the at least one second working node have the same model structure.

3. The method according to claim 1 or 2, characterized in that The number of the second working nodes is k; Before the first working node receives the first information sent by at least one second working node, the method further includes: When the update condition is met, the first working node sends a first request to other working nodes belonging to the same subnet as the first working node; wherein the first request is used to request the other working nodes to participate in the model update of the first working node; The first working node receives a first response sent by the other working nodes; wherein the first response is used to indicate whether the other working nodes participate in the model update of the first working node, and the number of other working nodes participating in the model update of the first working node is m; The first working node selects k working nodes from the m other working nodes, and sends a request for obtaining the first information to the k working nodes; wherein the k working nodes are the second working nodes.

4. The method according to claim 1 or 2, characterized in that: Before the first working node receives the first information sent by at least one second working node, the method further includes: the first working node sends a request to the at least one second working node to obtain the first information of the at least one second working node.

5. The method according to claim 1 or 2, characterized in that: The first information includes at least one parameter and a gradient of a model of a second working node that sends the first information; The first working node updating the model according to the first information and the model and data stored by the first working node includes: The first working node updates the model by performing one or more gradient descents using any parameter of the model of each second working node received, the mean of the parameter corresponding to the any parameter in the first working node, and the gradient of each second working node received; or, The first working node performs one or more gradient descents to update the model using at least one parameter of the model of each second working node received and the mean of the gradients of each second working node received; or, The first working node updates the model by performing one or more gradient descents using any parameter of the model of each second working node received, the mean of the parameter corresponding to the any parameter in the first working node, and the mean of the gradients of each second working node received.

6. The method according to claim 1 or 2, characterized in that: The first information includes a gradient of a model of a second working node that sends the first information; The first working node updates the model according to the first information and the model and data stored by the first working node, including: the first working node uses the gradients received from each second working node to perform one or more gradient descents to update the model.

7. The method according to claim 1 or 2, characterized in that: The first information is information that has been compressed or truncated.

8. The method according to claim 1 or 2, characterized in that: The first information is information encrypted using homomorphic encryption or semi-homomorphic encryption, or the first information is information encrypted using a differential privacy method in a trusted computing environment.

9. The method according to claim 1 or 2, characterized in that: The model stored in the first working node is a machine learning model.

10. The method according to claim 9, characterized in that The machine learning model is a machine learning model based on gradient updating, and the machine learning model based on gradient updating includes a deep neural network model or a support vector machine (SVM) model.

11. A device, characterized in that: The device comprises a processor and a memory, wherein the memory is used to store computer program instructions. When the device is running, the processor executes the computer program instructions in the memory, so that the device performs the method according to any one of claims 1 to 10.

12. The device according to claim 11, characterized in that The device is an electronic device or a part of the electronic device.

13. The device according to claim 11, characterized in that The device is a system on chip (SoC).

14. A model updating system, characterized in that: It includes a first working node and at least one second working node, the first working node is the device described in any one of claims 11-13, and the second working node is a working node belonging to the same subnetwork as the first working node.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer or a processor, enable the computer or the processor to execute the method according to any one of claims 1 to 10.

16. A computer program product comprising instructions, which, when executed on a computer or a processor, causes the computer or the processor to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Plug-in type distributed machine learning computing frame and data processing method thereof

    CN108280522A

  • Sampling based treatment system and method of learning slow nodes for distributed machines

    CN108446770A

  • Model parameter training method and device, server and storage medium

    CN108491928A

  • AI model updating method and related product

    CN108924910A

  • Distributed depth learning system based on momentum and pruning

    CN109299781A