CN112651510A - Model updating method, working node and model updating system - Google Patents

Model updating method, working node and model updating system Download PDF

Info

Publication number
CN112651510A
CN112651510A CN201911025363.XA CN201911025363A CN112651510A CN 112651510 A CN112651510 A CN 112651510A CN 201911025363 A CN201911025363 A CN 201911025363A CN 112651510 A CN112651510 A CN 112651510A
Authority
CN
China
Prior art keywords
working node
model
working
information
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911025363.XA
Other languages
Chinese (zh)
Inventor
朱越
张宝峰
王成录
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2020/120135 priority Critical patent/WO2021068926A1/en
Publication of CN112651510A publication Critical patent/CN112651510A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The application relates to a model updating method in the field of Artificial Intelligence (AI), and can provide a flexible and efficient optimization technology for a decentralized distributed AI system. The method can update the local model through the interaction of the working nodes in the neighborhood. The method and the device can be used for updating the model by receiving one or more information of at least one parameter, gradient and impulse of the model transmitted by other working nodes of the neighborhood and combining the local model and data.

Description

Model updating method, working node and model updating system
Technical Field
The application relates to the field of Artificial Intelligence (AI), and mainly relates to a model updating method, a working node and a model updating system.
Background
The machine learning system is the most important branch of the AI system. A Distributed Machine Learning (DML) system is a commonly used system for processing large-scale artificial intelligence application tasks. The traditional distributed machine learning system is a centralized system, and a prediction model is obtained by training massive user data by using a computing cluster. Specifically, the central node schedules each working node to calculate the gradient of the loss function relative to the model; after the calculation is finished, all the working nodes upload the gradients to the central node; and the central node updates the model after receiving the uploaded gradient. In the using process, a user needs to request service for the system, the system makes a decision according to the request of the user by the trained model of the central node, and then the decision result is transmitted to the user for execution. The whole process depends on the network, and network delay exists in the request and the response. Such centralized systems often require intensive computing resources, and mass user data are uploaded to the cloud side for storage, which is very likely to cause privacy security problems. Further, a federated learning technology is proposed, and the user privacy safety problem is solved by adopting schemes such as homomorphic encryption, differential privacy and the like, so that users can implicitly utilize information update models of group users by sharing the models and model related information without sharing original data. Existing federal learning techniques still rely on a central node.
Disclosure of Invention
The embodiment of the application provides a model updating method, a working node and a model updating system, which can provide a flexible and efficient optimization technology for a decentralized distributed AI system without depending on a central node.
In a first aspect, an embodiment of the present application provides a model updating method, including: 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 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 in the first working node; wherein each of the first messages includes at least one of the following messages of a second working node that transmits the first message: at least one parameter of the model, the gradient, and the impulse of the model; the model stored in the first working node has at least partially the same model structure as the model stored in the at least one second working node.
Possibly, the first working node or the second working node may be any intelligent terminal device, or may be a virtual node formed by a plurality of intelligent terminal devices.
In this embodiment of the application, 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, and for the partially same model structure, the first working node may update the model through the first information sent by the second working node that belongs to the same neighborhood as the first working node and the data stored in the first working node. Wherein the first information may include at least one of the following information of the second working node that transmits 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 by the embodiment of the application is a decentralized model updating method, namely the method does not depend on a 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 of the same sub-network to which the first working node 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 parameters such as the model and gradient of the second working node and impulse of the model, so that the privacy safety of the user can be ensured. In addition, each working node can update the model of the first working node by combining the user data and the first information stored in the working node, and the personalized model can be customized for the working node by updating the model according to the user data stored in the working node, so that more accurate service is provided for the user. In addition, the first working node can directly use the stored data to update the data without waiting for the calculation results of other working nodes, and the calculation speed is high and the time delay is small.
In a possible implementation manner, 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.
In a possible implementation manner, 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: under the condition that an updating condition is met, the first working node sends a first request to other working nodes which belong to the same subnet as the first working node; wherein the first request is used for requesting the other working nodes to participate in model updating 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 the other working nodes participating in the model update of the first working node is m; the first working node selects k working nodes from m other working nodes, and sends a request for acquiring the first information to the k working nodes; wherein the k working nodes are the second working nodes.
Possibly, the update condition is that the first working node is currently in an idle state, i.e. the first working node is not currently used by the user. Therefore, the first working node can be ensured not to influence the use of a user when the model is updated.
Possibly, the updating condition is that the network environment where the first working node is currently located is a non-mobile data network environment. Therefore, the cost of the user can be saved when the first working node carries out model updating, and extra network cost is not generated.
Possibly, the updating condition is that the first working node is currently in an idle state and the network environment where the first working node is currently located is a non-mobile data network environment. Therefore, the first working node can be ensured not to influence the use of a user when the model is updated, and no extra network cost is generated, so that the cost of the user is saved.
In a possible implementation manner, after the first working node updates the model according to the first information and the model and data stored in the first working node, the method further includes: and the first working node sends the impulse of the updated model to the at least one second working node so as to update the model of the at least one second working node.
According to the embodiment of the application, the impulse of the updated model of the first working node can be sent to the second working node, so that the second working node also updates the model, the accuracy of the output of the model of the second working node is ensured, and more accurate service is provided for users.
In a possible implementation manner, before the first working node receives the first information sent by the at least one second working node, the method further includes: and the first working node sends a request for acquiring the first information of the at least one second working node to the at least one second working node.
In the embodiment of the application, after the second working node participating in the updating is determined, the first working node may send a request for obtaining the first information of the second working node to the second working node, so as to perform model updating according to the first information of the second working node, and only the first working node performs calculation in the whole model updating process, without waiting for the calculation process of other working nodes, so that the calculation speed is high, and the time delay is small.
In another possible implementation manner, the first information includes at least one parameter and a gradient of a model of a second working node that transmits the first information.
The first working node updating the model according to the first information and the model and data stored in the first working node includes:
the first working node performs one or more gradient descending to update the model by using the mean value of any parameter of the received model of each second working node and the parameter corresponding to the parameter in the first working node and the gradient of each received second working node; or the like, or, alternatively,
the first working node performs one or more gradient reductions to update the model by using at least one parameter of the received model of each second working node and the mean value of the received gradient of each second working node; or the like, or, alternatively,
and the first working node performs one or more gradient reductions to update the model by using any received parameter of the model of each second working node, the mean value of the parameter corresponding to the parameter in the first working node and the mean value of the gradient of each received second working node.
In another possible implementation manner, the first information includes a gradient of a second working node that transmits the first information.
The first working node updating the model according to the first information and the model and data stored in the first working node includes:
and the first working node performs one or more gradient descent operations by using the received gradient of each second working node to update the model.
The embodiment of the application provides various modes for updating the model according to 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 acquiring user data, the model can be updated through implicit data such as the model and the impulse, and privacy safety of a user can be guaranteed.
In another possible implementation manner, the first information is information after being compressed or truncated.
In the embodiment of the application, the data transmitted between the first working node and the second working node is compressed or cut off, so that the network communication overhead can be reduced.
In another possible implementation manner, the first information is information encrypted by using a homomorphic encryption method, or information encrypted by using a semi-homomorphic encryption method, or the first information is information encrypted by using a differential privacy method in the trusted computing environment.
According to the embodiment of the application, the data transmitted between the first working node and the second working node are encrypted, so that the data security can be further ensured, and the privacy security of a user is ensured.
In another possible implementation manner, the model stored in the first working node is a machine learning model.
In another possible implementation manner, the machine learning model is a gradient update-based machine learning model, and the gradient update-based machine learning model includes a deep neural network model or a Support Vector Machine (SVM) model.
In a second aspect, an embodiment of the present application provides a working node, where the working node includes a processor and a memory, where the memory is used to store computer program instructions, and when the apparatus runs, the processor executes the computer program instructions in the memory, so as to cause the apparatus to perform the method provided in the first aspect of the embodiment or any implementation manner of the first aspect of the present application.
In one possible implementation, the working node is an electronic device or a part of the electronic device.
In another possible implementation, the working node is a system on a chip (SoC).
In a third aspect, an embodiment of the present application provides a model updating system, which includes a first working node and at least one second working node. The first working node is a working node provided in the second aspect of the embodiments of the present application or any implementation manner of the second aspect, and the second working node is a working node belonging to the same sub-network as the first working node.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on an electronic device, the electronic device is caused to perform the method provided by the first aspect or any one of the implementation manners of the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on an electronic device, causes the electronic device to perform the method provided in the first aspect or any one of the implementation manners of the first aspect.
In a sixth aspect, an embodiment of the present application provides an apparatus, where the apparatus includes a processing system, and the processing system is configured to execute program instructions to cause the apparatus to perform the method provided in the first aspect or any implementation manner of the first aspect.
In one possible implementation, the processing system includes at least one processor.
In one possible implementation, the apparatus further includes at least one memory for storing the program instructions, the at least one memory coupled with the processing system.
In one possible implementation, the apparatus is an electronic device or a part of the electronic device.
In one possible implementation, the apparatus is a system on chip SoC.
It is to be understood that the working node provided by the second aspect above, the model updating system provided by the third aspect above, the computer storage medium provided by the fourth aspect above, or the computer program product provided by the fifth aspect above, or the apparatus provided by the sixth aspect above can be used to execute the model updating method provided by the first aspect. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments will be briefly described below.
Fig. 1 is a schematic structural diagram of a model update system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a process of selecting a second working node according to an embodiment of the present application;
fig. 4 is a schematic diagram of a process of updating and storing a model by a first working node and a second working node respectively according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a model updating method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described in detail and clearly with reference to the accompanying drawings.
The embodiment of the application provides a model updating method, a working node and a model updating system. The method can be independent of a central node, and after being executed on a working node, the stored data (local data) of the working node and information requested from other working nodes in the neighborhood (other working nodes belonging to the same sub-network as the working node) can be combined to update machine learning models (for example, gradient update-based machine learning models such as a deep neural network model, a Support Vector Machine (SVM) model and the like) on the working node. Therefore, massive user data do not need to be uploaded to the cloud, and privacy safety of the user can be guaranteed. In addition, the working nodes in the method are updated by combining with the local data, so that the model of each working node is an individualized model, the use habit of a user using the working node is met, and accurate service is provided for the user. In addition, the local data is used for updating, so that the calculation results of other working nodes do not need to be waited, the model updating speed of the working nodes is high, and the time delay is small.
In the embodiment of the present application, the updated model of the first working node may be used for prediction or inference. For example, the updated model can be applied to inference in the scenes of image recognition, voice recognition and the like, and the accuracy of image recognition or voice recognition is improved. For another example, the updated model may be used to predict an Application (APP) to be used by the user, and the predicted APP is loaded into the memory in advance, so as to improve the response speed of the device. The model updated by the first working node may also be applied to other usage scenarios, and the present application embodiment is not limited to the above-mentioned usage scenarios.
The model updating system provided by the embodiment of the present application is described next with reference to fig. 1. Fig. 1 schematically shows a structural diagram of a model updating system provided in an embodiment of the present application.
As shown in fig. 1, the model updating system may include a first working node 11 and at least one second working node 12 (the second working nodes 12a, 12b, 12c, 12d, 12e are exemplarily shown in fig. 1). And data transmission can be carried out between each second working node and the first working node. The data transmission mode may specifically be wired transmission or wireless transmission. The wired transmission may be data transmission through a data line, and the wireless transmission may be data transmission through a mobile data network or transmission through short-distance wireless (such as, but not limited to, bluetooth, wireless fidelity (Wi-Fi), etc.).
Specifically, each first working node or second working node may become a virtual node, and the virtual node may be composed of one or more electronic devices (the first virtual node includes one electronic device as an example in fig. 1). If the virtual node is composed of a plurality of electronic devices, one of the electronic devices may serve as a gateway (gateway) to complete data interaction between the virtual node and other virtual nodes.
Specifically, the first working node and the second working node belong to the same subnet. The range of the subnet may be a connection range belonging to the same router or a connection range belonging to the same base station. The higher the convergence speed of the model updating system on the calculation, i.e. the faster the convergence, the larger the range of the subnet. The second working node is directly connected with the first working node in the same subnet, and the directly connected working nodes form a neighborhood N. Other working nodes belonging to the same subnet as the first working node may be referred to as neighborhood nodes.
The first working node may store therein a model (which may be referred to as a local model of the first working node), and the second working node may store therein 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.
The local model of the first working node may be a machine model, in particular a machine learning model based on gradient updates, such as, but not limited to, a deep neural network model or an SVM model.
Next, a model structure will be described by taking a 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. Wherein the input layer may be used to input user data; convolutional layers can be used to extract local features; an activation function may be used to add a non-linear factor; the pooling layer is used for down-sampling the features, extracting main features, simplifying the complexity of network calculation and increasing the robustness; the full connection layer is used for connecting all the characteristics and sending output values to the classifier. In the present application, a part of the same model structure in the local model of the first working node and the local model of the second working node may be at least a layer including updatable weight parameters, such as a convolutional layer and a fully connected layer.
The first working node or the second working node referred to in this application may be an electronic device or the working node may be a part of the electronic device (e.g. a processor). The first working node or the second working node referred to in this application may also be an SoC.
In the embodiment of the present application, the electronic device may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, 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.
In the following embodiments of the present application, a working node is taken as an example for explanation. The structure of the working node (electronic device) provided in the embodiment of the present application is described below with reference to fig. 2.
Fig. 2 shows a schematic structural diagram of the electronic device 100.
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 key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. 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, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (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. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets 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, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may 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 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may 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, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured 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 via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
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 charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication 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), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110. In this embodiment, the mobile communication module 150 may be configured to perform data transmission with other working nodes, for example, receive requests sent by other working nodes, or send first information to other working nodes.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves. In this embodiment, the wireless communication module 160 may be configured to perform data transmission with other working nodes, for example, receive a request sent by the other working nodes, or send first information to the other working nodes.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. 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).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an 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 alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193. In this embodiment, the ISP may process the image collected by the camera 193 and containing the user gesture.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1. In an embodiment of the present application, the camera 193 may be configured to capture the image stream at a first frequency and capture the image stream at a second frequency when the NPU recognizes that an initial portion of the image stream contains a gesture supported by the electronic device. Wherein the first frequency is lower than the second frequency. The camera 193 according to the embodiment of the present application may be a front camera.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like. In this embodiment, the NPU may be configured to process an image captured by the camera 193, analyze whether a gesture included in the image is a starting part of a gesture supported by the electronic device 100, or analyze whether a gesture included in the image is a gesture supported by the electronic device 100. In this embodiment, the NPU may be configured to store a model of the working node, that is, a local model of the working node, and update the model.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability 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. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor. In this embodiment, the internal memory 121 may be configured to store models of gestures supported by the electronic device 100 and functions corresponding to the respective supported gestures. Possibly, in the application interfaces of different application programs, the supported gestures may be different, and the functions realized by the same gestures may also be different.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
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 to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. 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 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also called a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The model updating method provided by the embodiment of the application can be roughly divided into two parts: firstly, a first working node selects a second working node participating in updating; and secondly, the first working node and the second working node respectively update the stored models.
Fig. 3 illustrates a process in which a first worker node selects a second worker node to participate in an update. As shown in fig. 3, the process may include the following steps:
s301: and the first working node sends a first request to other working nodes belonging to the same subnet as the first working node under the condition that the updating condition is met.
And the first request is used for requesting the other working nodes to participate in model updating of the first working node. The number of other working nodes may be one or more.
Possibly, the update condition may be that the first working node is currently in an idle state, i.e. the first working node is not currently used by the user. Therefore, the first working node can be ensured not to influence the use of a user when the model is updated.
Possibly, the update condition may be that the network environment where the first working node is currently located is a non-mobile data network environment. Therefore, the cost of the user can be saved when the first working node carries out model updating, and extra network cost is not generated.
Possibly, the update condition may be that the first working node is currently in an idle state and a network environment where the first working node is currently located is a non-mobile data network environment. Therefore, the first working node can be ensured not to influence the use of a user when the model is updated, and no extra network cost is generated, so that the cost of the user is saved.
Specifically, the subnet range can refer to the related description in fig. 1, which is not repeated herein.
S302: the other working nodes determine that they are in an updatable state.
Specifically, the updatable state may be that the working node is not currently involved in model updating of other working nodes, and the working node satisfies the updating condition. The description about the update condition may refer to the description about the update condition of the first working node in S301, which is not described herein again.
S303: and other working nodes randomly choose whether to participate in the model updating of the first working node.
Specifically, for some other working node, requests for model updates initiated by multiple first working nodes may be received at the same time. At this time, the first working node can randomly select one working node from the plurality of first working nodes to participate in model updating.
S304: and if the first working node is selected to participate in the model updating of the first working node, sending a first response to the first working node.
Specifically, after determining to participate in model update of the first working node, a first response is sent to the first working node. The first response is used to characterize that the other worker node can participate in model updating of the first worker node.
Possibly, if the other working node is in the non-updatable state or the other working node is in the updatable state but does not choose to participate in the model updating 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 updating of the first working node.
S305: the first working node selects k other working nodes from the m first responses as the second working node.
Possibly, a first working node may receive m first responses indicating that m other working nodes may 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 identification information of the other working node. The first working node can mark the working node as a node participating in updating through the identification information carried by the first response.
Specifically, the first working node may wait for time t after sending the first request. That is, the working node returning the first response within the time t 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.
The first working node may randomly select k from the m nodes participating in the update as the second working node. Wherein m and k are positive integers, and m is greater than or equal to k.
In particular, the first working node may randomly sample k responses S (-) again from the m first responses. How to respond again can be seen S306.
In this application, the first working node may be denoted as niThe first working node niIs marked as n, including the selected second working nodejWherein n isj∈N(ni)。
Fig. 4 illustrates a process in which the first working node and the second working node update their own stored models, respectively. As shown in fig. 4, the process may include the following steps:
s306: the first worker node sends a second request to the second worker node.
In particular, randomly sampling k responses S (-) from the m first responses by the first working node may be that the first working node sends the second request to the second working node. The second request may be a request for obtaining a gradient between a parameter and a model of at least one model of the second working node. Wherein the parameters of at least one model can be parameters of the model of the part of the model with the same structure stored by the first working node and the second working node.
S307: the second working node calculates a gradient of at least one parameter of its model with the model.
In particular, the second working node, after receiving the second request, calculates a gradient of at least one parameter of its local model (i.e. the model stored by the second working node) with the model.
At least one parameter of the model of the second working node is denoted as { w }j|nj∈S(N(ni))}. Wherein, wjAt least one parameter of the model representing the second working node.
Specifically, the model gradient calculated by the second working node may be based on a gradient on mini-batch data (mini-batch), which is denoted as { g }j|nj∈S(N(ni))}。
Specifically, since the amount of user data (or sample data) of each work node is large, a subset of the entire user data (or sample data) may be divided into a plurality of small batches of data. At the moment, the gradient of the second working node model can be calculated based on one of the small batches of data, so that the calculation time can be reduced, the model training speed is improved, and the accuracy of the calculation result can be ensured.
S308: the second working node sends at least one parameter and the gradient of its model to the first working node.
S309: the first working node updates the model for the first time and calculates a first impulse.
Specifically, after the model is updated for the first time, the parameter expression of the model of the first working node is as follows:
Figure BDA0002248454940000141
wherein eta is a constant, the learning rate of the characterization model is increased, and the degree of updating the characterization model is increased when the eta value is increased. k is the number of the second working nodes. It can be known that the number of the parameters of the model may be multiple, different parameters have their respective gradients, and the above expression may be applied to each model parameter.
Illustratively, 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
Figure BDA0002248454940000142
The original parameter 1 of the first working node is denoted as wi,1And the parameter 1 of the second working node is recorded as wj,1. With respect to parameter 1w in the first working nodei,1Has a gradient of gi,1About parameter 1w in the second working nodej,1Has a gradient of gj,1. Then of the first working node
Figure BDA0002248454940000143
Can be according to wi,1、wj,1、gi,1And gj,1And (4) calculating.
Specifically, the impulse is a difference between the updated model and the updated model. First impulse
Figure BDA0002248454940000144
Possibly, in the actual model updating process, the first working node may not perform the first model updating, and only the value of the first impulse may be calculated.
S310: the first working node sends the first impulse to the second working node.
S311: the second working node updates the model for the first time according to the first impulse.
Specifically, after the second working node receives the first impulse, at least one parameter w of the model of the second working node is calculatedjIs updated to
Figure BDA0002248454940000145
S312: the first worker node sends a third request to the second worker node.
Specifically, the first working node may send the third request to all neighborhood nodes participating in the update (including the k second working nodes described above). The third request may be for obtaining a new gradient of the model of the second working node
Figure BDA0002248454940000146
S313: the second worker node calculates the gradient over the entire subset of data.
In particular, the neighborhood node (including the k second working nodes mentioned above) that received the third request computes a new gradient over its entire data subset
Figure BDA0002248454940000147
314: the second working node sends the gradient over the entire subset of data to the first working node.
Specifically, all the neighborhood nodes participating in the update (including the k second working nodes) may return the new gradient to the first working node
Figure BDA0002248454940000148
S315: and the first working node updates the model for the second time and calculates a second impulse.
Specifically, the first working node may update its local model a second time after collecting the new gradient returned by the neighborhood node (denoted as P) of ρ% (e.g., without limitation, 50%, 80%, etc.):
impulse of the first working node after the model is updated for the second time
Figure BDA0002248454940000149
That is, the first working node may utilize the received mean value of the gradients of the second working nodes to perform gradient descent to obtain the impulse of model update of the first working node
Figure BDA00022484549400001410
And updating the model of the first working node according to the impulse.
The model parameters after the first working node updates the model for the second time can be expressed as
Figure BDA0002248454940000151
Specifically, the model parameter w before updating can be usediIs replaced by
Figure BDA0002248454940000152
Is marked as
Figure BDA0002248454940000153
S316: the first working node sends a second impulse to the second working node.
Specifically, the impulse of the first working node after the model is updated for the second time
Figure BDA0002248454940000154
I.e. the second impulse.
S317: and the second working node updates the model for the second time according to the second impulse.
Specifically, the second working node updates the parameters of the model thereof according to the second impulse, and the updated model parameters can be expressed as
Figure BDA0002248454940000155
In particular, the model parameters before updating can be usedwjIs replaced by
Figure BDA0002248454940000156
Is marked as
Figure BDA0002248454940000157
From S309-S315, it can be seen that the first working node may perform model update by using the received at least one parameter of the model of each second working node and the received mean value of the gradient of each second working node.
In the above S309-S315, the model updating process is performed by one gradient descent, and in the actual updating process, the model updating process may be performed by performing multiple gradient descents.
Possibly, the above-mentioned multiple gradient descent to perform model update may be that the second working node calculates the gradient g on its small batch of data multiple times in S307jThe first worker node is caused to execute S309 a plurality of times to implement a plurality of gradient updates.
Possibly, the above-mentioned multiple gradient descent for model update may also be that the second working node calculates its new gradient across the entire data subset multiple times in S313
Figure BDA0002248454940000158
The first working node is caused to perform S315 multiple times to implement multiple gradient updates.
Possibly, the above-mentioned multiple gradient descent for model update may be a combination of the above two cases (i.e. multiple calculation of gradient g in S307)jAnd calculating new gradients multiple times in S313
Figure BDA0002248454940000159
). The number of gradient drops in the two cases may be the same or different. The number of times of the gradient decrease is not limited in the embodiment of the present application.
Not limited to the above-mentioned updating manners listed in S309-S315, there may be the following updating manners of the model in a specific implementation:
the first method is as follows: the first working node can perform one or more gradient descent operations to update the model by using the received gradient of each second working node.
In particular, when a plurality of gradient dips are performed, when a sub-gradient is dropped
Figure BDA00022484549400001510
For the last gradient descent
Figure BDA00022484549400001511
Can be recorded as
Figure BDA00022484549400001512
The second method comprises the following steps: and the first working node performs one or more gradient reductions on the received average value of any parameter of the model of each second working node and the parameter corresponding to the parameter in the first working node and the received gradient of each second working node to update the model.
Order to
Figure BDA00022484549400001513
And a mean value of a certain parameter of the model of each second working node and a corresponding parameter of the model of the first node. Illustratively, if a first working node receives parameters of a model of 3 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
Figure BDA00022484549400001514
Is the mean of parameter 1 of the 3 second working nodes and parameter 1 of the first working node, or
Figure BDA00022484549400001515
Is the mean of the parameter 2 of the 3 second working nodes and the parameter 2 of the first working node, or
Figure BDA00022484549400001516
Is the average of the parameter 3 of the 3 second working nodes and the parameter 3 of the first working node. Namely:
Figure BDA00022484549400001517
specifically, after the first model update, the parameters of the model of the first working node are
Figure BDA00022484549400001518
In particular, when a plurality of gradient dips are performed, when a sub-gradient is dropped
Figure BDA0002248454940000161
For the last gradient descent
Figure BDA0002248454940000162
Can be recorded as
Figure BDA0002248454940000163
Wherein the content of the first and second substances,
Figure BDA0002248454940000164
the third method comprises the following steps: and the first working node performs one or more gradient descent to update the model by using any received parameter of each second working node model, the mean value of the parameter corresponding to the parameter in the first working node and the mean value of the gradient of each received second working node.
Order to
Figure BDA0002248454940000165
And a mean value of a certain parameter of the model of each second working node and a corresponding parameter of the model of the first node. For the
Figure BDA0002248454940000166
Can be referred to as mode twoFor example, are not described herein again.
Specifically, after the first model update, the parameters of the model of the first working node are
Figure BDA0002248454940000167
In particular, when a plurality of gradient dips are performed, when a sub-gradient is dropped
Figure BDA0002248454940000168
For the last gradient descent
Figure BDA0002248454940000169
Can be recorded as
Figure BDA00022484549400001610
Wherein the content of the first and second substances,
Figure BDA00022484549400001611
in addition, when the second working node transmits the first information to the first working node (e.g., S308 or S314), a relatively large bandwidth may be occupied, and the first information may be compressed or truncated. Specifically, the second working node may perform descending order arrangement on the absolute values of the gradients of each parameter, select a part of parameters with the highest order of the absolute values of the gradients according to the network communication overhead budget to transmit, and then update the part of parameters. Therefore, the data of the most important part or the most active part in the model can be selected for transmission, and therefore the network communication overhead is reduced.
Possibly, the data transmission between the first working node and the second working node (such as steps S308, S310, S314, S316, etc.) may employ an encryption algorithm to process the transmitted data, so as to ensure data security, further increase system security, form a decentralized horizontal federal learning method, and ensure privacy of users.
In particular, the encryption algorithm may be homomorphic encryption, or semi-homomorphic encryption, or a differential privacy method in a trusted computer environment.
In this embodiment of the application, 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, and for the partially same model structure, the first working node may update the model through the first information sent by the second working node that belongs to the same neighborhood as the first working node and the data stored in the first working node. Wherein the first information may include at least one of the following information of the second working node that transmits 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 by the embodiment of the application is a decentralized model updating method, namely the method does not depend on a 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 of the same sub-network to which the first working node 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 parameters such as the model and gradient of the second working node and impulse of the model, so that the privacy safety of the user can be ensured. In addition, each working node can update the model of the first working node by combining the user data and the first information stored in the working node, and the personalized model can be customized for the working node by updating the model according to the user data stored in the working node, so that more accurate service is provided for the user. In addition, the first working node can directly use the stored data to update the data without waiting for the calculation results of other working nodes, and the calculation speed is high and the time delay is small.
Next, a model updating method provided by an embodiment of the present application is described with reference to fig. 3 to 4.
As shown in fig. 5, the model updating method may include the following steps:
s501: the first working node receives first information sent by at least one second working node.
S502: and the first working node updates the model according to the first information and the model and data stored by the first working node.
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 that transmitted the first information: at least one parameter of the model, the gradient, and the impulse of the model.
Specifically, the model stored by the first working node has at least partially the same model structure as the model stored by the second working node.
Possibly, the model stored by the first working node has the same model structure as the model stored by the second working node.
In one possible embodiment, the number of second working nodes is k. Before S501, the method may further include a process of selecting the second working node, and the process may refer to the related description of fig. 3, which is not described herein again.
In a possible embodiment, after S502, the method may further include: and the first working node sends the impulse of the updated model to the at least one second working node so as to update the model of the second working node.
Specifically, the impulse of the updated model of the first working node is the first impulse mentioned in S309
Figure BDA0002248454940000171
For a specific calculation process, reference may be made to the related description in S309, and details are not repeated here.
The process of updating the model by the second working node may refer to the relevant description of S310-S311, and is not described herein again.
In a possible embodiment, after the first working node selects k second working nodes, before S501, the method may further include: the first working node sends a request for obtaining the first information of the second working node to the second working node.
In a possible embodiment, the first information comprises at least one parameter and a gradient of a model of the second working node sending the first information.
The mode of the first working node updating the model according to the first information and the model and data stored in the first working node may include the following:
the first method is as follows: and the first working node performs one or more gradient descent operations by using the received gradient of each second working node to update the model.
The specific process of the first method may refer to the calculation process of the first method listed in the embodiment of fig. 4, and details thereof are not repeated here.
The second method comprises the following steps: the first working node performs one or more gradient reductions on the average value of any received parameter of the model of each second working node and the parameter corresponding to the parameter in the first working node and the gradient of each received second working node to obtain the impulse of model updating of the first working node, and updates the model of the first working node according to the impulse.
The specific process of the second method may refer to the calculation process of the second method listed in the embodiment of fig. 4, and is not described herein again.
The third method comprises the following steps: and the first working node performs one or more gradient descent to update the model by using any received parameter of each second working node model, the mean value of the parameter corresponding to the parameter in the first working node and the mean value of the gradient of each received second working node.
The specific process of the third method may refer to the calculation process of the third method listed in the embodiment of fig. 4, and is not described herein again.
The method is as follows: the first working node performs one or more gradient reductions on at least one parameter of the received model of each second working node and the mean value of the gradient of each second working node to obtain the impulse of model updating of the first working node, and the model of the first working node is updated according to the impulse.
The specific process of the fourth mode may refer to the calculation processes listed in S309-S315 in the embodiment of fig. 4, and is not described herein again.
In a possible embodiment, the first information is information after being compressed or truncated.
In a possible embodiment, the first information is information encrypted by using homomorphic encryption or semi-homomorphic encryption, or the first information is information encrypted by using a differential privacy method in the trusted computing environment.
In this embodiment of the application, 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, and for the partially same model structure, the first working node may update the model through the first information sent by the second working node that belongs to the same neighborhood as the first working node and the data stored in the first working node. Wherein the first information may include at least one of the following information of the second working node that transmits 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 by the embodiment of the application is a decentralized model updating method, namely the method does not depend on a 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 of the same sub-network to which the first working node 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 parameters such as the model and gradient of the second working node and impulse of the model, so that the privacy safety of the user can be ensured. In addition, each working node can update the model of the first working node by combining the user data and the first information stored in the working node, and the personalized model can be customized for the working node by updating the model according to the user data stored in the working node, so that more accurate service is provided for the user. In addition, the first working node can directly use the stored data to update the data without waiting for the calculation results of other working nodes, and the calculation speed is high and the time delay is small.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The method provided by the embodiment of the application can execute each step through a corresponding unit or module. The modules in the device can be merged, divided and deleted according to actual needs.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (17)

