Model training method and device, and electronic device

By training models and uploading result data according to the target processing mode in edge-cloud collaborative training, the problem of inflexibility in edge training process is solved, dynamic resource scheduling and training efficiency are achieved, and it is suitable for a variety of business scenarios.

CN117216560BActive Publication Date: 2026-08-25SHENZHEN HEYTAP TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311128659.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2026-08-25
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

In the process of edge-cloud collaborative training, the edge training process is not flexible enough and cannot effectively utilize resources under different processing modes, resulting in low training efficiency.

Method used

The model is trained on the client side according to the target processing mode, and the training results are uploaded to the server for model aggregation. The appropriate processing mode is dynamically selected to improve training flexibility, including resource scheduling such as multi-process training, memory configuration and power management.

Benefits of technology

It improves the flexibility and efficiency of the edge training process, enabling the selection of the best processing mode under different resource configurations, and enhances the adaptability of model training and efficiency in business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216560B_ABST
    Figure CN117216560B_ABST
Patent Text Reader

Abstract

The application provides a model training method and device and electronic equipment. The method is applied to a client included in an end-cloud training system, the end-cloud training system also includes a server, and the method comprises the following steps: performing model training on a to-be-trained model according to a target processing mode, the target processing mode is determined from multiple candidate processing modes, wherein the resources used for model training are different in different processing modes; obtaining training result data obtained after the model training; and uploading the training result data to the server, so that the server obtains a target model based on model aggregation of the training result data. Therefore, in the case that the resources used for model training are different in different processing modes, the target processing mode required at present can be determined from multiple processing modes, the model training is performed on the to-be-trained model according to the target processing mode, and the flexibility of the end-side training process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a model training method, apparatus, and electronic device. Background Technology

[0002] Edge-cloud collaborative training is a machine learning framework that effectively helps multiple organizations use data and perform machine learning modeling while meeting user privacy, data security, and government regulations. During edge-cloud collaborative training, the edge device can upload the data trained at the current stage to the cloud for data integration. However, the edge-cloud collaborative training process still suffers from a lack of flexibility in the edge-side training process. Summary of the Invention

[0003] In view of the above problems, this application proposes a model training method, apparatus, and electronic device to improve the above problems.

[0004] Firstly, this application provides a model training method applied to a client of an edge-cloud training system, the edge-cloud training system further including a server. The method includes: training a model to be trained according to a target processing mode, wherein the target processing mode is determined from multiple candidate processing modes, and the resources used for model training are different in different processing modes; obtaining training result data obtained after training the model; and uploading the training result data to the server for the server to perform model aggregation based on the training result data to obtain a target model.

[0005] Secondly, this application provides a model training apparatus running on a client side of an edge-cloud training system, the edge-cloud training system further including a server side. The apparatus includes: a model training unit, used to train a model to be trained according to a target processing mode, wherein the target processing mode is determined from multiple candidate processing modes, and the resources used for model training are different in different processing modes; a training result data acquisition unit, used to acquire training result data obtained after the model training; and a data communication unit, used to upload the training result data to the server side, so that the server side can perform model aggregation based on the training result data to obtain a target model.

[0006] Thirdly, this application provides an electronic device, which includes at least a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above-described method.

[0007] Fourthly, this application provides a computer-readable storage medium storing program code, wherein the above-described method is executed when the program code is run by a processor.

[0008] This application provides a model training method, apparatus, and electronic device. After training a model to be trained according to a target processing mode, the method can acquire the training result data obtained after the model training and then upload the training result data to a server. The server then uses the training result data to perform model aggregation to obtain a target model. Therefore, even when the resources used for model training differ in different processing modes, the method can determine the required target processing mode from multiple processing modes and train the model to be trained according to the target processing mode, thereby improving the flexibility of the edge training process. Attached Figure Description

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

[0010] Figure 1 A schematic diagram illustrating an application scenario of the model training method in this application embodiment is shown;

[0011] Figure 2 A schematic diagram of an edge-cloud training framework according to an embodiment of this application is shown;

[0012] Figure 3 A flowchart of a model training method according to an embodiment of this application is shown;

[0013] Figure 4 A flowchart of a model training method according to another embodiment of this application is shown;

