Task processing method, and electronic device and readable storage medium
By allocating tasks based on task attribute information in multi-device collaborative scenarios, the problem of inefficient resource utilization in existing technologies is solved, and resource optimization for multi-device collaboration is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-05-28
- Publication Date
- 2026-04-30
AI Technical Summary
Existing multi-device collaboration technologies cannot effectively reduce the processing overhead of electronic devices when handling tasks such as downloading, copying, algorithm calculation, data acquisition, data compression, model inference, and UI display, resulting in the inefficient use of resources.
In multi-device collaborative scenarios, large-granularity tasks can be assigned to other electronic devices for processing or left for local processing based on task attribute information, and task processing results can be obtained, thereby achieving rational utilization of resources through the elastic task service center.
It reduces the processing overhead of a single electronic device handling multiple large-granularity tasks, and enables the rational utilization of resources through multi-device collaboration.
Smart Images

Figure CN2025097810_30042026_PF_FP_ABST
Abstract
Description
Task processing methods, electronic devices, and readable storage media
[0001] This application claims priority to Chinese Patent Application No. 202411488326.3, filed on October 23, 2024, entitled “Task Processing Method, Electronic Device and Readable Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, and in particular to a task processing method, electronic device, and readable storage medium. Background Technology
[0003] Current multi-device collaboration technologies generally implement one or more collaborative functions through a specific application. For example, Figure 1 illustrates one such scenario. After the smartwatch 10 and the mobile phone 20 establish a communication connection via Bluetooth, collaborative functions can be achieved. For instance, the smartwatch 10 can synchronize to-do items 01 and 02 to the mobile phone via its calendar application. As another example, Figure 2 illustrates another multi-device collaboration scenario. After the mobile phone 20 and the smart screen 30 establish a communication connection via Bluetooth, collaborative functions can be achieved. For instance, the mobile phone 20 can project display content 03 onto the smart screen 30 for synchronized display.
[0004] It can be seen that current multi-device collaboration functions mainly achieve simple collaboration through different applications, such as synchronizing to-do items through calendar applications and displaying screens through screen mirroring applications. However, for some tasks on electronic devices, such as downloading, copying, algorithm calculation, data acquisition, data compression, model inference, and user interface (UI) display, multi-device collaboration cannot reduce the processing overhead of electronic devices or achieve reasonable resource utilization. Summary of the Invention
[0005] To address the aforementioned issues, embodiments of this application provide a task processing method, an electronic device, and a readable storage medium.
[0006] In a first aspect, this application provides a task processing method applied to a first electronic device. The method includes: establishing a communication connection between the first electronic device and a second electronic device; responding to a first operation, the first operation being used to instruct multiple devices to collaboratively execute a first task, the first task including a first subtask and a second subtask, wherein the multiple devices include the first electronic device and the second electronic device; the first electronic device executing the first subtask; assigning the second subtask to the second electronic device for execution based on the attribute information of the second subtask; and obtaining the task processing result of the second subtask.
[0007] In some embodiments, the first electronic device may refer to the master device mentioned in this application, and the second electronic device may refer to the slave device mentioned in this application.
[0008] It is understood that the first task can refer to a task that requires at least one single thread, and a task that requires at least one single thread can be called a large-granularity task. In some embodiments, the first task may include multiple subtasks, and one or more of these subtasks are tasks that require a single thread, which is not limited here. Furthermore, in other embodiments, if the first task does not include subtasks, then the first task is a task that requires a single thread.
[0009] It is understandable that the first and second subtasks can be processed in parallel, and this is not a limitation here.
[0010] In some embodiments, the first electronic device may refer to the smartwatch 10 mentioned in this application, the second electronic device may refer to the mobile phone 20 or tablet computer 60 mentioned in the embodiments of this application, the first task may refer to navigating from the initial position to the target position Q mentioned in the embodiments of this application, the first subtask may refer to collecting the initial position mentioned in the embodiments of this application, the second subtask may refer to planning the navigation route from the initial position to the target position Q mentioned in the embodiments of this application, or the second subtask may refer to downloading the offline map of the area where the target position Q is located mentioned in the embodiments of this application, without limitation.
[0011] Based on the above method, in multi-device collaboration scenarios, for one or more large-granularity tasks in an application, electronic devices can allocate each large-granularity task to other electronic devices for processing or process it locally, based on the attribute information of each large-granularity task, and obtain the task processing result of each large-granularity task separately. In this way, the processing overhead incurred by a single electronic device processing multiple large-granularity tasks can be reduced through multi-device collaboration, achieving rational resource utilization in multi-device collaboration.
[0012] In one possible implementation of the first aspect above, the attribute information includes at least one of the following: the device processing type adapted to the task, task limitations, the connection types supported by the task, the application name of the application to which the task belongs, the task identifier, the task type, and the expected goal of the task; the task type includes at least one of the following: download, copy, algorithm calculation, data acquisition, data compression, model inference, and UI display; the device processing type adapted to the task includes at least one of the following: calculation, control, download, machine learning, model running, big data analysis, data processing, virtual reality, signal processing, and web page running; the task limitations include at least one of the following: limitations on task processing latency and limitations on the device performance for processing the task; the connection types supported by the task include at least one of the following: local connection, wired connection type, and wireless connection type, wherein the wired connection type includes at least one of Universal Serial Bus and High Definition Multimedia Interface, and the wireless connection type includes at least one of Wi-Fi, Bluetooth, Bluetooth Low Energy, cellular network, Zifeng, and Xingshen.
[0013] In one possible implementation of the first aspect above, the method further includes: determining the first subtask as a first task type based on the attribute information of the first subtask, and determining the second subtask as a second task type based on the attribute information of the second subtask; wherein the first task type and the second task type are different, and both the first task type and the second task type are used to indicate that the task needs to be executed based on at least one single thread.
[0014] In one possible implementation of the first aspect above, the first task is a task in a first application within a first electronic device, the first application including a navigation application; the first task includes navigating from an initial position of the first electronic device to a target position, the first sub-task includes obtaining the initial position of the first electronic device, and the second sub-task includes planning a route from the initial position of the first electronic device to the target position.
[0015] In one possible implementation of the first aspect above, the first electronic device performs a first subtask, including: obtaining attribute information of the first subtask, the attribute information of the first subtask including at least one of the electronic device processing type adapted to the first subtask, task restrictions, and supported connection types; determining that the first electronic device performs the first subtask based on at least one of the attribute information of the electronic device processing type adapted to the first subtask, task restrictions, and supported connection types; wherein the connection types supported by the first subtask include local connections.
[0016] It is understood that in some embodiments, when the first electronic device determines that the first subtask can be executed by multiple electronic devices including the first electronic device based on the electronic device processing type and task restrictions adapted to the first subtask, it can further determine that the first subtask is executed locally, i.e., by the first electronic device, based on the connection type supported by the first subtask being a local connection.
[0017] In one possible implementation of the first aspect above, assigning the second subtask to a second electronic device for execution based on the attribute information of the second subtask includes: obtaining the attribute information of the second subtask, the attribute information of the second subtask including at least one of the electronic device processing type adapted to the second subtask, task restrictions, and supported connection types; determining, based on the attribute information of at least one of the electronic device processing type adapted to the second subtask, task restrictions, and supported connection types, that the devices capable of executing the second subtask include the first electronic device and the second electronic device; assigning the second subtask to the second electronic device for execution based on the task restrictions of the second subtask, wherein, corresponding to the task restrictions of the second subtask, the second electronic device has a higher priority than the first electronic device; and sending a task processing request corresponding to the second subtask to the second electronic device.
[0018] In some embodiments of this application, when the first electronic device determines that the second subtask can be executed by the first electronic device and the second electronic device based on the electronic device processing type and supported connection type adapted to the second subtask, the priority of the first electronic device and the second electronic device can be further determined based on the task restrictions of the second subtask (such as completing the task within a preset time period). For example, the higher the computing power, the higher the priority. The second subtask is then processed based on the second electronic device with the higher priority. This is not limited here.
[0019] In other embodiments, the electronic devices that can perform the second subtask, determined based on the attribute information of the second subtask, may also include other electronic devices besides the first and second electronic devices. When prioritizing based on the task restrictions of the second subtask, they may be among other electronic devices with higher priority than the second electronic device, which is not limited here.
[0020] In one possible implementation of the first aspect described above, the task processing result of the second subtask comes from the second electronic device.
[0021] In some embodiments, when the second electronic device receives a task processing request corresponding to the second subtask, the second electronic device may decide to execute the second subtask based on its own computing resources, memory, storage space or battery life, etc., so as to obtain the task processing result of the second subtask.
[0022] In one possible implementation of the first aspect above, after sending a task processing request corresponding to the second subtask to the second electronic device, the method further includes: receiving a rejection response from the second electronic device.
[0023] In some embodiments, when the second electronic device receives a task processing request corresponding to the second subtask, the second electronic device may decide not to execute the second subtask based on its actual computing resources, memory, storage space, or battery life, so as to avoid the second subtask being unable to complete efficiently, thus preventing the completion of the first task.
[0024] In one possible implementation of the first aspect above, the multiple devices further include a third electronic device, and the method further includes: assigning the second subtask to the third electronic device for execution.
[0025] In some embodiments, if the second electronic device refuses to process the second subtask, the first subtask can be reassigned to the third electronic device based on the attribute information of the second subtask, thus flexibly utilizing multi-device collaboration to process the task.
[0026] In one possible implementation of the first aspect above, the method further includes: the first electronic device performing a second subtask.
[0027] In some embodiments, when the first electronic device cannot assign the second electronic device to other electronic devices for execution, the first electronic device can execute a second subtask to ensure that the second subtask can be completed, thereby ensuring the completion of the first task.
[0028] In one possible implementation of the first aspect above, the method further includes: receiving a second task sent by a second electronic device via a communication connection, wherein attribute information of the second task is used to instruct the first electronic device to perform the second task; and performing the second task.
[0029] In some embodiments, when the first electronic device and the second electronic device establish a communication connection, the first electronic device can not only assign tasks to the second electronic device, but also receive tasks assigned to the first electronic device by the second electronic device. The two electronic devices can transmit data based on the same communication channel, saving communication resources.
[0030] Secondly, this application provides a task processing method, the method comprising: establishing a communication connection between a first electronic device and a second electronic device; the first electronic device responding to a first operation, the first operation being used to instruct multiple devices to collaboratively execute a first task, the first task including a first sub-task and a second sub-task; the first electronic device executing the first sub-task; the first electronic device assigning the second sub-task to the second electronic device for execution based on the attribute information of the second sub-task; the second electronic device executing the second sub-task and sending the task processing result of the second sub-task to the first electronic device; and the first electronic device obtaining the task processing result of the second sub-task.
[0031] Thirdly, embodiments of this application provide an electronic device, including a memory for storing instructions; and a processor for executing the instructions to implement the task processing method provided by the first aspect and various possible implementations of the first aspect.
[0032] Fourthly, embodiments of this application provide a readable storage medium storing instructions that, when executed on an electronic device, cause a terminal device to perform the task processing method provided in the first aspect and various possible implementations of the first aspect.
[0033] Fifthly, embodiments of this application also provide a computer program product, including a computer program / instruction that, when executed by a processor, implements the task processing method provided by the first aspect and various possible implementations of the first aspect.
[0034] The beneficial effects of the third to fifth aspects mentioned above can be referred to the relevant descriptions in the first aspect and various possible implementations of the first aspect, which will not be repeated here. Attached Figure Description
[0035] Figure 1 illustrates a multi-device collaborative scenario according to an embodiment of this application;
[0036] Figure 2 illustrates another multi-device collaboration scenario according to an embodiment of this application;
[0037] Figure 3A illustrates a scenario of establishing a communication connection between multiple electronic devices according to an embodiment of this application;
[0038] Figure 3B shows a schematic diagram of a mobile phone interface according to an embodiment of this application;
[0039] Figure 4, according to an embodiment of this application, illustrates a scenario in which a master device assigns tasks from application A to other slave devices;
[0040] Figure 5A shows a schematic diagram of how a smartwatch 10 assigns different tasks to itself, according to an embodiment of this application.
[0041] Figure 5B, according to an embodiment of this application, shows a schematic diagram of an electronic device corresponding to the assignment of different tasks in a sharing application on a mobile phone 20.
[0042] Figure 5C, according to an embodiment of this application, shows a schematic diagram of an electronic device corresponding to different task assignments in a wireless screen projection application on a mobile phone 20.
[0043] Figure 6A shows a flowchart of a task processing method according to an embodiment of this application;
[0044] Figure 6B illustrates a flowchart of another task processing method according to an embodiment of this application;
[0045] Figure 7 illustrates an interactive flowchart of a task processing method according to an embodiment of this application;
[0046] Figure 8 illustrates a schematic diagram of sending or receiving task processing requests between different electronic devices based on the same communication session in a multi-device collaborative scenario, according to an embodiment of this application.
[0047] Figure 9 shows a schematic block diagram of the software structure of a distributed operating system according to an embodiment of this application;
[0048] Figure 10 shows a schematic diagram of the structure of a flexible task processing device according to an embodiment of this application;
[0049] Figure 11 shows a schematic diagram of a chip structure according to an embodiment of this application;
[0050] Figure 12 shows a schematic diagram of the structure of an electronic device 100 according to an embodiment of this application. Detailed Implementation
[0051] The illustrative embodiments of this application include, but are not limited to, a task processing method, an electronic device, and a readable storage medium.
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be described clearly and in detail below with reference to the accompanying drawings.
[0053] It is understood that the electronic devices in the embodiments of this application may also be referred to as terminals, user terminals, mobile terminals, user equipment (UE), terminal devices, mobile stations (MS), mobile terminals (MT), etc. Terminal devices may include mobile phones, smart TVs, wearable devices, tablets, computers, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, terminals in industrial control, terminals in self-driving vehicles, terminals in smart grids, terminals in transportation safety, terminals in smart cities, and smart homes in smart homes, etc.
[0054] It is understood that electronic devices in this application embodiment can establish communication connections using various communication connection methods (i.e., connection types), including but not limited to wireless fidelity (Wi-Fi), Bluetooth (BT), Bluetooth Low Energy (BLE), near field communication (NFC) technology, mobile communication technologies such as 2G, 3G, 4G and 5G that allow electronic devices to communicate through cellular networks, Zigbee, Near Link, and wired connection communication methods such as universal serial bus (USB), high definition multimedia interface (HDMI), and video graphics array (VGA), which are not limited here.
[0055] It is understood that the multi-device collaboration scenarios shown in Figures 1 and 2 above are exemplified by two electronic devices collaborating. In some embodiments of this application, the multi-device collaboration scenario may also include more than two electronic devices, which is not limited here.
[0056] For example, Figure 3A illustrates a scenario where multiple electronic devices establish a communication connection. As shown in Figure 3A, a smartwatch 10, a mobile phone 20, a smart screen 30, a smart speaker 50, and a tablet computer 60 form a device group, and each electronic device within this group can communicate with each other. For instance, when a user logs into the mobile phone 20, tablet computer 20, smart screen 30, and smart speaker 50 within the device group shown in Figure 3A using the same user account, the smartwatch 10, mobile phone 20, smart screen 30, smart speaker 50, and tablet computer 60 can establish communication connections based on different connection types.
[0057] For example, Figure 3B shows a schematic diagram of the interface of a mobile phone 20. As shown in Figure 3B, after establishing a communication connection between the mobile phone 20 and electronic devices such as the smartwatch 10, smart screen 30, smart speaker 50, and tablet computer 60 in Figure 3A using connection types such as Wi-Fi and Bluetooth, one or more electronic devices can be selected for collaboration in the drop-down interface 301 corresponding to the control center of the mobile phone 20, in the display control 302 corresponding to the "Multi-device control center" function. These include, but are not limited to, smart screens, tablet computers, watches, and smart speakers.
[0058] As mentioned earlier, current multi-device collaboration functions mainly achieve simple collaboration through different applications, such as synchronizing to-do items through calendar applications and screen mirroring through screen mirroring applications. However, for some tasks on electronic devices, such as downloading, copying, algorithm calculation, data acquisition, data compression, model inference, and UI display, multi-device collaboration cannot reduce the processing overhead of electronic devices or achieve reasonable resource utilization.
[0059] For example, a smartwatch's navigation application needs to execute multiple sub-tasks to complete the task of navigating from an initial location to a target location Q. These sub-tasks may include: collecting the initial location, planning the navigation route from the initial location to the target location Q, and downloading an offline map of the area where the target location Q is located, etc., without further limitation.
[0060] It is understandable that the task of navigating from the initial position to the target position Q, and its three corresponding subtasks, are all large-granularity tasks. A large-granularity task is one that requires at least one single thread. Each task, independently occupying a single thread, can be processed in parallel without waiting for other threads to complete.
[0061] For example, large-granularity tasks include, but are not limited to: algorithm computation, image processing, data download, data acquisition, data copying, data compression, model inference, webpage execution, and UI display.
[0062] It's understandable that the three subtasks mentioned above correspond to different task types. For example, collecting the initial location is a data collection task, planning the route from the initial location to the target location Q is an algorithm task, and downloading the offline map of the area where the target location Q is located is a download task.
[0063] To address this, this application provides a task processing method in which attribute information for different tasks within different applications can be predefined. When an electronic device executes a task within an application, based on the fact that the task is a large-granularity task, it can be assigned to other electronic devices for processing according to the predefined attribute information of the task, and the corresponding task processing result can be obtained.
[0064] It is understood that the predefined attribute information of a task may include any one or more of the following: the electronic device processing type to which the task is adapted, task limitations, the connection types supported by the task, the application name of the application to which the task belongs, the task identifier, the task type, the expected goal, etc., without any limitation here.
[0065] In some embodiments of this application, a task in the application can be a large-granularity task, and this large-granularity task can include multiple subtasks, and the multiple subtasks are also large-granularity tasks. Based on this, the electronic device can assign each subtask to a corresponding electronic device for processing according to predefined attribute information of each subtask.
[0066] It is understandable that an electronic device can determine whether to assign a task to another electronic device for processing or to execute the task locally based on the task's attribute information. Furthermore, if a task includes multiple subtasks, the electronic device can assign some subtasks to other electronic devices for processing and leave the other subtasks for local processing based on the attribute information of each subtask; this is not limited to any particular subtask.
[0067] It is understood that the task-based attribute information refers to the processing type of the electronic device adapted to the task. This processing type can be any of the following: computational, control, large-scale, signal processing, machine learning, browser, or download, without limitation. The task-based attribute information also refers to task limitations, which can be at least one of the following: task processing latency or device performance, without limitation. Furthermore, the task-based attribute information refers to the connection types supported by the task, which can be at least one of the following: wireless, wired, or local connection, without limitation. Finally, the task-based attribute information refers to the task type, which can be any of the following: algorithm computation, image processing, data download, data acquisition, data copying, data compression, model inference, UI display, etc., without limitation.
[0068] Based on the above method, in multi-device collaboration scenarios, for one or more large-granularity tasks in an application, electronic devices can allocate each large-granularity task to other electronic devices for processing or process it locally, based on the attribute information of each large-granularity task, and obtain the task processing result corresponding to each large-granularity task. After other electronic devices complete their respective tasks, the first electronic device can obtain the task processing result through open callback functions or other methods. In this way, the processing overhead caused by a single electronic device processing multiple tasks can be reduced through multi-device collaboration, achieving rational utilization of resources in multi-device collaboration.
[0069] It is understood that the task processing method provided in the embodiments of this application can be implemented by the system service "ResilientTask ServiceCenter" in the electronic device. The ResilientTask ServiceCenter can assign different tasks to different electronic devices for processing according to the attribute information of different tasks in the electronic device.
[0070] It is understood that the applications in the electronic devices mentioned in this application can be system applications of the electronic devices or third-party applications, and no limitation is made here.
[0071] In some embodiments of this application, the first electronic device can determine other electronic devices capable of performing a task based on the task's attribute information. Specifically, the electronic devices capable of processing the task can be determined based on the task's attribute information, including the task's processing type, task limitations, and supported connection types. Furthermore, multiple electronic devices can be determined based on the task's attribute information, such as a second and a third electronic device. Based on this, the second and third electronic devices can be prioritized according to the task limitations in the task attribute information, and the task can be preferentially assigned to the higher-priority electronic device for processing.
[0072] For example, suppose the task is limited to completion within a preset time. It's understood that the shorter the time required for an electronic device to process the task, the higher its computing power. Therefore, based on the task limitation of completing within a preset time, the first electronic device can prioritize the second and third electronic devices according to their respective computing power. Assuming the second electronic device has a higher computing power than the third electronic device, the first electronic device can assign the task to the second electronic device for processing.
[0073] To facilitate understanding, we will first introduce the task's attribute information. For example, Table 1 shows the task attribute information that can be predefined.
[0074] Table 1
[0075] Referring to Table 1, as an example, the attribute information included in each task may include: the application name of the application to which the task belongs, "serviceUuid", the task identifier, "taskId", the task type, "taskType", the connection type, "linkType", the expected target of the task, "target", the processing type of the adapted electronic device, "preferredSystem", the task limitation type, and the open callback function, "Callback". Furthermore, different values can be assigned to different attribute information for different tasks to represent their different attributes. The assigned values can be of different numeric types, such as integers (dc_int) or unsigned 8-bit integers (dc_u8), etc., without limitation.
[0076] It is understandable that the attribute information of the tasks in Table 1 above can be predefined using a structure. For example, a structure variable can be defined as the resilient task representation, i.e., ResilientTask, indicating that this structure is used to define different attribute information for different tasks.
[0077] For example, the structure can be:
[0078] In the above structure:
[0079] The "serviceUuid" indicates the name of the application to which the task belongs. For example, a value of 1 can be assigned to indicate that the application is a navigation application. The "taskId" is assigned to the task identifier. For example, a value of 101 can be assigned to indicate that the task identifier is planning navigation routes.
[0080] The "taskType" indicates the task type. For example, a value of 3 can be assigned to indicate that the task type is an algorithm task. It is understood that in some other embodiments, the task type includes, but is not limited to, large-granularity tasks such as downloading, copying, algorithm calculation, image processing, data acquisition, data compression, model inference, and UI display. In addition, for other tasks that are not large-granularity tasks, the value "Unknown" can be assigned when defining the task type to indicate that the task is a non-large-granularity task.
[0081] The "linkType" parameter indicates the connection types that the task can support. For example, a value of 1 can be assigned to indicate that the task supports Wi-Fi. It can be understood that the task can define one or more connection types to support, including wireless or wired connections.
[0082] The "target" parameter indicates the expected goal of the task. For example, a value of 5 could be assigned to represent the expected goal as obtaining a navigation route. It is understood that different values can be assigned to represent different expected goals for different tasks; this is not limited here.
[0083] The term "preferredSystem" indicates the type of electronic device processing adapted to the task. For example, a value of 3 can be assigned to represent a computing-type electronic device adapted to the task. It is understood that in other embodiments, the type of electronic device processing adapted to the task may include, but is not limited to, computing, control, downloading, machine learning, model running, big data analysis, virtual reality, signal processing, web page running, etc.
[0084] The "limitType" indicates the type of task restriction corresponding to the task. For example, a value of 0 can be assigned to indicate that there is no task restriction. In addition, in some other embodiments of this application, the type of task restriction may include time restriction, number of attempts restriction, resource restriction, electronic device performance restriction (such as processing speed), electronic device power restriction, etc., which are not limited here.
[0085] The "limitValue" indicates the specific requirements for the "limitType" of the task restriction. For example, if the task restriction type is a time limit, its corresponding "limitValue" can be assigned a value of 3, indicating that the task needs to be completed within a preset duration of 3 seconds. As another example, if the task restriction type is the processing performance of an electronic device, its corresponding "limitValue" can be assigned a value of 10, indicating that the bandwidth of the electronic device processing the task needs to reach a preset bandwidth threshold of 10Mbps, etc., without further limitation.
[0086] It is understood that the attribute information for each task listed above may include at least the electronic device processing type adapted to the task, task limitations, and the connection types supported by the task. In some other embodiments, each task may also include other attribute information, such as the application name of the application to which the task belongs, the task identifier, the task type, the expected goal of the task, and open callback functions, etc., which are not limited here.
[0087] It is understood that the assignment of values to each attribute information according to the corresponding data type and numerical value listed in Table 1 is merely an illustrative example. In other embodiments of this application, different attribute information may be assigned values according to data types and numerical values different from those in Table 1, which is not limited here.
[0088] Secondly, for ease of understanding, the device information in the embodiments of this application is introduced.
[0089] In the embodiments of this application, each electronic device can obtain device information of other electronic devices that have established a communication connection with it or can establish a connection with it, including but not limited to: device name, supported connection types, clock speed, battery level, device processing type, device power consumption sensitivity, and may also include cache capacity, memory capacity, bandwidth (i.e., data transmission rate), etc., which are not limited here. The device processing type may include, but is not limited to, computation, control, downloading, machine learning, model running, big data analysis, virtual reality, signal processing, web page running, etc.
[0090] The following section, combining the task attribute information and device information mentioned above, explains how to match different electronic devices that can handle different tasks based on the task attribute information and the device information of the electronic devices that can handle the tasks.
[0091] It is understood that the electronic device in the embodiments of this application can act as both a master device and a slave device. Furthermore, the master device can either assign tasks to other slave devices for processing or receive tasks from other slave devices and process them.
[0092] For example, Figure 4 shows a schematic diagram of a master device assigning tasks from application A to other slave devices.
[0093] As shown in Figure 4, taking mobile phone 40 as the master device, application A in mobile phone 40 can include multiple tasks, namely Task1, Task2, Task3, Task4, Task(n-1), and Tasks ~ n. The attribute information of each task can be different or the same. Figure 4 also includes slave devices that establish communication connections with mobile phone 40, namely mobile phones 41, 42, 43, 44, 45, and 46.
[0094] In some embodiments of this application, the mobile phone 40 can allocate Task1, Task2, Task3, Task4, and Task(n-1), Task~n to different electronic devices for processing based on the attribute information of Task1, Task2, Task3, Task4, and Task(n-1), Task~n respectively, such as the electronic device processing type, task restrictions, and connection type supported by the task in their respective attribute information.
[0095] For example, mobile phone 40 assigns Task1 to mobile phone 41 for processing based on the attribute information of Task1. Similarly, mobile phone 40 can assign Task2 to mobile phone 42 for processing based on the attribute information of Task2, assign Task3 to mobile phone 43 for processing based on the attribute information of Task3, assign Task(n-1) to mobile phone 45 for processing based on the attribute information of Task(n-1), and assign Tasks to n to mobile phone 46 for processing based on the attribute information of Tasks to n.
[0096] Furthermore, after determining the electronic devices responsible for processing Task1, Task2, Task3, Task4, and Task(n-1), Tasks ~ n based on the mobile phone 40, the mobile phone 40 can send the task flows corresponding to Task1, Task2, Task3, Task4, and Task(n-1), Tasks ~ n to the corresponding electronic devices for processing via the application programming interface (API). Once Task1, Task2, Task3, Task4, and Task(n-1), Tasks ~ n have been processed, the task flow management service in the mobile phone 40 can detect that Task1, Task2, Task3, Task4, and Task(n-1), Tasks ~ n have been completed. It can then obtain the task processing results of Task1, Task2, Task3, Task4, and Task(n-1), Tasks ~ n through open callback functions, which are not limited here.
[0097] In other embodiments of this application, the mobile phone 40 can allocate Tasks 5 to Task (n-2) for local processing based on their respective attribute information, such as the electronic device processing type, task limitations, and supported connection types. That is, the mobile phone 40 processes Tasks 5 to Task (n-2). Furthermore, after the mobile phone 40 completes processing Tasks 5 to Task (n-2), it can directly obtain the task processing results for those tasks.
[0098] It is understood that in the embodiments of this application, the tasks assigned by the electronic device may come from the same application in the electronic device or from different applications in the electronic device, and this is not limited thereto. The following is a detailed description based on different embodiments.
[0099] In some embodiments of this application, an application of an electronic device implements a task, which requires the execution of multiple subtasks. The electronic device can then allocate each subtask to different electronic devices for processing based on the attribute information of each subtask.
[0100] For example, Figure 5A shows a schematic diagram of a smartwatch 10 assigning different subtasks in a navigation application to different electronic devices for processing.
[0101] As shown in Figure 5A, the navigation application of smartwatch 10 needs to handle the task of navigating from the initial location to the target location Q, which is a large-granularity task. To achieve this large-granularity task, the navigation application of smartwatch 10 also needs to perform three sub-tasks: planning the navigation route from the initial location to the target location Q, downloading an offline map of the area where the target location Q is located, and collecting the initial location. These three sub-tasks are also large-granularity tasks. Based on this, smartwatch 10 can assign these three sub-tasks to other electronic devices for processing according to the predefined attribute information of these three sub-tasks.
[0102] Specifically:
[0103] In some embodiments, the smartwatch 10 can obtain attribute information and corresponding values for the subtask "planning a navigation route from the initial location to the target location Q". For example, the attribute information of this subtask includes: the electronic device processing type adapted to the task, task limitations, and the connection types supported by the task. Specifically, the value for the electronic device processing type adapted to the subtask is 3, indicating that the electronic device processing is computational. The value for "limitType" corresponding to the task limitation is 1, indicating that the task limitation type is processing latency, and the value for "limitValue" corresponding to the task limitation is 3, indicating that it needs to be completed within 3 seconds. The value for the connection types supported by the subtask is 1, indicating that the subtask supports wireless connections. Furthermore, based on the attribute information of this subtask, the smartwatch 10 determines to assign the subtask to the mobile phone 20 for processing. A wireless communication connection has been established between the mobile phone 20 and the smartwatch 10, and the device processing type of the mobile phone 20 is computational, meaning the mobile phone 20 can complete the subtask within 3 seconds.
[0104] It is understandable that in other scenarios, based on the attribute information of the subtask "planning a navigation route from the initial position to the target location Q," the smartwatch 10 can determine that both the mobile phone 20 and the tablet computer 60 are capable of handling this subtask. Based on this, the smartwatch 10 can determine the priority of the mobile phone 20 and the tablet computer 60 according to the task constraints of this subtask. For example, if the task constraint is to complete the task within 3 seconds, it indicates that the subtask requires an electronic device capable of processing it quickly; generally, the higher the computing power of the electronic device, the shorter the processing time. Therefore, the smartwatch 10 can determine the electronic device to execute the subtask based on the computing power of the mobile phone 20 and the tablet computer 60. Assuming that the computing power of the mobile phone 20 is higher than that of the tablet computer 60, i.e., the priority of the mobile phone 20 is higher than that of the tablet computer 60, the smartwatch 10 can assign the subtask to the mobile phone 20 for processing.
[0105] In some embodiments, the smartwatch 10 can obtain the attribute information and corresponding values of the subtask "downloading an offline map of the area where the target location Q is located". For example, the attribute information of this subtask includes: the electronic device processing type adapted to the task, task limitations, and the connection types supported by the task. Specifically, the value for the electronic device processing type adapted to the subtask is 2, indicating that the adapted electronic device processing is download-type. The value for "limitType" corresponding to the task limitations is 2, indicating that the task limitation type is processing power consumption, and the value for "limitValue" corresponding to the task limitations is 0, indicating that the device is not sensitive to power consumption. The value for the connection types supported by the subtask is 1, indicating that the subtask supports wireless connections. Furthermore, based on the attribute information of this subtask, the smartwatch 10 determines to assign the subtask to the tablet computer 60 for processing. A wireless communication connection has been established between the tablet computer 60 and the smartwatch 10, and the device processing type of the tablet computer 60 is download-type. The tablet computer 60 is not sensitive to power consumption, meaning it has no specific power consumption limitations and can handle relatively high operating power consumption.
[0106] In some embodiments, the smartwatch 10 can obtain the attribute information and corresponding values of the subtask "collecting the initial location". For example, the attribute information of this subtask includes: the electronic device processing type adapted to the task, task restrictions, and the connection types supported by the task. Specifically, the value for the electronic device processing type adapted to the subtask is 3, indicating that the electronic device processing adapted to the subtask is data acquisition type. The value for "limitType" corresponding to the task restrictions is 0, indicating that the task restriction type is no task restriction. The value for the connection types supported by the subtask is 0, indicating that the connection types supported by the subtask include local connections. Furthermore, based on the attribute information of the subtask, the smartwatch 10 determines that the subtask will be processed locally, i.e., by the smartwatch 10 itself. The device processing type of the smartwatch 10 is data acquisition type.
[0107] In some embodiments of this application, the same application on an electronic device needs to handle different large-granularity tasks in different scenarios. Therefore, the electronic device can allocate tasks to different electronic devices for processing based on the task attribute information within the application, depending on the specific scenario.
[0108] For example, Figure 5B shows a schematic diagram of a mobile phone 20 assigning different tasks in a wireless screen mirroring application to different electronic devices for processing.
[0109] As shown in Figure 5B, in some scenarios, the wireless screen mirroring application of mobile phone 20 can detect that the user is preparing to mirror a video conference; in other scenarios, it can detect that the user is preparing to mirror a local photo album; furthermore, in some scenarios, it can detect that the user is preparing to mirror a game. Based on this, mobile phone 20 can assign these three tasks to other electronic devices for processing according to the predefined attribute information of these three tasks.
[0110] Specifically:
[0111] Mobile phone 20 can obtain the attribute information and corresponding values of the task "video conferencing screen projection". For example, the attribute information of this task includes: the processing type of the electronic device to which the task is adapted, task limitations, and the connection types supported by the task. Specifically, the value for the processing type of the electronic device to which the task is adapted is 4, indicating that the processing type of the electronic device adapted to the task is UI display. The value for "limitType" corresponding to the task limitations is 2, indicating that the task limitation type is processing power consumption, and the value for "limitValue" corresponding to the task limitations is 0, indicating that the device is not sensitive to power consumption. The value for the connection types supported by the task is 0, indicating that the connection types supported by the task include wireless connection. Therefore, based on the attribute information of this task, mobile phone 20 determines to assign the task to smart screen 30 for processing. A wireless communication connection has already been established between mobile phone 20 and smart screen 30.
[0112] Mobile phone 20 can obtain the attribute information and corresponding values for the task "Local Album Screen Projection". For example, the attribute information includes: the electronic device processing type adapted to the task, task limitations, and supported connection types. Specifically, the value for the electronic device processing type adapted to the task is 4, indicating that the adapted electronic device processing type is UI display. The value for "limitType" corresponding to the task limitations is 5, indicating no task limitations. The value for the supported connection types is 0, indicating that the supported connection types include wireless connection. Therefore, based on the attribute information of the task, mobile phone 20 determines to assign the task to computer 32 for processing. A wireless communication connection has already been established between mobile phone 20 and smart screen 30.
[0113] Mobile phone 20 can obtain the attribute information and corresponding values of the task "game projection display". For example, the attribute information of this task includes: the electronic device processing type adapted to the task, task limitations, and the connection types supported by the task. Specifically, the value for the electronic device processing type adapted to the task is 4, indicating that the adapted electronic device processing type is UI display type. The value for "limitType" corresponding to the task limitations is 5, indicating that the task is limited to a high refresh rate. The value for the connection types supported by the task is 0, indicating that the task supports wireless connections. Furthermore, based on the attribute information of this task, mobile phone 20 determines to assign the task to computer 32 for processing. A wireless communication connection has already been established between mobile phone 20 and computer 32.
[0114] In other embodiments of this application, the electronic device can assign tasks from different applications to different electronic devices for processing based on the attribute information of different tasks in different applications.
[0115] For example, Figure 5C shows a schematic diagram of a mobile phone 20 assigning tasks to different applications in the mobile phone 20 to corresponding electronic devices.
[0116] As shown in Figure 5C, in some scenarios, the video application on mobile phone 20 needs to handle the task of compressing video, the music application on mobile phone 20 needs to handle the task of playing audio, and the wireless screen mirroring application on mobile phone 20 needs to handle the task of displaying images. Based on this, mobile phone 20 can assign these three tasks to the corresponding electronic devices for processing according to the predefined attribute information of these three tasks.
[0117] Specifically:
[0118] Mobile phone 20 can obtain the attribute information and corresponding values for the task "compress video". For example, the attribute information includes: the processing type of the electronic device to which the task is adapted, task limitations, and supported connection types. Specifically, the value for the processing type of the electronic device to which the task is adapted is 6, indicating that the processing type is data processing. The value for "limitType" corresponding to the task limitations is 1, indicating that the task limitation type is processing latency, and the value for "limitValue" corresponding to the task limitations is 10, indicating that it needs to be completed within 10 seconds. The value for the supported connection types is 0, indicating that the task supports wireless connections. Therefore, based on the attribute information of the task, mobile phone 20 determines that the task will be processed locally, i.e., by mobile phone 20 itself.
[0119] Mobile phone 20 can obtain the attribute information and corresponding values for the task "play audio". For example, the attribute information includes: the processing type of the electronic device to which the task is adapted, task limitations, and supported connection types. Specifically, the value for the processing type of the electronic device adapted to the task is 7, indicating that the processing type is signal processing. The value for "limitType" corresponding to the task limitations is 7, indicating that the task limitation type is audio quality, and the value for "limitValue" corresponding to the task limitations is 8, indicating high audio quality. The value for the supported connection types is 0, indicating that the task supports wireless connections. Therefore, based on the attribute information of the task, mobile phone 20 determines that the task will be handled locally by smart speaker 50.
[0120] In addition, the mobile phone 20 obtains the attribute information of the "display image" task and determines to assign the task to the smart screen 30 for display.
[0121] It is understood that the multi-device collaborative task processing scenarios shown in Figures 5A to 5C are merely illustrative examples. In other embodiments of this application, scenarios may also be included where electronic devices assign large-granularity tasks from other applications to other electronic devices for processing based on multi-device collaboration, which is not limited here.
[0122] In some embodiments of this application, when a master device assigns a task to other slave devices for processing, the master device needs to send corresponding task processing requests to the other slave devices based on different tasks. Furthermore, it is understood that when other slave devices receive a task processing request from the master device, they can decide whether to execute the task corresponding to the request based on their own computing resources, memory, storage space, or battery life. If a slave device determines that it can process the task, it will accept the task request and process the task normally; if a slave device determines that it cannot process the task, it can also reject the task processing request sent by the master device.
[0123] For example, the master device determines to assign Task1 to slave device 1 for execution based on Task1's attribute information, namely, the compatible electronic device processing type, task limitations, and supported connection types. The master device then sends a task processing request to slave device 1. Further, the master device can determine whether slave device 1 intends to process Task1 based on the response message returned by slave device 1. If the master device receives an acknowledgment response from slave device 1, it determines that slave device 1 will process Task1. If the master device receives a rejection response from slave device 1, it determines that slave device 1 will not process Task1. Based on this, the master device can send a task processing request to slave device 2, and upon receiving an acknowledgment response from slave device 2, it determines that slave device 2 will process Task1.
[0124] In some embodiments of this application, a master device establishes a communication connection with multiple slave devices, which may include slave device 1, slave device 2, etc. In a scenario where the master device sends a task processing request for Task 1 to slave device 1 and a task processing request for Task 2 to slave device 2, the master device can receive the task processing request sent by slave device 1, which corresponds to a task in slave device 1; and the master device can also receive the task processing request sent by slave device 2, which corresponds to a task in slave device 2. That is to say, multiple electronic devices can send task processing requests to each other, or receive task processing requests and process tasks.
[0125] As an example, the task processing method mentioned in the embodiments of this application will be described below with reference to the flowchart of the task processing method shown in Figure 6A. It can be understood that the execution subject of the task processing method shown in Figure 6A can be the main device.
[0126] S601: The master device is in a communication connection state with multiple slave devices.
[0127] In some embodiments of this application, the master device can establish communication connections with multiple slave devices. The multiple slave devices may include N slave devices. For example, the N slave devices may include slave device 1 and slave device 2, where slave device 1 and slave device 2 may be electronic devices sharing the same user account as the master device.
[0128] It is understood that the connection types for establishing communication connections between the master device and multiple slave devices can be the same or different. The connection types include, but are not limited to, Wi-Fi, BT, BLE, 2G, 3G, 4G and 5G cellular networks, Zigbee, StarBlink, and wired connection communication methods such as Universal Serial Bus (USB) and High Definition Multimedia Interface (HDMI), which are not limited here.
[0129] S602: Multiple tasks were detected, and the attribute information of each task was obtained.
[0130] In some embodiments of this application, the main device detects multiple subtasks included in a task within an application and can obtain predefined attribute information for each subtask. It is understood that the application's task and its multiple subtasks can be large-granularity tasks. For example, a first application in the main device includes a first task, which includes a first subtask and a second subtask. The main device can obtain the attribute information of the first subtask and the attribute information of the second subtask, respectively.
[0131] In other embodiments of this application, the master device detects different tasks in multiple applications and can obtain attribute information of different tasks in different applications. It is understood that different tasks in different applications can be large-granularity tasks.
[0132] S603: Determine the matching device for each task based on the attribute information of each task.
[0133] As can be understood, a matching device refers to an electronic device that can perform various tasks in a master device. A matching device can be a master device or other slave devices.
[0134] In some embodiments of this application, the master device can determine the matching device for each subtask based on the attribute information of each subtask in an application. For example, the master device determines that slave device 1 is the matching device for the first subtask based on the attribute information of the first subtask; the master device determines that slave device 2 is the matching device for the second subtask based on the attribute information of the second subtask.
[0135] In other embodiments of this application, the master device can determine the matching device for each task in each application based on the attribute information of multiple tasks in multiple applications.
[0136] S604: Send task processing requests to the matching devices corresponding to each task.
[0137] In some embodiments of this application, based on the fact that the matching device for each subtask in an application has been determined in S603, the master device can then send a task processing request to the matching device for each subtask. For example, the master device sends a task processing request corresponding to the first subtask to slave device 1, and a task processing request corresponding to the second subtask to slave device 2.
[0138] In some other embodiments of this application, based on the fact that the matching device for the task in different applications has been determined in S603, the master device can then send a task processing request to the matching device for the task in different applications.
[0139] S605: In response to the confirmation response returned by the matching device, register the task in the matching device.
[0140] It is understandable that a confirmation response can instruct the matching device to determine the processing task.
[0141] In some embodiments of this application, after the master device sends corresponding task processing requests to the matching devices for each subtask in an application, the master device may further receive confirmation responses returned by some of the matching devices. For example, if the master device receives a confirmation response from slave device 1, it may instruct slave device 1 to process the first subtask. Based on this, the master device may register the first subtask with slave device 1 so that slave device 1 can process the first subtask.
[0142] In some other embodiments of this application, after the master device sends a corresponding task processing request to the matching device of tasks in multiple applications, the master device may further receive confirmation responses returned by some of the matching devices.
[0143] S606: Matching device that reassigns tasks in response to a rejection response returned by the matching device.
[0144] Understandably, a rejection response can instruct the matching device to refuse to process the task.
[0145] In some embodiments of this application, after the master device sends corresponding task processing requests to the matching devices of each subtask in an application, the master device can further receive rejection responses returned by some matching devices and reassign matching devices to the subtasks. For example, if the master device receives a rejection response returned by slave device 2, it can instruct slave device 2 to refuse to process the second subtask. Based on this, the master device can reassign the second subtask to slave device 3 and send a task processing request corresponding to the second subtask to slave device 3.
[0146] In some other embodiments of this application, after the master device sends the corresponding task processing request to the matching device of the task in multiple applications, the master device may further receive rejection responses returned by some of the matching devices and reassign matching devices to the sub-task.
[0147] S607: Obtain the task processing results for each task.
[0148] In some embodiments of this application, the master device can obtain the task processing results of each subtask by the matching device for each subtask through an open callback function. For example, the master device obtains the task processing result of the slave device 1 for the first subtask through an open callback function, and the master device obtains the task processing result of the slave device 3 for the second subtask through an open callback function.
[0149] The above solution enables the collaborative processing of multiple large-granularity tasks by multiple devices, thereby reducing the processing overhead of a single electronic device processing multiple large-granularity tasks independently and achieving rational utilization of resources through multi-device collaboration.
[0150] In other embodiments of this application, the master device can also obtain the task processing results of the matching device for each task corresponding to the task of different applications through open callback functions.
[0151] As an example, the task processing method mentioned in the embodiments of this application will be described below with reference to the flowchart of another task processing method shown in Figure 6B. It can be understood that the execution subject of the task processing method shown in Figure 6B can be the first electronic device.
[0152] S6001: The first electronic device establishes a communication connection with the second electronic device.
[0153] In some embodiments of this application, the first electronic device can establish a communication connection with the second electronic device. The second electronic device may be an electronic device sharing the same user account as the first electronic device.
[0154] It is understood that the connection types for establishing a communication connection between the first electronic device and the second electronic device can be the same or different. The connection types include, but are not limited to, Wi-Fi, BT, BLE, 2G, 3G, 4G and 5G cellular networks, Zigbee, Starfly, and wired connection communication methods such as USB and HDMI, which are not limited here.
[0155] S6002: In response to the first operation, the first electronic device determines that multiple devices will collaboratively perform a first task, which includes a first sub-task and a second sub-task.
[0156] In some embodiments of this application, a first electronic device can detect a user's first operation on an application and, in response to the first operation, determine that multiple devices will collaboratively execute a first task. The first task includes a first sub-task and a second sub-task.
[0157] It is understood that the first electronic device can acquire the attribute information of the first task and determine that the first task is a large-granularity task based on its task type. Furthermore, the first electronic device can acquire the attribute information of the first subtask and the second subtask. It can then determine that the first subtask is a large-granularity task based on its task type, and similarly, determine that the second subtask is a large-granularity task based on its task type.
[0158] In other embodiments of this application, the first task may also include other subtasks besides the first and second subtasks, which are not limited herein. Furthermore, the first electronic device may also detect tasks in other applications based on user operations and obtain attribute information of different tasks in other applications, which are not limited herein.
[0159] S6003: The first electronic device determines to execute the first subtask based on the attribute information of the first subtask.
[0160] In some embodiments of this application, the first electronic device can determine the execution of the first subtask based on the attribute information of the first subtask. The attribute information of the first subtask includes at least one of the following: the processing type of the electronic device adapted to the first subtask, task limitations, and the connection type supported by the task.
[0161] It is understood that the attribute information of the first subtask may also include at least one of the following: the application name of the application to which the task belongs, the task identifier, the task type, the expected goal of the task, etc., which are not limited here.
[0162] S6004: The first electronic device assigns the second subtask to the second electronic device for execution based on the attribute information of the second subtask.
[0163] In some embodiments of this application, a first electronic device can assign a second subtask to a second electronic device for execution based on the attribute information of the second subtask, and send a task processing request to the second electronic device. The attribute information of the second subtask includes at least one of the following: the processing type of the electronic device to which the second subtask is adapted, task limitations, and the connection types supported by the task.
[0164] It is understood that the attribute information of the second subtask may also include at least one of the following: the application name of the application to which the task belongs, the task identifier, the task type, the expected goal of the task, etc., which are not limited here.
[0165] In some embodiments of this application, the first electronic device can receive an acknowledgment response from the second electronic device, indicating that the second electronic device has decided to execute the second subtask. Based on this, the first electronic device can register the second subtask with the second electronic device so that the second electronic device can process the second subtask.
[0166] S6005: The first electronic device obtains the task processing result of the second subtask.
[0167] In some embodiments of this application, the first electronic device can obtain the task processing result of the second subtask through an open callback function. Furthermore, it can be understood that, based on the fact that the first sub-device is responsible for executing the first subtask, the first electronic device can directly obtain the task processing result of the first subtask.
[0168] The above scheme enables multiple devices to collaborate in processing at least one large-granularity subtask within a large-granularity task, thereby reducing the processing overhead of a single electronic device independently processing a large-granularity subtask and achieving rational resource utilization through multi-device collaboration.
[0169] Figure 7 illustrates an interactive flowchart of a task processing method according to an embodiment of this application. It can be understood that in the interactive flowchart shown in Figure 7, the master device and multiple slave devices are in a communication connection state.
[0170] S701: The master device detects multiple subtasks of the first application and obtains the attribute information corresponding to each subtask.
[0171] In some embodiments of this application, the main device can detect multiple subtasks in a first application of the main device, each subtask being a large-granularity task. These subtasks may include a first subtask, a second subtask, a third subtask, etc., and are not limited thereto.
[0172] For example, the first application in the main device can be a navigation application, the first subtask can be planning a navigation route from the initial location to the target location Q, the second subtask can be downloading an offline map of the area where the target location Q is located, and the third subtask can be collecting the initial location, which is not limited here.
[0173] Furthermore, the attribute information of each predefined subtask is obtained. The attribute information of each subtask includes at least the electronic device processing type adapted to the task, task limitations, and supported connection types.
[0174] In addition, the attribute information of each subtask can also be found in Table 1 above. That is, the attribute information of each subtask may also include, but is not limited to: the application name of the application to which the task belongs, the task identifier, the task type, the expected goal, and the open callback function used to obtain the task processing result, etc., which are not limited here.
[0175] In other embodiments of this application, the first application in the main device described above may be other applications, and the first application may also include different subtasks, which are not limited here.
[0176] For example, if the first application is a health application, then the health application may include, but is not limited to, the following sub-tasks: collecting heart rate, analyzing sleep quality, monitoring stress, measuring blood oxygen saturation, etc.
[0177] For example, if the first application is a sports application, then the sports application may include, but is not limited to, the following sub-tasks: collecting sports data, developing sports plans, and planning sports goals.
[0178] S702: The master device determines the matching device for each subtask based on the attribute information corresponding to each subtask.
[0179] In some embodiments of this application, the matching device for each subtask can be determined based on the attribute information of each subtask. For example, the matching device for each subtask can be determined based on the electronic device processing type, task restrictions, and supported connection types adapted to each subtask.
[0180] For example, assuming the first subtask is to plan a navigation route from the initial position to the target location Q, the master device can determine the matching device for the first subtask as slave device 1 based on the attribute information of the first subtask.
[0181] For example, if the second subtask is to download an offline map of the area where the target location Q is located, the master device can determine that the matching device for the second subtask is slave device 2 based on the attribute information of the second subtask.
[0182] For example, assuming the third subtask is the initial location for data collection, the master device can determine the matching device for the third subtask as the master device based on the attribute information of the third subtask.
[0183] S703: The master device assigns each subtask to its matching device and receives the response messages returned by each matching device.
[0184] In some embodiments of this application, after the master device determines the matching device for each subtask, it can further assign each subtask to its matching device; that is, the master device can send task processing requests to the matching devices for each subtask. Furthermore, the master device can also receive response messages returned by each matching device.
[0185] It is understandable that the response message received by the master device can include an acknowledgment response or a rejection response. If the master device receives an acknowledgment response, it indicates that the matching device has decided to process the subtask. If the master device receives a rejection response, it indicates that the matching device refuses to process the subtask, meaning that the master device needs to reassign the subtask to a different matching device. Furthermore, the matching device can be either a master device or a slave device.
[0186] The following example illustrates the process of the master device allocating subtasks: the first subtask is assigned to slave device 1, which confirms execution; the second subtask is assigned to slave device 2, which refuses execution, and then slave device 3 is determined as the matching device for the second subtask; the third subtask is assigned to the master device for execution.
[0187] S703A: The master device determines to process the third subtask and sends a first task processing request to slave device 1 and a second task processing request to slave device 2.
[0188] In some embodiments of this application, based on the master device determining in S702 to assign the first subtask to slave device 1 for processing, the second subtask to slave device 2 for processing, and the master device processing the third subtask locally, the master device sends a first task processing request corresponding to the first subtask to slave device 1, and sends a second task processing request corresponding to the second subtask to slave device 2. Furthermore, the master device determines to process the third subtask.
[0189] S703B: In response to the first task processing request, the slave device 1 determines to process the first sub-task and returns an acknowledgment response to the master device.
[0190] In some embodiments of this application, after receiving a first task request from the master device, the slave device 1 may determine to process the first sub-task if its computing resources, memory, storage space, or battery life are sufficient to efficiently process the first task. Furthermore, the slave device 1 may return an acknowledgment response to the master device, indicating that the slave device 1 has decided to process the first sub-task.
[0191] S703C: In response to the second task processing request, slave device 2 refuses to process the second subtask and returns a rejection response to the master device.
[0192] In some embodiments of this application, after receiving a second task request from the slave device 2, the slave device 2 may determine not to process the second subtask if its own computing resources, memory, storage space, or battery life are insufficient to process the second subtask. Furthermore, the slave device 2 may return a rejection response to the master device, indicating that the slave device 2 will not process the second subtask.
[0193] S703D: In response to the rejection response returned by slave device 2, the master device re-determines the matching device for the second subtask as slave device 3 and sends a second task processing request corresponding to the second subtask to slave device 3.
[0194] In some embodiments of this application, when the master device receives a rejection response returned by the slave device 2, the master device can re-determine the matching device for the second subtask based on the attribute information of the second subtask.
[0195] For example, the master device can determine the matching devices for the second subtask, including slave device 2, slave device 3, and slave device 4, based on the attribute information of the second subtask. Slave devices 2 through 4 are prioritized according to the task restrictions of the second subtask, determining that slave device 3 has a priority second only to slave device 2, and slave device 4 has a priority second only to slave device 3. Based on this, the master device can select slave device 3 as the matching device for the second subtask and send a second task processing request corresponding to the second subtask to slave device 3.
[0196] It is understood that in some other embodiments, when the master device receives the rejection response returned by the slave device 2, the master device may, as mentioned above, send a second task processing request corresponding to the second sub-task to the slave device 3 as the matching device for the second sub-task according to priority; or, the master device may also select the slave device 4 as the matching device for the second sub-task and send a second task processing request corresponding to the second sub-task to the slave device 4, which is not limited here.
[0197] S703E: In response to the second task processing request, the slave device 3 determines to process the second sub-task and returns an acknowledgment response to the master device.
[0198] In some embodiments of this application, after receiving a second task request from the slave device 3, the slave device 3 may determine to process the second subtask if its own computing resources, memory, storage space, or battery life are sufficient to efficiently process the second subtask. Furthermore, the slave device 3 returns an acknowledgment response to the master device, indicating that the slave device 3 has decided to process the second subtask.
[0199] S704: Each matching device executes its sub-tasks based on the task processing request and returns the task processing results to the master device.
[0200] S704A: The slave device 1 determines the first subtask corresponding to the first task processing request and returns the first task processing result to the master device.
[0201] In some embodiments of this application, when slave device 1 determines the first subtask corresponding to the first task processing request and detects that the master device has registered the first subtask to slave device 1 using the application programming interface, slave device 1 can process the first subtask and obtain the first task processing result. Furthermore, slave device 1 can return the first task processing result to the master device.
[0202] S704B: The device 3 determines the second subtask corresponding to the second task processing request and returns the second task processing result to the master device.
[0203] In some embodiments of this application, when slave device 3 determines the second subtask corresponding to the second task processing request and detects that the master device has registered the second subtask to slave device 3 using the application programming interface, slave device 3 can process the second subtask and obtain the second task processing result. Furthermore, slave device 3 can return the second task processing result to the master device.
[0204] S705: The master device receives the task processing results of each subtask.
[0205] In some embodiments of this application, the master device can obtain the first task processing result processed by slave device 1 and the second task processing result processed by slave device 3 through an open callback function. Furthermore, the master device can directly obtain the third task processing result processed by the master device.
[0206] For example, the main device can perform the first task (e.g., navigation from the initial location to the target location Q) through the first application (e.g., a navigation application) based on the first task processing result (e.g., a navigation route from the initial location to the target location Q), the second task processing result (an offline map of the area where the target location Q is located), and the third task processing result (the initial location). This is not limited here.
[0207] The above method enables the use of multi-device collaboration to process some large-granular tasks in a certain electronic device, thereby reducing the processing overhead of the electronic device and realizing the rational use of resources in multi-device collaboration.
[0208] In some embodiments of this application, in a multi-device collaboration scenario, at least two electronic devices can establish a communication connection based on the same communication connection method. Furthermore, the two electronic devices can establish the same communication session based on the communication connection, and at the same time, send task processing requests for different tasks corresponding to different applications to each other, receive task processing requests for different tasks corresponding to different applications sent by the other party, and process them.
[0209] For example, Figure 8 shows a schematic diagram of different electronic devices sending or receiving task processing requests based on the same communication session in a multi-device collaboration scenario.
[0210] As shown in Figure 8, in the multi-device collaboration scenario, the electronic devices that perform multi-device collaboration include mobile phones 81, 82, 83, 84, 85, 86, and 87, etc., and each mobile phone can establish a communication connection with the others using the same or different communication methods.
[0211] It is understandable that, for ease of description, Figure 8 uses multiple mobile phones running different applications for illustration. Specifically, mobile phone 81 runs application A or application B, mobile phone 82 runs application C, and mobile phone 83 runs application D. It is understood that the task processing type and number of tasks corresponding to different applications may be different.
[0212] It is understood that in other embodiments of this application, the multiple electronic devices in a multi-device collaboration scenario may be different types of electronic devices and may run different applications, which is not limited here.
[0213] Referring to Figure 8, application A runs on mobile phone 81. Application A includes tasks A1, A2, and A3. Mobile phone 81 can determine, based on the attribute information of task A1, to assign A1 to mobile phone 82 for processing; based on the attribute information of task A2, to assign A2 to mobile phone 84 for processing; and based on the attribute information of task A3, to assign A3 to mobile phone 85 for processing.
[0214] The application C running on mobile phone 82 includes tasks C1, C2, C3, and C4. Mobile phone 82 can determine, based on the attribute information of task C1, to assign C1 to mobile phone 81 for processing; based on the attribute information of task C2, to assign C2 to mobile phone 84 for processing; based on the attribute information of task C3, to assign C3 to mobile phone 85 for processing; and based on the attribute information of task C4, to assign C4 to mobile phone 86 for processing.
[0215] Assuming that mobile phone 81 and mobile phone 82 are connected via Wi-Fi, meaning that a communication session has been established between them, the task allocation results show that, based on this communication session, mobile phone 81 can send a task processing request corresponding to task A1 to mobile phone 82, and mobile phone 82 can receive this request. Furthermore, based on this same Wi-Fi session, mobile phone 82 can send a task processing request corresponding to task C1 to mobile phone 81, and mobile phone 81 can receive this request. In other words, the task processing method provided in this embodiment enables the transmission of different tasks between different electronic devices through the same communication channel in a multi-device collaborative system, saving communication resources.
[0216] Referring again to Figure 8, mobile phone 81 can also run application B, which includes tasks B1, B2, and B3. Mobile phone 81 can determine whether to assign task B1 to mobile phone 83 for processing based on the attribute information of task B1, assign task B2 to mobile phone 87 for processing based on the attribute information of task B2, and assign task B3 to mobile phone 86 for processing based on the attribute information of task B3.
[0217] The application D running on mobile phone 83 includes tasks D1, D2, and D3. Mobile phone 83 can determine, based on the attribute information of task D1, to assign D1 to mobile phone 81 for processing; based on the attribute information of task D2, to assign D2 to mobile phone 85 for processing; and based on the attribute information of task D3, to assign D3 to mobile phone 87 for processing.
[0218] Assume that mobile phones 81 and 83 are connected via Bluetooth, meaning a communication session has been established between them. As seen from the task allocation results above, based on this Bluetooth session, mobile phone 81 can send a task processing request corresponding to task B1 to mobile phone 83, and mobile phone 83 can receive this task processing request from mobile phone 81. Furthermore, based on this Bluetooth session, mobile phone 83 can send a task processing request corresponding to task D1 to mobile phone 81, and mobile phone 81 can receive this task processing request from mobile phone 83.
[0219] The task processing method provided in this application embodiment enables task allocation and collaborative processing of different tasks corresponding to different applications on different electronic devices based on the same communication session in a multi-device collaborative system. This makes task allocation more flexible in multi-device collaboration, makes the task collaborative processing process more reliable and robust, and supports batch parallel collaboration of applications and corresponding tasks in distributed scenarios.
[0220] It is understood that the use of mobile phones 81, 82, and 83 in Figure 8 as electronic devices capable of both sending and receiving service requests and processing tasks, and mobile phones 84, 85, 86, and 87 as electronic devices receiving task processing requests, is merely an illustrative example. In other embodiments of this application, any one or more electronic devices in Figure 8 in a multi-device collaborative system may only send task processing requests, only receive task processing requests, or both, and this is not limited here.
[0221] It is understood that the operating system of the electronic device in this application embodiment can be the Android operating system and an operating system based on the native Android (such as the EMUI operating system), or it can be a distributed operating system (such as the HarmonyOS operating system). The following is a brief introduction to the operating system structure that can be applied in the electronic device of this application, taking a distributed operating system as an example.
[0222] For example, Figure 9 shows a schematic block diagram of the software structure of a distributed operating system according to an embodiment of this application.
[0223] As shown in Figure 9, a distributed operating system installed in an electronic device can adopt a layered architecture. A layered architecture divides the distributed operating system into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the distributed operating system is divided into four layers, from top to bottom: application layer 900, application framework layer 901, system service layer 902, and kernel layer 903. In other embodiments, the distributed operating system may also be divided into other numbers of layers; this is not a limitation.
[0224] The application layer 900 may include a series of applications such as system applications and third-party applications (or extended applications). The task processing method provided in this application is applicable to the distributed implementation of various applications (including system applications and third-party applications) in the application layer 900. System applications may include desktop, settings, camera, wireless local area networks (WLAN), Bluetooth, navigation, etc.; third-party applications may include third-party developed software applications such as camera applications (e.g., Meitu), navigation applications (e.g., Gaode Map, Baidu Map), and music applications (e.g., Kugou Music, NetEase Cloud Music).
[0225] Application framework layer 901 provides a multi-language framework for application layer 900, including a user interface (UI) framework and a user program framework. Application framework layer 901 includes some predefined functions.
[0226] System service layer 902 is the core of the distributed operating system. System service layer 902 provides services to applications in application layer 900 through application framework layer 901.
[0227] It is understood that the system service corresponding to the task processing method provided in this application embodiment can be called an elastic task service center. The elastic task service center can be located in the system service layer 902. The elastic task service center can be used to allocate different tasks to different electronic devices for processing based on the attribute information of the tasks of different applications in different electronic devices.
[0228] In addition, in some other embodiments of this application, the Elastic Task Service Center may also be located in the aforementioned application framework layer 901 or kernel layer 903, etc., without limitation.
[0229] It is understandable that in a distributed operating system, the UI framework, user program framework, etc. in the application framework layer 901 and the distributed scheduling module in the system service layer 302 can together constitute a set of basic system capability subsystems, without any restrictions.
[0230] Kernel layer 903 is the layer between hardware and software. In a distributed operating system, kernel layer 903 includes the kernel subsystem and driver subsystem, among others.
[0231] The kernel subsystem, given that distributed operating systems can employ a multi-kernel design, supports the selection of a suitable OS kernel for different resource-constrained devices. The kernel abstraction layer (KAL) within the kernel subsystem can shield the differences between multiple kernels, providing basic kernel capabilities to higher layers, including process / thread management, memory management, file system, network management, and peripheral device management.
[0232] The Driver Framework (HDF) of the distributed operating system is the foundation for the open hardware ecosystem of distributed systems, providing unified peripheral access capabilities and a framework for driver development and management. Kernel layer 903 includes at least display drivers, camera drivers, audio drivers, and sensor drivers.
[0233] Based on the same concept, as an implementation of the task processing method in Figure 7 above, this application embodiment provides a flexible task processing device. This device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspondingly implement all the contents of the aforementioned method embodiment.
[0234] Figure 10 is a schematic diagram of a flexible task processing device provided in an embodiment of this application. This flexible task processing device 1000 is applied to an electronic device, which includes slave devices and master devices. Specifically, the flexible task processing device 1000 includes a task detection module 1001, a task allocation module 1002, a task registration module 1003, and a task processing result acquisition module 1004. Wherein:
[0235] The task detection module 1001 can detect tasks in an electronic device and acquire the attribute information of these tasks. Based on the task type in the attribute information, it determines whether a task belongs to a large-granularity task. For example, the task detection module 1001 can detect multiple tasks from different applications, or multiple subtasks corresponding to a single task within the same application. Furthermore, based on the task type in the attribute information of the aforementioned task or subtask, it can determine whether the task or subtask belongs to a large-granularity task.
[0236] In addition, it can be understood that the task detection module 1001 can also detect task processing requests sent by other electronic devices.
[0237] The task allocation module 1002 can determine the matching device for each task based on the task's attribute information. Furthermore, the task allocation module 1002 can send a task processing request to the matching device corresponding to each task and receive response messages returned by each matching device. The task's attribute information includes at least the electronic device processing type adapted to the task, task limitations, and supported connection types.
[0238] The task registration module 1003 can register the corresponding task to the corresponding matching device based on the confirmation response returned by each matching device.
[0239] The task processing result acquisition module 1004 can acquire the task processing results returned by each matched task.
[0240] This application also provides an electronic device configured to execute the task processing method performed by the main device shown in the above embodiments.
[0241] This application also provides a chip, as shown in FIG11, which includes a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the task processing method performed by the main device in the above embodiments.
[0242] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the task processing method performed by the main device provided in the above embodiments.
[0243] This application also provides a computer program product, which includes a computer program. When the computer program is run by an electronic device, the electronic device enables the electronic device to implement the task processing method performed by the main device provided in the above embodiments.
[0244] Figure 12 shows a schematic diagram of the structure of an electronic device 100 according to an embodiment of this application.
[0245] In this embodiment, the electronic device 100 can be an electronic device such as a smartwatch 10, mobile phone 20, smart screen 30, smart speaker 50, or tablet computer 60 as shown in Figure 3A above, and is not limited thereto.
[0246] As shown in Figure 12, 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a subscriber identification module (SIM) card interface 195, a communication device 196, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, and a bone conduction sensor 180M, etc.
[0247] Processor 110 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0248] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0249] The processor 110 may also include a memory for storing instructions and data.
[0250] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0251] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0252] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display 194, camera 193, and wireless communication module 160, etc.
[0253] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 can be used to transmit and receive electromagnetic wave signals, that is, wireless carrier information.
[0254] The mobile communication module 150 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G / 6G on the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.
[0255] The wireless communication module 160 can provide solutions for wireless communication applications on the mobile phone 20, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and ultra-wideband (UWB). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 can receive electromagnetic waves via antenna 2, filter and amplify the received electromagnetic waves, and transmit them to a modem processor for demodulation. The wireless communication module 160 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 2.
[0256] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0257] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.
[0258] Camera 193 is used to capture still images or videos. An object passes through the lens, generating an optical image that is projected onto a photosensitive element. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP (Image Signal Processor) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for further processing. The DSP converts the digital image signal into standard RGB, YUV, or other image formats.
[0259] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0260] Internal memory 121 can be used to store computer executable program code, including instructions, such as those in the aforementioned memory 103. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. The data storage area may store data created during the use of electronic device 100, such as control identifiers for security controls, screenshot redraw policy identifiers corresponding to security controls, and patterns, images, and text corresponding to screenshot redraw policies. Furthermore, internal memory 121 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located within processor 110.
[0261] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0262] The accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the attitude of electronic device 100.
[0263] In some embodiments of this application, when processing real-time GPS data collected by the smartwatch 10, the gyroscope sensor 180B and the accelerometer sensor 180E can be used for auxiliary measurements. Specifically, the gyroscope sensor 180B can be used to measure the angular velocity and direction of the smartwatch 10, helping to determine its orientation and tilt angle in space. The accelerometer sensor 180E can be used to measure the acceleration of the smartwatch 10, helping to identify whether the smartwatch 10 is moving and its speed. By combining the data measured by both the gyroscope sensor 180B and the accelerometer sensor 180E, the smartwatch 10 can more accurately determine its motion state and position changes.
[0264] Touch sensor 180K, also known as a "touch device," can be disposed on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In some embodiments of this application, a first operation in the embodiments of this application can be detected based on touch sensor 180K.
[0265] Motor 191 can generate vibration alerts.
[0266] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0267] The SIM card interface 195 is used to connect the SIM card.
[0268] It is understood that the structure of the electronic device 100 shown in the embodiments of this application does not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0269] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0270] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0271] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0272] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, compact discread-only memory (CD-ROMs), magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0273] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0274] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0275] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0276] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.
Claims
1. A task processing method, characterized in that, Applied to a first electronic device, the method includes: The first electronic device establishes a communication connection with the second electronic device; In response to a first operation, the first operation is used to instruct multiple devices to collaboratively perform a first task, the first task including a first sub-task and a second sub-task, wherein the multiple devices include a first electronic device and a second electronic device. The first electronic device executes the first sub-task; The second subtask is assigned to the second electronic device for execution based on the attribute information of the second subtask; Obtain the task processing result of the second subtask.
2. The method according to claim 1, characterized in that, The attribute information includes at least one of the following: The task's device processing type, task limitations, supported connection types, application name of the application to which the task belongs, task identifier, task type, and expected task goal; The task types include at least one of the following: download, copy, algorithm calculation, data acquisition, data compression, model inference, and UI display; The device processing types adapted to the task include at least one of the following: computing, control, downloading, machine learning, model running, big data analysis, data processing, virtual reality, signal processing, and web page running; The task restrictions include at least one of the following: restrictions on task processing latency, and restrictions on the device performance for processing the task; The connection types supported by the task include at least one of the following: local connection, wired connection, and wireless connection. The wired connection type includes at least one of Universal Serial Bus and High Definition Multimedia Interface, and the wireless connection type includes at least one of Wi-Fi, Bluetooth, Bluetooth Low Energy, Cellular, Purple Bee, and StarFlash.
3. The method according to claim 1, characterized in that, The method further includes: Based on the attribute information of the first subtask, the first subtask is determined to be a first task type; based on the attribute information of the second subtask, the second subtask is determined to be a second task type. The first task type and the second task type are different, and both the first task type and the second task type are used to indicate that the task needs to be executed based on at least one single thread.
4. The method according to claim 1, characterized in that, The first task is a task in a first application within the first electronic device, and the first application includes a navigation application; The first task includes navigating from the initial position of the first electronic device to a target position, the first sub-task includes obtaining the initial position of the first electronic device, and the second sub-task includes planning a route from the initial position of the first electronic device to the target position.
5. The method according to claim 1, characterized in that, The first electronic device performs the first sub-task, including: Obtain the attribute information of the first subtask, which includes at least one of the following: the electronic device processing type adapted to the first subtask, task restrictions, and supported connection types. Based on at least one of the following attribute information: electronic device processing type, task restrictions, and supported connection types adapted to the first sub-task, it is determined that the first electronic device executes the first sub-task. The first subtask supports connection types including local connections.
6. The method according to claim 1, characterized in that, The step of assigning the second subtask to the second electronic device for execution based on the attribute information of the second subtask includes: Obtain the attribute information of the second subtask, which includes at least one of the following: the electronic device processing type adapted to the second subtask, task restrictions, and supported connection types. Based on at least one of the following attribute information: electronic device processing type, task restrictions, and supported connection types adapted to the second sub-task, it is determined that the devices capable of performing the second sub-task include the first electronic device and the second electronic device. Based on the task constraints of the second subtask, the second subtask is assigned to the second electronic device for execution, wherein, corresponding to the task constraints of the second subtask, the priority of the second electronic device is higher than that of the first electronic device; Send a task processing request corresponding to the second subtask to the second electronic device.
7. The method according to claim 1, characterized in that, The task processing result of the second subtask comes from the second electronic device.
8. The method according to claim 6, characterized in that, After sending a task processing request corresponding to the second subtask to the second electronic device, the method further includes: A rejection response was received from the second electronic device.
9. The method according to claim 8, characterized in that, The multiple devices further include a third electronic device, and the method further includes; The second subtask is assigned to the third electronic device for execution.
10. The method according to claim 7, characterized in that, The method further includes: The first electronic device performs the second sub-task.
11. The method according to claim 1, characterized in that, The method also includes: The communication connection is used to receive a second task sent by the second electronic device, wherein the attribute information of the second task is used to indicate that the first electronic device shall perform the second task. Perform the second task.
12. A task processing method, characterized in that, The method includes: The first electronic device establishes a communication connection with the second electronic device; The first electronic device responds to a first operation, the first operation being used to instruct multiple devices to collaboratively perform a first task, the first task including a first sub-task and a second sub-task; The first electronic device executes the first sub-task; The first electronic device assigns the second subtask to the second electronic device for execution based on the attribute information of the second subtask; The second electronic device executes the second sub-task and sends the task processing result of the second sub-task to the first electronic device; The first electronic device acquires the task processing result of the second subtask.
13. An electronic device, characterized in that, include: The memory, including physical memory and secondary memory, is used to store instructions executed by one or more processors of an electronic device; And a processor for executing the instructions to cause the electronic device to implement the task processing method of any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by an electronic device, causes the electronic device to perform the task processing method according to any one of claims 1 to 12.
15. A computer program product, characterized in that, It includes a computer program / instruction that, when executed on an electronic device, causes the electronic device to perform the task processing method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Task processing method and task processing platform
CN114546648A
Method, system and device for managing computing resources
CN115220902A
Task processing method and device based on multiple devices, devices and storage medium
CN115657849A
Subtask Assignment for an Artificial Intelligence Task
US20210319281A1