1. A method for model update, the method comprising:
a first working node receives first information sent by at least one second working node; the at least one second working node is a working node which belongs to the same sub-network with 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 of the following information of a second working node that transmits 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.
2. The method of claim 1, wherein the first working node stored model has the same model structure as the at least one second working node stored model.
3. The method according to claim 1 or 2, wherein 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:
under the condition that an updating condition is met, the first working node sends a first request to other working nodes which belong to the same subnet as the first working node; wherein the first request is used for requesting the other working nodes to participate in model updating of the first working node;
the first working node receives first responses sent by the other working nodes; the first response is used for representing whether the other working nodes participate in model updating of the first working node, and the number of the other working nodes participating in model updating of the first working node is m;
the first working node selects k working nodes from m other working nodes and sends a request for acquiring the first information to the k working nodes; wherein the k working nodes are the second working nodes.
4. A method according to any one of claims 1 to 3, wherein after the first working node updates the model based on the first information and the model and data stored by the first working node, the method further comprises:
and the first working node sends the impulse of the updated model to the at least one second working node so as to update the model of the at least one second working node.
5. The method according to any of claims 1-4, wherein before the first working node receives the first information sent by the at least one second working node, the method further comprises: and the first working node sends a request for acquiring the first information of the at least one second working node to the at least one second working node.
6. A method according to any of claims 1-5, wherein the first information comprises at least one parameter and gradient of a model of a second working node sending the first information;
the first working node model-updating the model according to the first information and the model and data stored by the first working node comprises:
the first working node performs one or more gradient descending to update the model by using the mean value of any parameter of the received model of each second working node and the parameter corresponding to the parameter in the first working node and the gradient of each received second working node; or the like, or, alternatively,
the first working node performs one or more gradient reductions to update the model by using at least one parameter of the received model of each second working node and the mean value of the received gradient of each second working node; or the like, or, alternatively,
and the first working node performs one or more gradient reductions to update the model by using any received parameter of the model of each second working node, the mean value of the parameter corresponding to the parameter in the first working node and the mean value of the gradient of each received second working node.
7. The method of any one of claims 1-5, wherein the first information includes a gradient of a model of a second working node that sent the first information;
the first working node model-updating the model according to the first information and the model and data stored by the first working node comprises: and the first working node performs one or more gradient descent operations by using the received gradient of each second working node to update the model.
8. The method of any one of claims 1-7, wherein the first information is information that has been compressed or truncated.
9. The method of any of claims 1-8, wherein the first information is information that is encrypted using homomorphic encryption, or semi-homomorphic encryption, or wherein the first information is information that is encrypted using a differential privacy method in the trusted computing environment.
10. The method of any of claims 1-9, wherein the model stored by the first working node is a machine learning model.
11. The method of claim 10, in which the machine learning model is a gradient update based machine learning model comprising a deep neural network model or a Support Vector Machine (SVM) model.
12. An apparatus comprising a processor and a memory, the memory being arranged to store computer program instructions, the processor executing the computer program instructions in the memory when the apparatus is run to cause the apparatus to perform the method of any of claims 1 to 11.
13. The apparatus of claim 12, wherein the apparatus is an electronic device or a portion of the electronic device.
14. The apparatus of claim 12, wherein the apparatus is a system on a chip (SoC).
15. A model updating system comprising a first working node, said first working node being an apparatus according to any of claims 12-14, and at least a second working node, said second working node being a working node belonging to the same sub-network as said first working node.
16. A computer-readable storage medium having stored therein instructions, which when run on a computer or processor, cause the computer or processor to perform the method of any one of claims 1-11.
17. A computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to perform the method of any one of claims 1-11.
CN201911025363.XA 2019-10-12 2019-10-25 Model updating method, working node and model updating system Pending CN112651510A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/120135 WO2021068926A1 (en) 2019-10-12 2020-10-10 Model updating method, working node, and model updating system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2019109694044 2019-10-12
CN201910969404 2019-10-12