[0014] Figure 5 A flowchart of a model training method according to another embodiment of this application is shown;

[0015] Figure 6 A schematic diagram of another edge-cloud training framework in an embodiment of this application is shown;

[0016] Figure 7 This paper shows a structural block diagram of a model training device according to an embodiment of the present application;

[0017] Figure 8 A structural block diagram of another model training device proposed in an embodiment of this application is shown;

[0018] Figure 9 A structural block diagram of another electronic device for performing a model training method according to an embodiment of the present application is shown;

[0019] Figure 10 This is a storage unit in this application embodiment for storing or carrying program code that implements the model training method according to this application embodiment. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0021] To endow a neural network model with specific functions, it can be trained using training data to obtain a model capable of performing those functions. However, some training data used to train the neural network model may involve user privacy. For example, training data might include categories of information recently accessed by the user, or the order in which the user recently used applications. In such cases, edge-cloud collaborative training can be employed for model training.

[0022] Edge-cloud collaborative training is a machine learning framework that effectively helps multiple organizations use data and perform machine learning modeling while meeting user privacy, data security, and government regulations. In edge-cloud collaborative training, the model can be trained on the device (the user's electronic device), and the training data is stored locally on the device, thus protecting user privacy. The device can then upload the data trained at the current stage to the cloud (server) for data integration. However, edge-cloud collaborative training still suffers from a lack of flexibility in the edge training process.

[0023] Therefore, after discovering the above-mentioned problems in their research, the inventors proposed the model training method, apparatus, and electronic device described in this application, which can improve upon these problems. After training the model to be trained according to the target processing mode, the training result data obtained after the model training can be acquired and then uploaded to the server. The server then uses the training result data to perform model aggregation to obtain the target model. Thus, even when the resources used for model training differ in different processing modes, the required target processing mode can be determined from multiple processing modes, and the model to be trained can be performed according to the target processing mode, thereby improving the flexibility of the edge training process.

[0024] Before providing a more detailed description of the embodiments of this application, an application environment related to the embodiments of this application will be introduced.

[0025] The application scenarios involved in the embodiments of this application will be introduced below.

[0026] The model training method provided in this application embodiment can be executed collaboratively by a client and a server. In this collaborative execution method, some steps of the model training method provided in this application embodiment are executed by the client, while other steps are executed by the server. For example, as shown... Figure 1 As shown, the client 101 in the electronic device 100 can execute the model training steps and the step of uploading the training result data to the server in the model training method. The server 200 then performs model aggregation based on the training result data to obtain the target model. Furthermore, the server 200 can also execute the step of distributing the model to be trained to the client 101.

[0027] It should be noted that in this method of collaborative execution by the client and server, the steps executed by the client and server are not limited to those described in the example above. In practical applications, the steps executed by the client and server can be dynamically adjusted according to the actual situation.

[0028] It should be noted that the electronic equipment 100, in addition to being for Figure 1 In addition to smartphones, the device 200 can also be a tablet, smartwatch, smart voice assistant, or other similar device. The server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud computing, cloud storage, network services, cloud communication, middleware services, CDN (Content Delivery Network), and artificial intelligence platforms.

[0029] Optionally, the edge-cloud collaborative training mentioned in the embodiments of this application can also be understood as federated training or federated learning. For example... Figure 2 As shown, the client may include Figure 2 The federated training engine 102 shown may include an aggregator 201 and a filter 202 in the server-side 200. The federated training engine 102 can execute the steps performed by the client. The aggregator 201 can aggregate models based on the training result data uploaded by the federated training engine 102 to obtain the target model. The filter 202 can filter the clients participating in the training.

[0030] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0031] Please see Figure 3 This application provides a model training method applied to a client in an edge-cloud training system, wherein the edge-cloud training system further includes a server. The method includes:

[0032] S110: Train the model to be trained according to the target processing mode, wherein the target processing mode is determined from multiple candidate processing modes, and the resources used for model training are different in different processing modes.

[0033] In this embodiment, multiple candidate processing modes can be pre-established, wherein each processing mode is a mode used for model training. The resources used for model training will differ in different processing modes. These resources may include processes, memory, and power.