Publications (1)

Publication Number Publication Date
CN112651510A true CN112651510A (en) 2021-04-13

Family

ID=75343254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911025363.XA Pending CN112651510A (en) 2019-10-12 2019-10-25 Model updating method, working node and model updating system

Country Status (2)

Country Link
CN (1) CN112651510A (en)
WO (1) WO2021068926A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113033828A (en) * 2021-04-29 2021-06-25 江苏超流信息技术有限公司 Model training method, using method, system, credible node and equipment
CN114301573A (en) * 2021-11-24 2022-04-08 超讯通信股份有限公司 Federal learning model parameter transmission method and system
WO2023138231A1 (en) * 2022-01-20 2023-07-27 北京邮电大学 Residual propagation method and apparatus for network model
WO2024036567A1 (en) * 2022-08-18 2024-02-22 Huawei Technologies Co., Ltd. Methods and apparatuses for learning an articifical intelligence or machine learning model

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280522A (en) * 2018-01-03 2018-07-13 北京大学 A kind of plug-in type distributed machines study Computational frame and its data processing method
CN108446770A (en) * 2017-02-16 2018-08-24 中国科学院上海高等研究院 A kind of slow node processing system and method for distributed machines study based on sampling
CN108491928A (en) * 2018-03-29 2018-09-04 腾讯科技(深圳)有限公司 Model parameter training method, device, server and storage medium
US20180322387A1 (en) * 2017-05-05 2018-11-08 Intel Corporation Hardware implemented point to point communication primitives for machine learning
CN108924910A (en) * 2018-07-25 2018-11-30 Oppo广东移动通信有限公司 The update method and Related product of AI model
CN109299781A (en) * 2018-11-21 2019-02-01 安徽工业大学 Distributed deep learning system based on momentum and beta pruning
CN109409125A (en) * 2018-10-12 2019-03-01 南京邮电大学 It is a kind of provide secret protection data acquisition and regression analysis
US20190073587A1 (en) * 2017-09-04 2019-03-07 Kabushiki Kaisha Toshiba Learning device, information processing device, learning method, and computer program product
CN109740755A (en) * 2019-01-08 2019-05-10 深圳市网心科技有限公司 A kind of data processing method and relevant apparatus based on gradient descent method
CN109754060A (en) * 2017-11-06 2019-05-14 阿里巴巴集团控股有限公司 A kind of training method and device of neural network machine learning model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169513B (en) * 2017-05-05 2019-10-18 第四范式(北京)技术有限公司 Control distributed machines learning system and its method that data use sequence

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446770A (en) * 2017-02-16 2018-08-24 中国科学院上海高等研究院 A kind of slow node processing system and method for distributed machines study based on sampling
US20180322387A1 (en) * 2017-05-05 2018-11-08 Intel Corporation Hardware implemented point to point communication primitives for machine learning
US20190073587A1 (en) * 2017-09-04 2019-03-07 Kabushiki Kaisha Toshiba Learning device, information processing device, learning method, and computer program product
CN109754060A (en) * 2017-11-06 2019-05-14 阿里巴巴集团控股有限公司 A kind of training method and device of neural network machine learning model
CN108280522A (en) * 2018-01-03 2018-07-13 北京大学 A kind of plug-in type distributed machines study Computational frame and its data processing method
CN108491928A (en) * 2018-03-29 2018-09-04 腾讯科技(深圳)有限公司 Model parameter training method, device, server and storage medium
CN108924910A (en) * 2018-07-25 2018-11-30 Oppo广东移动通信有限公司 The update method and Related product of AI model
CN109409125A (en) * 2018-10-12 2019-03-01 南京邮电大学 It is a kind of provide secret protection data acquisition and regression analysis
CN109299781A (en) * 2018-11-21 2019-02-01 安徽工业大学 Distributed deep learning system based on momentum and beta pruning
CN109740755A (en) * 2019-01-08 2019-05-10 深圳市网心科技有限公司 A kind of data processing method and relevant apparatus based on gradient descent method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113033828A (en) * 2021-04-29 2021-06-25 江苏超流信息技术有限公司 Model training method, using method, system, credible node and equipment
CN113033828B (en) * 2021-04-29 2022-03-22 江苏超流信息技术有限公司 Model training method, using method, system, credible node and equipment
CN114301573A (en) * 2021-11-24 2022-04-08 超讯通信股份有限公司 Federal learning model parameter transmission method and system
WO2023138231A1 (en) * 2022-01-20 2023-07-27 北京邮电大学 Residual propagation method and apparatus for network model
WO2024036567A1 (en) * 2022-08-18 2024-02-22 Huawei Technologies Co., Ltd. Methods and apparatuses for learning an articifical intelligence or machine learning model