[0034] It should be noted that during model training, starting multiple processes to participate in model training simultaneously can accelerate the training speed. Furthermore, model training involves data storage and computation, so allocating more memory also improves training speed. Optionally, in one processing mode, multiple processes can be configured to participate in model training, while in another, a single process can be configured. Optionally, when multiple processes are configured for model training, more memory will be allocated. For example, in the determined target processing mode where multiple processes are used for model training, the allocated memory is designated as the first memory; in the determined target processing mode where a single process is used for model training, the allocated memory is designated as the second memory, where the first memory is larger than the second memory.

[0035] When there are multiple candidate processing modes, the processing mode to be used for model training can be determined before each training session begins. In this embodiment, there are several ways to determine the target processing mode.

[0036] One approach is to determine the target processing mode based on the needs of the current model training. These needs may include requirements for the number of samples used in model training, the required training time, and the required training accuracy. It's worth noting that for model training, more training data generally improves training accuracy, thus enhancing the model's performance in applications. For example, if the target model aims to identify objects from images, more training data (including images with and without objects) will result in more accurate object recognition in subsequent applications. More training data also increases the computational load during training, allowing for the allocation of more processes or memory. Furthermore, the server may specify training time requirements, such as requiring the client to complete model training within a specified time. In such cases, the client can allocate more processes to participate in model training to ensure timely completion.

[0037] Alternatively, the target processing mode can be determined based on the client's local configuration. Optionally, this local configuration can be configured to use a fixed processing mode. In this case, the client will consistently use this processing mode as the target processing mode each time it performs model training. For example, multiple alternative processing modes include processing mode M1 and processing mode M2. If the user selects to consistently use processing mode M1, the client will consistently use processing mode M1 for model training. Optionally, the local configuration can be configured to determine the processing mode based on the remaining processing resources (e.g., processes, memory, and battery power) of the electronic device on which the client resides. It should be noted that the electronic device includes not only the client executing the model training method in this embodiment but also other programs, which will also consume the electronic device's processing resources during operation. To balance the consumption of processing resources by the client and other programs, the client can choose a processing mode with more resources for model training as the target processing mode when the electronic device has more remaining processing resources, and choose a processing mode with fewer resources for model training when the electronic device has fewer remaining processing resources.

[0038] As another approach, the target processing mode can be determined by combining the current model training requirements with the actual conditions of the client's electronic device. It's important to note that while the server issues the current model training requirement, in some cases, the client's electronic device may not be able to adequately meet that requirement. In such situations, if the client detects that its electronic device cannot meet the current training requirements, it can send a request to the server to reduce the requirement. If the server agrees to the reduction, the client can choose a lower-level processing mode than the server's original requirement. This lower-level processing mode will allocate fewer resources for model training.

[0039] S120: Obtain the training result data obtained after training the model.

[0040] The training result data refers to the data representing the trained model. Optionally, the training result data can be data describing the model obtained after training the model to be trained, and thus the trained model can be obtained through the training result data.

[0041] S130: Upload the training result data to the server so that the server can perform model aggregation based on the training result data to obtain the target model.

[0042] After obtaining the training results data, it can be uploaded to the server. During edge-cloud collaborative training, multiple clients can train simultaneously, allowing the server to receive training results data uploaded from multiple clients. After receiving these results, the server can aggregate them to obtain the target model. The target model can be understood as the final model obtained through training.

[0043] As one approach, the step of training the model to be trained according to the target processing mode may further include: obtaining configuration information from the server, configuring the model to be trained and / or functional components based on the configuration information, wherein the functional components include components used for data uploading and storage during model training. Specifically, the client can upload some information to the server through functional components during training, and will also upload the training result data to the server through functional components after obtaining the training result data. In this case, the data uploading or storage operations of the functional components can be configured through the configuration information. For example, the timing or content of data uploading by the functional components can be configured, or the timing or content of data storage by the functional components can be configured.

[0044] As one approach, training the model to be trained according to the target processing mode includes: responding to the model to be trained corresponding to the current training issued by the server, training the model to be trained corresponding to the current training according to the target processing mode, wherein the model to be trained corresponding to the current training is obtained by the server by aggregating the models obtained from the previous training by multiple clients.

[0045] It should be noted that the model training process involved in this application embodiment may involve multiple training processes. In this case, after each training session, the client uploads the training result data. The server can then aggregate the data to obtain the model obtained after the current training session and redistribute the aggregated model to each client so that the client can enter the next model training process. Specifically, after receiving the training result data uploaded by multiple clients, the server, in addition to aggregating the model, can also determine the number of training sessions already performed. If the number of training sessions meets the preset target number, the server will use the model obtained by aggregating the training result data uploaded by multiple clients as the target model; otherwise, the server will redistribute the aggregated model to multiple clients for the next training session.

[0046] This embodiment provides a model training method that, after training the model to be trained according to a target processing mode, acquires the training result data obtained after the model training, and then uploads the training result data to the server. The server then uses the training result data to perform model aggregation to obtain the target model. Therefore, even when the resources used for model training differ in different processing modes, the required target processing mode can be determined from multiple processing modes, and the model to be trained can be performed according to the target processing mode, thereby improving the flexibility of the edge-side training process.

[0047] Please see Figure 4 This application provides a model training method applied to a client in an edge-cloud training system, wherein the edge-cloud training system further includes a server. The method includes:

[0048] S210: Obtain training conditions from the server.

[0049] S220: If it is determined that the electronic device where the client is located meets the training conditions, a training request is sent to the server.

[0050] The training conditions can be understood as the restrictions on participating in this model training. After the server sends the training conditions, the client can check whether its electronic device meets those conditions. If it confirms that the conditions are met, it then sends a training request to the server.

[0051] Optionally, training conditions can restrict the network status, battery level, available processing resources, and whether the electronic device hosting the client has previously participated in training. One approach is to set training conditions as follows: the electronic device is connected to the internet via WiFi (Wi-Fi Fidelity), the electronic device's battery level is greater than a battery threshold, and the electronic device's available processing resources are greater than a resource threshold. Another approach is to set training conditions as follows: the electronic device's available processing resources are greater than a resource threshold, and the electronic device has not previously participated in training.

[0052] In this embodiment of the application, the training conditions issued by the server can be configured by the developers on the server, or the server can be automatically configured according to the actual situation.

[0053] One approach is to provide a conditional configuration interface on the server. In this interface, developers can input training conditions according to their needs. The server can then store these conditions for distribution to the client.

[0054] As another approach, the server can determine the training conditions based on the model to be trained. It's important to note that different models require different resources during training. For example, some models, due to their complex structure, consume more resources during training, and the client needs to upload more training data. Therefore, if the client's electronic device lacks sufficient processing resources, training may not be completed smoothly. Furthermore, in edge-cloud collaborative training, local client data is typically used as training data, and different clients have different training data, resulting in varying training outcomes for each client. If the server finds that the previously trained target model does not meet the requirements, it can re-trigger model training. In this case, the server can reassign previously trained clients.

[0055] In this context, "the target model not meeting the predetermined requirements" can be understood as the target model being unable to accurately perform the required functions. For example, if the target model's function is to recommend information to users, and a low conversion rate is detected based on the information recommended by the target model, it indicates that the target model may not be able to accurately recommend information to users. As another example, if the target model's function is to identify objects in an image, but a high false recognition rate is detected, it indicates that the target model cannot accurately perform the required functions.

[0056] If the client detects that its electronic device meets the training conditions, it will return a training request to the server so that the server can determine that the client can meet the training conditions it has issued.

[0057] S230: Receive the model to be trained returned by the server in response to the training request.

[0058] After receiving a training request from the client, the server can return a model to be trained to the client. It's important to note that the model returned by the server upon receiving the training request is an initial model that has not yet undergone training. During training, the model returned by the server to the client (the model to be trained in the next iteration) can be a model obtained by the server through aggregation operations based on the training results data from the previous training iteration.

[0059] S240: Train the model to be trained according to the target processing mode, wherein the target processing mode is determined from multiple candidate processing modes, and the resources used for model training are different in different processing modes.

[0060] S250: Obtain the training result data obtained after training the model.

[0061] S260: Upload the training result data to the server so that the server can perform model aggregation based on the training result data to obtain the target model.

[0062] As one approach, obtaining training conditions from the server includes: obtaining training conditions corresponding to the training task from the server. In this approach, training the model to be trained according to the target processing mode includes: training the model to be trained according to the target processing mode and the training task.

[0063] This embodiment provides a model training method that, when the resources used for model training differ in different processing modes, can determine the required target processing mode from multiple processing modes, and then train the model to be trained according to the target processing mode, thereby improving the flexibility of the client-side training process. Furthermore, in this embodiment, the client can first determine whether to participate in training based on the training conditions sent by the server, thereby reducing communication overhead and avoiding the disadvantage of requesting and then fetching tasks.

[0064] Please see Figure 5 This application provides a model training method applied to a client in an edge-cloud training system, wherein the edge-cloud training system further includes a server. The method includes:

[0065] S310: The main process of the client controls the virtual machine to train the model to be trained based on the target processing mode. The target processing mode is determined from multiple candidate processing modes, wherein the resources used for model training are different in different processing modes.

[0066] As one approach, the target processing mode includes a multi-process training mode. The step of controlling the virtual machine to train the model to be trained through the main process of the client based on the target processing mode includes: controlling the virtual machines corresponding to multiple sub-processes to train their respective parts to be trained through the main process of the client, wherein the parts to be trained are a part of the model to be trained.

[0067] S320: Obtain the training result data obtained after training the model.

[0068] S330: The main process of the client calls the functional component to upload the training result data to the server, so that the server can perform model aggregation based on the training result data to obtain the target model.

[0069] For example, such as Figure 6 As shown, the model training method involved in this embodiment can be applied to... Figure 6 In the scenario shown. For example... Figure 6 As shown, the client may include a federated training engine, which may include virtual machines. The number of virtual machines can be the same as the number of subprocesses used for model training, allowing each subprocess to be configured with an independent virtual machine.

[0070] The virtual machine (VM) internally includes a memory, a communicator, and a reporting device. Externally, it includes interfaces (components) for downloading and uploading files, long-connection communication components, and interfaces (components) for uploading data. The memory, communicator, and reporting device can be developed using Python code, while the interfaces for downloading and uploading files, long-connection communication components, and uploading data can be developed using Java or C++ code. This enables the VM to support bidirectional communication between its Python-based memory, communicator, and reporting device and the external Java or C++-based interfaces for downloading and uploading files, long-connection communication components, and uploading data.

[0071] The components, including the file download and upload interfaces, the long-connection communication component, and the data upload interface, can be dynamically plugged in and called. The long-connection communication component provides bidirectional long-connection communication. The file download and upload interfaces provide remote upload and download components and remote file upload and download functionality. The storage component provides the ability to store and retrieve files locally. The event tracking upload component provides real-time data reporting, storage, query, and cleanup functions. These components support calls from Python, Java, and C++ layers. Through foreground and background process communication, all calls ultimately reach the Java layer component implementation layer.

[0072] The filtering and aggregation services run on the server side.

[0073] The filtering service can be run by the filters described above, and the aggregation service can be run by the aggregator shown in the memory description above. The server-side filters ensure the uniformity of the electronic devices participating in training. For example, they can be used to count devices in several regions to ensure that the device concentration of devices participating in training in each region remains consistent, thereby improving fairness. Device concentration can be understood as the ratio of devices participating in training in a certain region to all devices in that region.

[0074] The federated training engine can also include a training center. The training center can perform server-side request filtering services, construct training data from native features and labels according to specific feature protocols, and return the model to the server-side aggregation service. During training, the training center can call functional components (e.g., download and upload file interfaces) to download and upload the model. When requesting filtering and aggregation services, it can call long-connection components; when uploading monitoring information, it can call the event tracking component (data upload interface). These components can be configured synchronously or asynchronously to ensure optimal download / upload, event tracking upload, and communication efficiency in different business scenarios.

[0075] The federated training engine may also include a sample center, which provides general sample storage, query and cleanup functions. The sample center provides read and write interfaces. The read interface supports reading the original detailed features and extended features of samples for specific scenarios from a dynamically configured database, and the write interface provides general sample writing and update functions.

[0076] The federated training engine may also include a feature center, which primarily provides capabilities for multiple modules (event aggregation module, event distribution module, and feature storage module). The event aggregation module provides user behavior aggregation functionality; the event distribution module forwards event sequences that conform to a certain pattern to the corresponding pipeline for feature computation; and the feature storage module provides feature storage and query capabilities.

[0077] This embodiment provides a model training method that, in situations where resources for model training differ across processing modes, can determine the desired target processing mode from multiple processing modes. This allows for model training based on the target processing mode, thereby improving the flexibility of the on-device training process. Furthermore, this embodiment not only allows for the configuration of multiple sub-processes to simultaneously train the model, but also enables the configuration of an independent virtual machine for each sub-process. This allows the training process for each sub-process to be performed within its corresponding virtual machine. Moreover, this embodiment also achieves decoupling between the main process, functional components, and virtual machines, improving the convenience of business iteration.

[0078] In this embodiment, after the target model is obtained through training, it can be applied. For example, the target model can be deployed on a server. Optionally, the target model can be a model for information push. In this case, the target model can push information to each client based on the user's reading preferences. Alternatively, the target model can be directly deployed on an electronic device and run directly there to recommend information to the user.

[0079] It should be noted that the interests of users of electronic devices may change with time or location. However, the target model deployed on the server may not be able to keep up with the interests of users of electronic devices in a timely manner, resulting in inaccurate information pushed to users of electronic devices. To improve this problem, as one approach, the method further includes:

[0080] The push notification information received from the server is used as a first recommendation result. Based on the first recommendation result, the user characteristics of the target user, and the target model, a second recommendation result is obtained, where the target user is the user of the electronic device on which the client is located. The second recommendation result is then displayed. In this approach, the obtained second recommendation result is more aligned with the user's current interests, which is beneficial for the recommended information to elicit a response from the user.

[0081] Optionally, the steps described above for obtaining the second recommendation result can be executed by the inference center in the federated training engine. The inference center is invoked after the client obtains the specific recommendation result (first recommendation result) from the server, and then performs a re-ranking decision on the first recommendation result. During the re-ranking process, the feature center and model center are invoked. The feature center performs event aggregation, feature calculation, and feature storage, while the model center obtains the latest model and loads it into the dynamically configured inference engine for re-ranking to obtain the second recommendation result.

[0082] Please see Figure 7 This application provides a model training device 400 that runs on a client side of an edge-cloud training system, which also includes a server side. The device 400 includes:

[0083] The model training unit 410 is used to train the model to be trained according to a target processing mode, wherein the target processing mode is determined from multiple candidate processing modes, and the resources used for model training are different in different processing modes.

[0084] The training result data acquisition unit 420 is used to acquire the training result data obtained after training the model.

[0085] The data communication unit 430 is used to upload the training result data to the server so that the server can perform model aggregation based on the training result data to obtain the target model.

[0086] In one manner, the model training unit 410 is also configured to obtain training conditions from the server; if it is determined that the electronic device where the client is located meets the training conditions, send a training request to the server; and receive the model to be trained returned by the server in response to the training request.

[0087] Optionally, the model training unit 410 is further configured to obtain the training conditions corresponding to the training task from the server. Based on the target processing mode and the training task, the model to be trained is then trained.

[0088] In one manner, the model training unit 410 is also used to obtain configuration information from the server; and to configure the model to be trained and / or functional components based on the configuration information, wherein the functional components include components used for data uploading and storage during model training.

[0089] As one method, the model training unit 410 is specifically used to control the virtual machine to train the model to be trained through the client's main process based on the target processing mode. The data communication unit 430 is specifically used to upload the training result data to the server by calling functional components through the client's main process.

[0090] Optionally, the target processing mode includes a multi-process training mode. The model training unit 410 is specifically used to control multiple sub-processes, each with its corresponding virtual machine, to train its respective training part, which is a portion of the model to be trained, through the main process of the client.

[0091] In one approach, the model training unit 410 is specifically used to respond to the training model corresponding to the current training session issued by the server, and to train the training model corresponding to the current training session according to the target processing mode. The training model corresponding to the current training session is obtained by the server by aggregating the models obtained from the previous training sessions of multiple clients.

[0092] As a way, such as Figure 8 As shown, the device 400 also includes:

[0093] The information display unit 440 is used to obtain the first recommendation result pushed by the server; based on the first recommendation result, the user characteristics of the target user and the target model, obtain the second recommendation result, wherein the target user is the user of the electronic device where the client is located; and display the second recommendation result.

[0094] It should be noted that the device embodiments in this application correspond to the aforementioned method embodiments. The specific principles in the device embodiments can be found in the content of the aforementioned method embodiments, and will not be repeated here.

[0095] The following will combine Figure 9 This application describes an electronic device.

[0096] Please see Figure 9Based on the aforementioned model training method and apparatus, this application embodiment also provides an electronic device 1000 capable of executing the aforementioned model training method. The electronic device 1000 includes one or more (only one shown in the figure) processors 105, a memory 104, an audio playback module 106, and an audio acquisition device 108 coupled together. The memory 104 stores programs capable of executing the contents of the aforementioned embodiments, and the processor 105 can execute the programs stored in the memory 104.

[0097] The processor 105 may include one or more processing cores. The processor 105 connects to various parts within the electronic device 1000 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and by calling data stored in the memory 104. Optionally, the processor 105 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 105 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 105 and may be implemented separately using a communication chip.

[0098] The memory 104 may include random access memory (RAM) or read-only memory (ROM). The memory 104 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below.

[0099] Furthermore, in addition to the aforementioned devices, the electronic device 1000 may also include a network module 110 and a sensor module 112.

[0100] The network module 110 is used to enable information interaction between the electronic device 1000 and other devices. For example, it can establish connections with other audio playback devices or other electronic devices and interact with information based on the established connections. As one approach, the network module 110 of the electronic device 1000 is a radio frequency (RF) module. This RF module is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby enabling communication with communication networks or other devices. The RF module may include various existing circuit elements used to perform these functions, such as antennas, RF transceivers, digital signal processors, encryption / decryption chips, SIM cards, memory, etc. For example, this RF module can interact with external devices through transmitted or received electromagnetic waves.

[0101] Sensor module 112 may include at least one sensor. Specifically, sensor module 112 may include, but is not limited to, pressure sensors, motion sensors, acceleration sensors, and other sensors.

[0102] The pressure sensor is a sensor that detects pressure generated by pressing on the electronic device 1000. That is, the pressure sensor detects pressure generated by contact or pressing between the user and the electronic device 1000, such as pressure generated by contact or pressing between the user's ear and the electronic device 1000. Therefore, the pressure sensor can be used to determine whether contact or pressing has occurred between the user and the electronic device 1000, and the magnitude of the pressure.

[0103] The accelerometer can detect the magnitude of acceleration in various directions (generally three axes), and when stationary, it can detect the magnitude and direction of gravity. It can be used for applications such as identifying the posture of the electronic device 1000 (e.g., screen orientation switching, related games, magnetometer posture calibration), and vibration recognition functions (e.g., pedometer, tapping). Additionally, the electronic device 1000 can also be equipped with other sensors such as a gyroscope, barometer, hygrometer, and thermometer, which will not be elaborated upon here.

[0104] The audio acquisition device 110 is used to acquire audio signals. Optionally, the audio acquisition device 110 includes multiple audio acquisition devices, which may be microphones.

[0105] Please refer to Figure 10 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0106] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.

[0107] In summary, the model training method, apparatus, and electronic device provided in this application, after training the model to be trained according to the target processing mode, can obtain the training result data obtained after the model training, and then upload the training result data to the server for the server to perform model aggregation based on the training result data to obtain the target model. Thus, even when the resources used for model training differ in different processing modes, the required target processing mode can be determined from multiple processing modes, and the model to be trained can be performed according to the target processing mode, thereby improving the flexibility of the edge training process.

[0108] This invention enhances the adaptability, flexibility, and efficiency of the end-side through multi-mode (multiple processing modes), dynamic configuration of multiple modules, and pluggable capability of multiple components, thereby improving the optimal efficiency of model training and aggregation in various business scenarios.

[0109] Furthermore, the client of this invention directly pulls the training task list, trains and aggregates it with the server, and adopts a unified distribution framework for uploading and downloading models. This can better ensure uniform sampling of devices, reduce communication overhead, and facilitate model updates, thus solving the shortcomings of existing similar products that require applying for tasks before pulling them.

[0110] Furthermore, this invention employs a multi-layered, multi-threaded concurrent training task on the client side, enhancing client-side utilization while ensuring independence, privacy, and fairness between tasks, and between recommendation and training. The multi-layered processing also guarantees code security, efficiency, and ease of iteration.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A model training method, characterized in that, The method is applied to a client in an edge-cloud training system, which also includes a server, wherein the client runs on an electronic device used by a user. The training conditions are obtained from the server, and the training conditions are the constraints for participating in this model training. If it is determined that the electronic device where the client is located meets the training conditions, a training request is sent to the server, and the server returns the model to be trained in response to the training request. The model to be trained is trained according to the target processing mode, which is determined by the client from multiple candidate processing modes. The target processing mode is determined by the client based on the needs of the current model training or the client's local configuration. In different processing modes, the resources used for model training are different, including the number of training processes. Obtain the training result data obtained after training the model; The training result data is uploaded to the server so that the server can perform model aggregation based on the training result data to obtain the target model.

2. The method according to claim 1, characterized in that, The step of obtaining training conditions from the server includes: Obtain the training conditions corresponding to the training task from the server; The step of training the model to be trained according to the target processing mode includes: Based on the target processing mode and the training task, the model to be trained is trained.

3. The method according to claim 1, characterized in that, Before training the model to be trained according to the target processing mode, the following steps are also included: Obtain configuration information from the server; The configuration information is used to configure the model to be trained and / or functional components, including components used for data uploading and storage during model training.

4. The method according to claim 1, characterized in that, The step of training the model to be trained according to the target processing mode includes: The client's main process controls the virtual machine to train the model to be trained based on the target processing mode. Uploading the training result data to the server includes: The training result data is uploaded to the server by calling the functional component through the main process of the client.

5. The method according to claim 4, characterized in that, The target processing mode includes a multi-process training mode. The step of controlling the virtual machine to train the model to be trained based on the target processing mode, through the client's main process, includes: The main process of the client controls multiple subprocesses, each corresponding to a virtual machine, to train their respective parts to be trained, where the parts to be trained are a portion of the model to be trained.

6. The method according to claim 1, characterized in that, The step of training the model to be trained according to the target processing mode includes: In response to the training model corresponding to the current training session issued by the server, the training model corresponding to the current training session is trained according to the target processing mode. The training model corresponding to the current training session is obtained by the server by aggregating the models obtained from the previous training sessions of multiple clients.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the first recommendation result pushed by the server; Based on the first recommendation result, the user characteristics of the target user, and the target model, a second recommendation result is obtained, wherein the target user is the user of the electronic device where the client is located; The second recommendation result is displayed.

8. A model training device, characterized in that, The client running on the edge-cloud training system includes a server, and the client runs on an electronic device used by the user. The device includes: The model training unit is used to obtain training conditions from the server, the training conditions being the constraints for participating in this model training; if it is determined that the electronic device where the client is located meets the training conditions, it sends a training request to the server and receives the model to be trained returned by the server in response to the training request; The model training unit is further configured to train the model to be trained according to a target processing mode. The target processing mode is determined by the client from multiple candidate processing modes. The target processing mode is determined by the client according to the needs of the current model training or the client's local configuration. In different processing modes, the resources used for model training are different, including the process used for training. The training result data acquisition unit is used to acquire the training result data obtained after training the model. A data communication unit is used to upload the training result data to the server so that the server can perform model aggregation based on the training result data to obtain the target model.

9. An electronic device, characterized in that, It includes a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code, wherein the program code, when executed by a processor, performs the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Model processing method and device, electronic equipment and storage medium

    CN113065843A

  • AI model training method and device, computing equipment and storage medium

    CN114154641A

  • End-cloud cooperation system, distributed processing cluster and mobile end device

    CN114884832A

  • Privacy preserving cooperative learning in untrusted environments

    US20220300618A1