Also Published As

Publication number Publication date
WO2021068926A1 (en) 2021-04-15

Similar Documents

Publication Publication Date Title
WO2021068926A1 (en) Model updating method, working node, and model updating system
CN111030990B (en) Method for establishing communication connection, client and server
CN111132234A (en) Data transmission method and corresponding terminal
CN112860428A (en) High-energy-efficiency display processing method and equipment
CN110557740A (en) Electronic equipment control method and electronic equipment
CN114880251A (en) Access method and access device of storage unit and terminal equipment
CN113490291B (en) Data downloading method and device and terminal equipment
WO2022022319A1 (en) Image processing method, electronic device, image processing system and chip system
CN113596919B (en) Data downloading method and device and terminal equipment
CN113126948A (en) Audio playing method and related equipment
CN114221402A (en) Charging method and device of terminal equipment and terminal equipment
CN115514844A (en) Volume adjusting method, electronic equipment and system
CN114915721A (en) Method for establishing connection and electronic equipment
CN109285563B (en) Voice data processing method and device in online translation process
WO2022135144A1 (en) Self-adaptive display method, electronic device, and storage medium
CN113467904B (en) Method and device for determining collaboration mode, electronic equipment and readable storage medium
CN113467747B (en) Volume adjusting method, electronic device and storage medium
CN114120987B (en) Voice wake-up method, electronic equipment and chip system
CN115393676A (en) Gesture control optimization method and device, terminal and storage medium
CN114116610A (en) Method, device, electronic equipment and medium for acquiring storage information
CN114466238A (en) Frame demultiplexing method, electronic device and storage medium
CN114554012A (en) Incoming call answering method, electronic equipment and storage medium
CN113391735A (en) Display form adjusting method and device, electronic equipment and storage medium
CN116346982B (en) Method for processing audio, electronic device and readable storage medium
WO2023237087A1 (en) Method for predicting fertile window, apparatus and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination