Task processing method, task collaboration method and terminal equipment

By collaboratively processing tasks across multiple terminal devices and selecting the optimal target terminal and communication method, the problem of insufficient computing resources on terminal devices is solved, and the task processing success rate and user experience are improved.

CN120762872AActive Publication Date: 2025-10-10HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411135536.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2025-10-10
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

The terminal devices have insufficient computing resources and are unable to effectively handle tasks that require high computing power, resulting in long delays in calculation completion, reduced device battery life, and a poor user experience.

Method used

By collaboratively processing tasks across multiple terminal devices, the optimal target terminal and communication method are selected, and the computing resources of the target terminal are utilized to process tasks, thus avoiding excessive consumption of computing resources on a single terminal device.

Benefits of technology

The success rate of task processing is improved, the impact of the target terminal's collaborative processing on its own tasks is reduced, and the user experience is guaranteed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120762872A_ABST
    Figure CN120762872A_ABST
Patent Text Reader

Abstract

The invention provides a task processing method, a task cooperation method, terminal equipment, a storage medium and a program product, in the method, a target terminal cooperates with a first terminal to process a to-be-processed task in a target communication mode, and the defect that computing resources are insufficient when the first terminal processes the to-be-processed task is made up. And when the target terminal cooperating with the first terminal to process the to-be-processed task and the corresponding target communication mode are determined, the target terminal and the target communication mode are determined according to the corresponding capability performance when the second terminal cooperates with the first terminal to process the historical task, so that the possibility that the to-be-processed task is successfully executed can be improved. Meanwhile, the capability of the target terminal for processing the historical task from the first terminal in the target communication mode is optimal, so that the scheme can greatly reduce the influence of the cooperative processing of the target terminal on the processing of the task of the target terminal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a task processing method, a task coordination method, a terminal device, a storage medium and a program product. BACKGROUND

[0002] With the rapid development of terminal device hardware and software technologies, the hardware computing power and software algorithmic ability of terminal devices have been greatly improved in recent years, and the substantial improvement of the hardware computing power and software algorithmic ability provides a solid foundation for the landing of various emerging technologies. These emerging technologies include intelligent services, ultra-high-definition audio and video processing, ultra-low-latency human-computer interaction, AI large model inference, video super-resolution, video AI enhancement, etc. These emerging technologies are the future market competition points of terminal devices.

[0003] However, while these emerging technologies improve the user experience, they also pose new challenges to terminal devices, for example, tasks related to emerging technologies are usually high-computing-power-demand tasks, and processing these high-computing-power-demand tasks often requires relatively large computing resources. However, the current terminal devices lack computing resources and cannot complete these high-computing-power-demand tasks. SUMMARY

[0004] The present application provides a task processing method, a task coordination method, a terminal device, a storage medium and a program product, which are used for a target terminal to coordinate with a first terminal to process a to-be-processed task, thereby making up for the defect of insufficient computing resources when the first terminal processes a high-computing-power-demand task, and avoiding the excessive consumption of computing resources of a single terminal device.

[0005] To achieve the above object, the present application adopts the following technical solutions:

[0006] In a first aspect, a task processing method is provided, which is applied to a first terminal, the first terminal has a device coordination function, and the method comprises the following steps:

[0007] When the device collaboration function of a first terminal is enabled, a second terminal capable of collaborating with the first terminal to process tasks is determined from multiple terminals that have a first communication connection with the first terminal, along with multiple communication modes supported by the second terminal with respect to the first terminal. Since there may be multiple second terminals capable of collaborating with the first terminal to process tasks, and the second terminals may also support multiple communication modes with the first terminal, a target terminal and its corresponding target communication mode are determined from the second terminals based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal. The target terminal's ability to process historical tasks from the first terminal under the target communication mode is optimal. Subsequently, when generating a pending task, if the current communication mode between the first terminal and the target terminal is inconsistent with the target communication mode, a second communication connection is established with the target terminal based on the target communication mode, and the pending task is sent to the target terminal via the second communication connection, for processing by the target terminal. If the current communication mode between the first terminal and the target terminal is consistent with the target communication mode, the pending task is sent to the target terminal via the current communication mode, for processing by the target terminal. The first terminal also receives a task processing result returned by the target terminal.

[0008] Based on the above technical solution, in the embodiment of the present application, the target terminal cooperates with the first terminal to process the pending task in the target communication mode, which makes up for the defect of insufficient computing resources when the first terminal processes the pending task and avoids excessive consumption of computing resources of a single terminal device. In addition, when determining the target terminal and its corresponding target communication mode for coordinating the processing of the pending task by the first terminal, the pending task is not simply randomly assigned to other terminal devices, but the target terminal and the target communication mode are determined based on the corresponding capability performance when the second terminal cooperates with the first terminal to process the historical task, wherein the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, so that when the target terminal cooperates with the first terminal to process the pending task, the possibility of the pending task being successfully executed can be increased, thereby improving the corresponding user experience of the first terminal. At the same time, since the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, the solution can greatly reduce the impact of the above-mentioned collaborative processing of the target terminal on the processing of the target terminal's own tasks, thereby avoiding deteriorating the user experience of the user on the collaborative device.

[0009] In a possible implementation of the first aspect, the capability performance includes latency and power consumption, and the optimal capability performance is when the latency and the power consumption are balanced. In this embodiment, latency and power consumption are used as two factors to evaluate the capability performance of the terminal in processing tasks.

[0010] In a possible implementation of the first aspect, the task to be processed is a current subtask to be processed among multiple subtasks to be processed in sequence, and the second terminal processes the capability performance corresponding to the historical task, including: the second terminal processes the capability performance corresponding to the subtask located before the current subtask; after receiving the task processing result returned by the target terminal, returning to execute the step of determining the target terminal and its corresponding target communication mode from the second terminal based on the capability performance corresponding to the historical task from the first terminal under the multiple communication modes supported by the second terminal with the first terminal.

[0011] In this embodiment, after each subtask is processed, the ability performance of the second terminal processing the subtask and its corresponding communication mode changes. Therefore, it is necessary to timely update the target terminal and its corresponding target communication mode to ensure that the ability performance of the currently determined target terminal to process the current subtask under the target communication mode is optimal, greatly reducing the impact of the above-mentioned collaborative processing of the target terminal on the processing of the target terminal's own tasks.

[0012] In a possible implementation of the first aspect, the target terminal and its corresponding target communication mode are determined from the second terminal based on the capability performance of the second terminal in processing historical tasks from the first terminal under multiple communication modes supported with the first terminal, including: determining the actual capability gain of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal based on the capability performance of the second terminal in processing historical tasks from the first terminal under multiple communication modes supported with the first terminal; determining the target terminal and its corresponding target communication mode from the second terminal based on one or more of the actual capability gain of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal, the total number of historical tasks, and the number of historical tasks processed by the second terminal under each communication mode supported with the first terminal.

[0013] In this embodiment, the actual capability gain corresponding to the ability of the second terminal and the communication mode to execute historical tasks can be determined based on the ability performance of the combination of the second terminal and the communication mode, wherein the better the capability performance, the greater the corresponding actual capability gain. In this way, the combination with the best ability performance for processing historical tasks (i.e., the target terminal + target communication mode) can be determined based on one or more of the actual capability gain corresponding to the historical tasks processed by the second terminal under each supported communication mode with the first terminal, the total number of historical tasks, and the number of historical tasks processed by the second terminal under each supported communication mode with the first terminal. This provides a method for measuring the quality of the ability performance for processing historical tasks based on the actual capability gain.

[0014] In a possible implementation of the first aspect, the determining of the second terminal from the multiple terminals that can cooperate with the first terminal to process tasks based on one or more of the available computing power, remaining power, and whether the terminals are in a charging state includes: determining the terminal as the second terminal that can cooperate with the first terminal to process tasks when one or more of the available computing power, remaining power, and whether the terminals are in a charging state meet a first preset condition; the first preset condition is: the available computing power of the terminal is greater than or equal to a first threshold and the remaining power of the terminal is greater than or equal to a second threshold; or, the available computing power of the terminal is greater than or equal to a first threshold, the remaining power of the terminal is less than the second threshold, and the terminal is in a charging state.

[0015] This embodiment provides an implementation method for determining a second terminal that can collaborate with a first terminal to process a task from multiple terminals based on device information.

[0016] In a possible implementation of the first aspect, the method further includes: if it is determined that the first terminal and the second terminal are connected for the first time, generating a first initialization task; transmitting the first initialization task to the second terminal through a communication method supported by the second terminal with the first terminal, and processing it by the second terminal; receiving the task processing result returned by the second terminal, and determining the ability performance of the second terminal to process the first initialization task under multiple communication methods supported with the first terminal; the ability performance of the second terminal to process the historical task includes: the ability performance of the second terminal to process the first initialization task.

[0017] In the embodiment, for the second terminal connected for the first time, the historical task from the first terminal is not processed, at this time, the first terminal can generate a first initialization task, transmit the first initialization task to the second terminal through the communication mode supported by the second terminal and the first terminal, process the first initialization task by the second terminal, and obtain the capability performance of the second terminal in processing the historical task (including the first initialization task) in the multiple communication modes supported by the second terminal and the first terminal.

[0018] In a second aspect, a task coordination method is provided, applied to a second terminal, the second terminal has a device coordination function, and the second terminal has a first communication connection with a first terminal, the method comprising: if the device coordination function of the second terminal is in an open state, and a connection request for establishing a second communication connection is received from the first terminal, establishing a second communication connection with the first terminal based on the connection request for establishing a second communication connection; receiving a to-be-processed task from the first terminal through the second communication connection, and processing the to-be-processed task; if a to-be-processed task is received from the first terminal through a current communication mode, processing the to-be-processed task; and returning a task processing result to the first terminal.

[0019] In the embodiment, the second terminal can coordinate the first terminal to process the to-be-processed task from the first terminal, and return the task processing result to the first terminal, which makes up for the defect of insufficient computing resources when the first terminal processes a task with high computing power requirement, and avoids excessive consumption of computing resources of a single terminal device.

[0020] In a possible implementation manner of the second aspect, the method further comprises: if the second terminal is connected with the first terminal for the first time, receiving a first initialization task from the first terminal through multiple communication modes supported by the second terminal and the first terminal; processing the first initialization task, and returning a task processing result to the first terminal through the multiple communication modes supported by the second terminal and the first terminal.

[0021] In this embodiment, before determining the target terminal and its corresponding target communication mode from the second terminal based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal, the second terminal needs to have processed historical tasks from the first terminal under the multiple communication modes it supports with the first terminal. Only in this way can the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal be known. For the second terminal that is connecting for the first time, it has not processed historical tasks from the first terminal. In this case, the first terminal can generate a first initialization task and transmit the first initialization task to the second terminal via the communication mode it supports with the first terminal. The second terminal will process the task and return the task processing result to the first terminal. The first terminal can then obtain the second terminal's ability to process historical tasks (including the first initialization task) under the multiple communication modes it supports with the first terminal.

[0022] In a possible implementation of the second aspect, after sending the device information of the second terminal to the first terminal through the first communication connection, it also includes: receiving a query request from the first terminal; in response to the query request, obtaining the updated device information of the second terminal, and sending the updated device information of the second terminal to the first terminal.

[0023] In this embodiment, the first terminal periodically sends query requests to multiple terminals, and the second terminal responds to the query requests by returning its updated device information. This allows the first terminal to promptly obtain the updated device information of multiple second terminals and, based on the updated device information, promptly update the target terminal and its corresponding target communication mode, ensuring that the determined target terminal's ability to perform historical tasks under the target communication mode is optimal. This solution can significantly reduce the impact of the target terminal's collaborative processing on the target terminal's own task processing, thereby avoiding degradation of the user experience of the collaborative device.

[0024] In a possible implementation of the second aspect, after sending the device information of the second terminal to the first terminal through the first communication connection, it also includes: when monitoring that the second terminal changes from being able to collaborate with the first terminal to being unable to collaborate with the first terminal to process tasks, or from being unable to collaborate with the first terminal to being able to collaborate with the first terminal to process tasks, obtaining the device change information of the second terminal and sending the device change information to the first terminal.

[0025] In the second terminal of the embodiment, the device information of the second terminal is monitored. If it is determined according to the detected device information of the second terminal that the second terminal changes from being able to process the task cooperatively with the first terminal to being unable to process the task cooperatively with the first terminal (for example, the available computing power of the second terminal changes from 0% to 80%), or from being unable to process the task cooperatively with the first terminal to being able to process the task cooperatively with the first terminal (for example, the available computing power of the second terminal is 80%, the remaining power is 35%, and the second terminal changes from being unplugged to being plugged in), the second terminal sends device change information to the first terminal. The first terminal receives the device change information from multiple terminals. In this way, the first terminal can update the target terminal and the corresponding target communication mode in time according to the device change information of multiple second terminals, so that the ability of the determined target terminal to perform the historical task in the target communication mode is optimal. The scheme can greatly reduce the impact of the above-mentioned cooperative processing of the target terminal on the processing of the task of the target terminal itself, thereby avoiding the degradation of the use experience of the user on the cooperative device.

[0026] In a third aspect, a terminal device is provided, and the terminal device includes a memory and a processor. The memory is configured to store instructions. When the instructions are executed by the processor, the terminal device implements the task processing method in the first aspect or any possible implementation manner of the first aspect, or implements the task cooperation method in the second aspect or any possible implementation manner of the second aspect.

[0027] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed, the task processing method in the first aspect or any possible implementation manner of the first aspect is implemented, or the task cooperation method in the second aspect or any possible implementation manner of the second aspect is implemented.

[0028] In a fifth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code is executed on a computer, the processor implements the task processing method in the first aspect or any possible implementation manner of the first aspect, or implements the task cooperation method in the second aspect or any possible implementation manner of the second aspect.

[0029] On the basis of the implementation manners of the above aspects, the application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS

[0030] Figure 1 FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the application;

[0031] Figure 2Figure 1 is a software structure block diagram of an electronic device provided by an embodiment of the present application.

[0032] Figure 3 Figure 2 is a scenario diagram of devices A, B and C processing a task cooperatively provided by an embodiment of the present application.

[0033] Figure 4 Figure 3 is a flow diagram of devices A, B and C processing a task cooperatively provided by an embodiment of the present application.

[0034] Figure 5 Figure 4 is a flow diagram of a task processing method provided by an embodiment of the present application.

[0035] Figure 6 Figure 5 is a scenario diagram of a first terminal connecting multiple terminals provided by an embodiment of the present application.

[0036] Figure 7 Figure 6 is a flow diagram of a task processing method provided by an embodiment of the present application.

[0037] Figure 8 Figure 7 is a flow diagram of a task processing method provided by an embodiment of the present application.

[0038] Figure 9 Figure 8 is a flow diagram of a task cooperation method provided by an embodiment of the present application.

[0039] Figure 10 Figure 9 is a flow diagram of a task cooperation method provided by an embodiment of the present application.

[0040] Figure 11 Figure 10 is a structure diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0041] The technical solutions in the present application will be described below with reference to the accompanying drawings.

[0042] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the present application only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone.

[0043] Hereinafter, the terms "first" and "second" are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features. In the description of the embodiments, unless otherwise specified, the meaning of "multiple" is two or more.

[0044] First, some terms in the embodiments of the present application are explained and described to facilitate understanding by those skilled in the art.

[0045] (1) BLE

[0046] Bluetooth Low Energy (BLE) is a low-power Bluetooth technology designed for small data transmission and long battery life. Its features are: low power consumption, low cost, short distance communication (usually within 10 meters), suitable for Internet of Things (IoT) devices and health monitoring devices, etc.

[0047] Devices that support BLE wireless communication technology include: smartwatches, smartphones, wireless earphones, health monitoring devices, smart home devices, etc.

[0048] (2) WiFi

[0049] Wireless Fidelity (WiFi) is a wireless network technology that allows electronic devices to connect to a wide area network, usually the Internet, through wireless signals. WiFi provides wireless local area network (WLAN) access, supports multiple device connections, allows devices to roam between different access points, and usually requires a wireless access point (such as a router) to create a network.

[0050] Devices that support WiFi wireless communication technology include: smartphones, tablets, smart home devices, network devices, wearable devices, etc.

[0051] (3) BR

[0052] Traditional Bluetooth (Bluetooth Radio, BR) is also known as Bluetooth Basic Rate, which is a standard Bluetooth technology before the emergence of Bluetooth Low Energy (BLE) technology. Its features are: compared with BLE, BR has higher power consumption, but supports larger data transmission, such as audio streaming, and the communication distance is usually around 10 meters.

[0053] Devices that support BR wireless communication technology include: wireless earphones, car hands-free systems, wireless mice and keyboards, Bluetooth speakers, etc.

[0054] (3) P2P

[0055] Peer-to-Peer (P2P) is a network communication model in which each node (called "peer" or "Peer") can both request services as a client and provide services as a server. In this model, there is no centralized server or centralized control, and nodes can directly communicate and exchange data with each other.

[0056] 2.4G P2P refers to point-to-point communication technology operating in the 2.4GHz frequency band. It's commonly used for devices like wireless mice, keyboards, and game controllers, and has a relatively short communication range, typically within 10 meters. Devices supporting 2.4G P2P wireless communication technology include wireless mice and keyboards, game controllers, wireless cameras, and wireless print servers.

[0057] 5G P2P refers to point-to-point communication technology operating in the 5GHz frequency band. Compared to the 2.4GHz band, the 5GHz band offers wider bandwidth, less interference, and generally higher communication distances and speeds, making it suitable for high-speed data transmission. Devices supporting 5G P2P wireless communication technology include wireless network adapters, wireless backup cameras, and wireless multimedia transmission devices.

[0058] The above is a brief introduction to the nouns involved in the embodiments of this application, and no further details will be given below.

[0059] With the rapid development of terminal device hardware and software technologies, both hardware computing power and software algorithm capabilities have significantly increased in recent years. This substantial improvement in hardware computing power and software algorithm capabilities has provided a solid foundation for the implementation of a variety of emerging technologies. These emerging technologies include intelligent services, ultra-high-definition audio and video processing, ultra-low-latency human-computer interaction, artificial intelligence (AI) large-scale model reasoning, video super-resolution, and AI-enhanced video. These emerging technologies are the future market competition points for terminal devices.

[0060] However, while these emerging technologies improve the user experience, they also pose new challenges to the terminal devices themselves. For example, tasks related to emerging technologies are often computationally intensive, and processing these tasks often requires significant computing resources. However, current terminal devices lack computing resources, resulting in the following pain points when processing these computationally intensive tasks:

[0061] (1) The hardware capabilities of terminal devices of different types, configurations, and hardware platforms, such as mobile phones, personal access devices (PADs), and personal computers (PCs), vary greatly. In particular, the computing resources of some mobile phones and PADs with mid-to-low-end chip configurations are seriously insufficient to handle these tasks that require high computing power.

[0062] (2) For tasks with high computing power requirements, insufficient computing resources on the terminal device will inevitably lead to a long delay in the completion of the overall task calculation, causing users to experience delays and freezes when using real-time applications on the terminal device, such as voice assistant interaction and video super-resolution rendering, which greatly reduces the user experience.

[0063] (3) Tasks with high computing power requirements will inevitably increase the occupancy and overhead of the device's central processing unit (CPU) and / or graphics processing unit (GPU), resulting in reduced device battery life and even possible heating of the device.

[0064] To address the performance bottleneck of insufficient computing resources on a single terminal device, future terminal devices will shift from independent processing by a single terminal device to collaborative processing by multiple terminal devices when processing tasks requiring high computing power. By collaboratively processing tasks requiring high computing power between multiple terminal devices, the user experience can be guaranteed while avoiding excessive consumption of resources on a single terminal device.

[0065] The following example shows two end devices working together to process a task that requires high computing power.

[0066] (1) The mobile phone uses a large model to understand the content of the user's current display page to provide more accurate smart assistant interaction and smart service recommendations. In this process, the task of understanding the content of the mobile phone display page is divided into multiple subtasks, and some of the subtasks are transferred to the PC to utilize the PC's surplus GPU resources for calculation. After completion, the calculation results are transferred to the mobile phone for integration. With the assistance of PC computing power, the completion delay of the entire large model inference task is significantly accelerated, ensuring the user experience.

[0067] (2) Due to limitations of network conditions and other conditions, users can only obtain low-resolution video streams from the server on their mobile phones. The mobile phone then collaborates with the PC through near-field communication to transmit the low-bitrate video stream to the PC for video super-resolution and AI enhancement processing. After completion, the PC transmits the processed high-bitrate video to the mobile phone for rendering, ultimately allowing users to obtain a better video viewing experience even in weak network conditions.

[0068] However, when multiple terminal devices collaborate to process tasks, the tasks are not simply randomly assigned to other terminal devices. Instead, the impact of the collaborative processing of tasks by the terminal devices on the user experience needs to be considered. Otherwise, not only will the user experience of the user of this device fail to be optimized, but the user experience of users on other collaborative devices will also be degraded.

[0069] In view of this, an embodiment of the present application provides a task processing method, which is applied to a first terminal. The first terminal has a device collaboration function. When the device collaboration function of the first terminal is turned on, the second terminal can be determined from multiple terminals that have a first communication connection with the first terminal. A second terminal that can collaborate with the first terminal to process tasks, as well as multiple communication modes supported by the second terminal with the first terminal, can be determined. Since there can be multiple second terminals that can collaborate with the first terminal to process tasks, and the second terminal can also support multiple communication modes with the first terminal, in an embodiment of the present application, a target terminal and its corresponding target communication mode are determined from the second terminal based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes supported by the second terminal. The target terminal's ability to process historical tasks from the first terminal under the target communication mode is optimal. Afterwards, when it is determined that a task to be processed is generated, if the current communication mode between the first terminal and the target terminal is inconsistent with the target communication mode, it is necessary to establish a second communication connection with the target terminal according to the target communication mode, and send the task to be processed to the target terminal through the second communication connection, and the target terminal processes the task to be processed; if the current communication mode between the first terminal and the target terminal is consistent with the target communication mode, the task to be processed is sent to the target terminal through the current communication mode, and the target terminal processes the task to be processed, and the first terminal also receives the task processing result returned by the target terminal.

[0070] In the embodiment of the present application, the target terminal cooperates with the first terminal to process the pending task in the target communication mode, which makes up for the defect of insufficient computing resources when the first terminal processes the pending task and avoids excessive consumption of computing resources of a single terminal device. In addition, when determining the target terminal and its corresponding target communication mode for cooperating with the first terminal to process the pending task, the pending task is not simply randomly assigned to other terminal devices, but the target terminal and the target communication mode are determined based on the corresponding capability performance when the second terminal cooperates with the first terminal to process the historical task, wherein the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, so that when the target terminal cooperates with the first terminal to process the pending task, the possibility of the pending task being successfully executed can be increased, thereby improving the corresponding user experience of the first terminal. At the same time, since the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, this solution can greatly reduce the impact of the above-mentioned collaborative processing of the target terminal on the processing of the target terminal's own tasks, thereby avoiding deteriorating the user experience of the user on the collaborative device.

[0071] An embodiment of the present application also provides a task collaboration method, which is applied to a second terminal, the second terminal has a device collaboration function, and there is a first communication connection between the second terminal and the first terminal. The task collaboration method includes: when the device collaboration function of the second terminal is turned on, if a connection request for establishing a second communication connection is received from the first terminal, then a second communication connection is established with the first terminal based on the connection request for establishing the second communication connection; the pending tasks are received from the first terminal through the second communication connection, and the pending tasks are processed; if the pending tasks are received from the first terminal through the current communication method, the pending tasks are processed; and the task processing results are returned to the first terminal.

[0072] In the embodiment of the present application, the second terminal can cooperate with the first terminal to process the pending tasks from the first terminal and return the task processing results to the first terminal, thereby making up for the defect of insufficient computing resources when the first terminal processes the pending tasks and avoiding excessive consumption of computing resources of a single terminal device.

[0073] In the embodiment of the present application, the second terminal collaborates with the first terminal to process tasks, the above-mentioned task processing method is applied to the first terminal, and the above-mentioned task collaboration method is applied to the second terminal. The first terminal and the second terminal can be heterogeneous or non-heterogeneous terminal devices. If the first terminal and the second terminal are heterogeneous terminal devices, that is, the first terminal and the second terminal have significant differences in hardware architecture, software platform, network capabilities, computing power, storage capacity, energy management, user interface, etc.

[0074] The terminal device may be a mobile phone, a wearable device, a tablet computer (Pad), a personal computer (PC), a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal device.

[0075] In order to better understand the embodiments of the present application, the following takes the terminal device as a mobile phone as an example. Figure 1 The structure of the terminal device of the embodiment of the present application is introduced.

[0076] The terminal device 100 can 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 loudspeaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.

[0077] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0078] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0079] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0080] The memory in the processor 110 can also be provided for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can be called from the memory. Avoiding repeated access reduces the waiting time of the processor 110, thus improving the efficiency of the system.

[0081] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also power the electronic device through the power management module 141.

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

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

[0084] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G, etc. applied to terminal device 100. Mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.

[0085] The wireless communication module 160 can provide solutions for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.

[0086] In some embodiments, the antenna 1 and the mobile communication module 150 of the terminal device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology.

[0087] The terminal device 100 implements display functions through a GPU, a display screen 194, and an application processor, etc. 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 for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0088] Display screen 194 is used to display images, videos, and receive sliding operations. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, terminal device 100 may include one or more display screens 194.

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

[0090] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization for image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0091] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the image sensor. The image sensor can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or other format. In some embodiments, the terminal device 100 may include one or more cameras 193.

[0092] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

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

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

[0095] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.

[0096] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or touch vibration feedback. Indicator 192 can be an indicator light that can be used to indicate charging status, power level changes, messages, missed calls, notifications, etc.

[0097] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the terminal device 100 by inserting or removing the SIM card into or from the SIM card interface 195 .

[0098] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0099] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the aforementioned functionality. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functionality.

[0100] Therefore, the modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0101] The software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the terminal device 100. It should be noted that in the embodiment of the present application, the operating system of the electronic device may include but is not limited to (Symbian), (Android), 、 (iOS), (Blackberry), Hongmeng (HarmonyOS) and other operating systems, this application does not make any limitation.

[0102] Figure 2 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present invention.

[0103] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0104] The application layer can include a series of application packages.

[0105] like Figure 2 As shown, the application package may include applications such as camera, calendar, map, gallery, and video. The camera application is an application with photo and video recording functions. The electronic device can respond to the user opening the camera application to take photos or videos. It is understood that the photo and video recording functions of the camera application can also be called by other applications. The gallery stores images and videos captured by the electronic device, and may also store images or videos obtained via Bluetooth transmission or other means.

[0106] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0107] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a notification manager, a view system, a file system, and the like.

[0108] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0109] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0110] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0111] The view system includes visual controls, such as those that display text and images. The view system is used to build applications. A user interface can be composed of one or more views. For example, a user interface that includes a text notification icon might include a view that displays text and a view that displays an image.

[0112] The file system allows applications to read the contents of the file system and display them through the application.

[0113] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0114] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0115] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0116] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), image processing module, etc.

[0117] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0118] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0119] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0120] The image processing module is used to edit images.

[0121] The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver and a camera driver. In some embodiments, the camera driver is used to control the operation of the camera, and the display driver is used to control the display screen to display images.

[0122] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.

[0123] For ease of understanding, the present application embodiments are combined with the attached Figure 3, taking the first terminal as device A and the second terminal as device B and device C as an example, the scenario in which the second terminal (device B and device C) cooperates with the first terminal (device A) to process the target task (including subtask 1, subtask 2 and subtask 2) is described. Figure 3 Device A is a mobile phone, device B is a desktop computer, and device C is a tablet computer. This is for illustration only and is not intended to be used in conjunction with the attached Figure 3 Limits shown.

[0124] The method for the second terminal (device B and device C) to cooperate with the first terminal (device A) to process the target task is as follows Figure 4 As shown, the specific steps include:

[0125] Step S101: When device A detects that the device cooperation function is enabled, it sends a connection request broadcast to multiple terminals within its effective communication range.

[0126] Device A supports the device collaboration function. Specifically, device A may be provided with a switch control. When the switch control is turned on, the device collaboration function is turned on; when the switch control is turned off, the device collaboration function is turned off.

[0127] When device A detects that the device collaboration function is turned on, it sends a connection request broadcast to multiple terminal devices within its effective communication range. The effective communication range of device A refers to the Bluetooth connection range of device A, the wireless LAN connection range of device A, etc.

[0128] It is worth noting that after the collaboration function is turned on, device A can also periodically send connection request broadcasts to terminal devices within its effective communication range, thereby actively discovering new terminal devices within the effective communication range of device A.

[0129] Step S102: Device B and device C establish a first communication connection with device A after receiving the connection request broadcast.

[0130] Assume that the effective communication range of device A refers to the Bluetooth connection range of device A, the Bluetooth of devices B and C are turned on, and devices B and C are within the Bluetooth connection range of device A. Then, after device A sends a connection request broadcast to terminal devices within its Bluetooth connection range, devices B and C can receive the connection request broadcast. The connection request broadcast can be a Bluetooth self-discovery broadcast. After devices B and C send Bluetooth connection requests to device A based on the Bluetooth self-discovery broadcast, devices B and C establish a first communication connection with device A. The communication mode of this first communication connection is Bluetooth communication mode.

[0131] Assume that device A's effective communication range refers to the wireless LAN connection range of device A. Devices B and C have their WiFi turned on and are in the same wireless LAN as device A. After device A sends a connection request broadcast to terminal devices within its wireless LAN connection range, devices B and C are able to receive the connection request broadcast. The connection request broadcast can be a CoAP discovery broadcast. Based on the broadcast information, devices B and C initiate a TCP socket connection to device A. Then, devices B and C establish a first communication connection with device A, using WiFi as the communication mode.

[0132] Step S103: Device A sends the first device information to device B and device C.

[0133] Step S104: Device B sends the second device information to device A, and device C sends the third device information to device A.

[0134] After a first communication connection is established between device A and device B, devices A and B can exchange device information. Specifically, device A sends its first device information to device B, and device B sends its second device information to device A. Similarly, after a first communication connection is established between device A and device C, devices A and C can exchange device information. Specifically, device A sends its first device information to device C, and device C sends its third device information to device A.

[0135] The first device information, the second device information, and the third device information include one or more of: available computing power, remaining power, whether it is in a charging state, and supported communication modes. The available computing power can be the available computing power of the terminal device's CPU or GPU, expressed as a percentage. The supported communication modes can be obtained by querying the terminal device's communication capabilities, and the supported communication modes may include one or more of: low-power Bluetooth communication mode, traditional Bluetooth communication mode, WiFi communication mode, 2.4G point-to-point communication mode, and 5G point-to-point communication mode.

[0136] It is worth noting that the specific content of the above device information is only for illustration and can be added or deleted as needed in actual applications.

[0137] Step S105: Device A determines, from devices B and C based on the first device information, the second device information, and the third device information, a second terminal that can collaborate with the first terminal to process tasks, and multiple communication modes supported by the second terminal with the first terminal.

[0138] Device A can determine whether device B can cooperate with device A to process tasks based on one or more of the available computing power, remaining power, and whether it is in a charging state in the second device information, that is, determine whether device B is a collaborative device; device A can determine whether device C can cooperate with device A to process tasks based on one or more of the available computing power, remaining power, and whether it is in a charging state in the third device information, that is, determine whether device C is a collaborative device.

[0139] Specifically, certain judgment conditions can be set to determine whether device B and device C are collaborative devices or non-collaborative devices. For example, if the available computing power of device B is greater than or equal to a first threshold, and the remaining power of device B is greater than or equal to a second threshold, then device B is determined to be a collaborative device; for another example, if the available computing power of device B is greater than or equal to the first threshold, and device B is in a charging state, then device B is determined to be a collaborative device; for another example, if device C is in a charging state, but the available computing power of device C is less than the first threshold, then device C is determined to be a non-collaborative device.

[0140] If it is determined that both device B and device C can collaborate, the multiple communication methods supported by device B with the first terminal are determined based on the communication methods supported by device A and the communication methods supported by device B. Furthermore, the multiple communication methods supported by device C with the first terminal are determined based on the communication methods supported by device A and the communication methods supported by device C.

[0141] Specifically, the same communication mode supported by device A and the same communication mode supported by device B can be used as the multiple communication modes supported by device B with the first terminal. For example, if the communication modes supported by device A include: low-power Bluetooth communication mode, traditional Bluetooth communication mode, WiFi communication mode, 2.4G point-to-point communication mode, and 5G point-to-point communication mode; and the communication modes supported by device B include: low-power Bluetooth communication mode, WiFi communication mode, and 5G point-to-point communication mode, then the multiple communication modes supported by device B with the first terminal include: low-power Bluetooth communication mode, WiFi communication mode, and 5G point-to-point communication mode.

[0142] Similarly, if the communication methods supported by device C include: low-power Bluetooth communication method, traditional Bluetooth communication method, 2.4G point-to-point communication method, and 5G point-to-point communication method, then the multiple communication methods supported by device C with the first terminal include: low-power Bluetooth communication method, traditional Bluetooth communication method, 2.4G point-to-point communication method, and 5G point-to-point communication method.

[0143] Step S106: Device A determines a target terminal and its corresponding target communication mode from devices B and C based on the performance of devices B and C in processing historical tasks from the first terminal under the multiple communication modes supported by the first terminal.

[0144] Because the latency of processing tasks for different terminal devices is likely to be different, and the latency and power consumption of processing tasks for the same terminal device under different communication modes may also vary, in this embodiment, based on the capabilities of device B and device C in processing historical tasks from the first terminal under the multiple communication modes they support, a target terminal and its corresponding target communication mode are determined from device B and device C, with the target terminal having the optimal capability of processing historical tasks from the first terminal under the target communication mode.

[0145] It's worth noting that this solution assumes that devices B and C have already collaborated with device A to process historical tasks. If devices B and C haven't collaborated with device A to process historical tasks, then before step S106, device A must publish the historical tasks to devices B and C. Devices B and C must then process the historical tasks using the multiple communication methods they support with the first terminal and obtain performance data corresponding to the capabilities of devices B and C in processing historical tasks using each of the communication methods they support with the first terminal.

[0146] Step S107: Device A generates the current subtask. If the current target terminal is device B and the target communication mode is 5G point-to-point communication mode, device A sends a connection request to device B to establish a 5G point-to-point communication connection based on the 5G point-to-point communication mode.

[0147] Assume that the target task of device A includes three subtasks to be executed in sequence, subtask 1, subtask 2, and subtask 3. When device A generates the current subtask (subtask 1), if the current target terminal is device B and the target communication mode is 5G point-to-point communication mode, device A sends a connection request to device B to establish a 5G point-to-point communication connection based on the 5G point-to-point communication mode.

[0148] Step S108: Device B establishes a connection with device A based on the connection request for establishing a 5G point-to-point communication connection.

[0149] Step S109: Device A sends the current subtask to device B via a 5G point-to-point communication connection.

[0150] Step S110: Device B processes the current subtask and returns the task processing result to device A.

[0151] It's worth noting that in step S109, after device A sends the current subtask (subtask 1) to device B, the current subtask in device A changes, becoming the next subtask to be processed, such as subtask 2. Therefore, the "current subtask" in steps S109 and S110 is not the same subtask as the "current subtask" after steps S109 and S110.

[0152] Step S111: Device A re-determines the target terminal as device C based on the task processing result, and the target communication mode is 5G point-to-point communication mode, then device A sends a connection request to device C to establish a 5G point-to-point communication connection based on the 5G point-to-point communication mode.

[0153] After device B returns the task processing result, the capability of device B to process the historical tasks from the first terminal under the multiple communication modes supported by the device B also changes. Therefore, the target terminal and target communication mode need to be re-determined.

[0154] Step S112: Device C establishes a connection with device A based on a connection request to establish a 5G point-to-point communication connection.

[0155] Step S113: Device A sends the current subtask to device C via a 5G point-to-point communication connection.

[0156] Assume that during the execution of steps S109 to S112, device A has already sent subtask 2 to device B via the 5G point-to-point communication connection, and device B processes subtask 2. Then, the current subtask in step S122 is subtask 3, and device A sends subtask 3 to device C via the 5G point-to-point communication connection.

[0157] Step S114: Device C processes the current subtask and returns the task processing result to device A.

[0158] Step S115: Device A integrates the received multiple task processing results.

[0159] The target terminal processes the to-be-processed task in the target communication mode in the embodiments of the present application, which makes up for the defect of insufficient computing resources when the first terminal processes the to-be-processed task, and avoids excessive consumption of computing resources of a single terminal device. When determining the target terminal and the corresponding target communication mode for processing the to-be-processed task in cooperation with the first terminal, the to-be-processed task is not simply randomly assigned to other terminal devices, but the target terminal and the target communication mode are determined according to the capability performance of the second terminal in processing historical tasks from the first terminal. The capability performance of the target terminal in processing historical tasks from the first terminal in the target communication mode is optimal, so that when the target terminal processes the to-be-processed task in cooperation with the first terminal, the possibility of successfully executing the to-be-processed task can be improved, and the user experience of the corresponding user of the first terminal can be improved. At the same time, since the capability performance of the target terminal in processing historical tasks from the first terminal in the target communication mode is optimal, the above-mentioned cooperation processing of the target terminal can greatly reduce the impact on the processing of the target terminal's own tasks, thereby avoiding the degradation of the user experience of the cooperative device.

[0160] It should be noted that the application scenarios shown in the above examples are only illustrative, and can also be applied to other scenarios, which will not be described one by one in the embodiments of the present application.

[0161] For example, Figure 5 A flowchart of a task processing method provided in the embodiments of the present application can be applied to a first terminal. As shown in Figure 5 The task processing method in the embodiments of the present application can include the following steps:

[0162] Step S201: In a case where a device cooperation function of the first terminal is in an open state, determining a second terminal capable of processing a task in cooperation with the first terminal and a plurality of communication modes supported by the second terminal and capable of communicating with the first terminal from a plurality of terminals having a first communication connection with the first terminal.

[0163] The first terminal supports the device cooperation function. Specifically, the first terminal can be provided with a switch control. When the switch control is opened, the device cooperation function is opened. When the switch control is closed, the device cooperation function is closed.

[0164] In a case where the device cooperation function of the first terminal is in an open state, if the first terminal has established a first communication connection with a plurality of terminals in an effective communication range of the first terminal. As shown in Figure 6 If the first terminal is device A, in a case where the device cooperation function of device A is in an open state, device A, device D and device E are in the same wireless local area network range, and device A has established a WiFi communication connection with device D and device E. In addition, device A has established a Bluetooth communication connection with device B, device C and device E in the Bluetooth connection range of device A. Figure 6 The “solid line” in the figure indicates that the devices are connected via WiFi, and the “dashed line” indicates that the devices are connected via Bluetooth.

[0165] After the first terminal has established a first communication connection with multiple terminals within its effective communication range, the first terminal exchanges device information with the multiple terminals within its effective communication range. The first terminal determines, based on its own device information and the device information of the multiple terminals, a second terminal that can collaborate with the first terminal to process tasks, and multiple communication modes supported by the second terminal with the first terminal from the multiple terminals that have the first communication connection with the first terminal.

[0166] Exemplarily, device information includes at least one or more of available computing power, remaining battery power, whether the device is in a charging state, and supported communication modes. Available computing power may be the available computing power of the terminal device's CPU or GPU, expressed as a percentage. Supported communication modes can be obtained by querying the terminal device's communication capabilities, and the supported communication modes may include one or more of: Bluetooth low energy communication mode, traditional Bluetooth communication mode, WiFi communication mode, 2.4G point-to-point communication mode, and 5G point-to-point communication mode.

[0167] In one possible implementation, based on the device information of the first terminal and the device information of multiple terminals, a second terminal that can cooperate with the first terminal to process tasks and multiple communication modes supported by the second terminal with the first terminal are determined from multiple terminals that have a first communication connection with the first terminal, including: based on one or more of the available computing power, remaining power, and whether the terminals are in a charging state, determining the second terminal that can cooperate with the first terminal to process tasks from multiple terminals; based on the communication modes supported by the first terminal and the communication modes supported by the second terminal, determining the multiple communication modes supported by the second terminal with the first terminal.

[0168] First, a second terminal that can collaborate with a first terminal to process a task may be determined from multiple terminals in the following manner.

[0169] Whether each of the multiple terminals is a collaborative device or a non-collaborative device can be determined based on one or more of the available computing power, remaining battery life, and whether the terminals are in a charging state. A "collaborative device" here refers to a device that can collaborate with the first terminal to process tasks, while a "non-collaborative device" refers to a device that cannot collaborate with the first terminal to process tasks. In this embodiment, a collaborative device is also referred to as a "second terminal."

[0170] Exemplarily, determining a second terminal from multiple terminals that can collaborate with a first terminal to process a task based on one or more of the available computing power, remaining power, and whether the terminals are in a charging state includes: determining the terminal as the second terminal that can collaborate with the first terminal to process a task if one or more of the available computing power, remaining power, and whether the terminals are in a charging state meet a first preset condition. The first preset condition is: the available computing power of the terminal is greater than or equal to a first threshold and the remaining power of the terminal is greater than or equal to a second threshold; or, the available computing power of the terminal is greater than or equal to the first threshold, the remaining power of the terminal is less than the second threshold, and the terminal is in a charging state.

[0171] Among the multiple terminals that have a first communication connection with the first terminal, there may be both collaborative devices and non-collaborative devices. In this embodiment, a first preset condition can be set, and based on the first preset condition, a second terminal that can collaborate with the first terminal to process tasks is screened out from the multiple terminals that have a first communication connection with the first terminal. For example, if the available computing power of the terminal is greater than or equal to the first threshold, and the remaining power of the terminal is greater than or equal to the second threshold, the terminal is determined to be a collaborative device; for another example, if the available computing power of the terminal is greater than or equal to the first threshold, the remaining power of the terminal is less than the second threshold, and the terminal is in a charging state, the terminal device is determined to be a collaborative device. For another example, if the terminal is in a charging state, but the available computing power of the terminal is less than the first threshold, the terminal is determined to be a non-collaborative device; or, if the available computing power of the terminal is greater than or equal to the first threshold, but the remaining power of the terminal is less than the second threshold, and the terminal is not in a charging state, the terminal can be determined to be a non-collaborative device.

[0172] In the embodiment of the present application, the first preset condition of the terminal's available computing power and the terminal's power consumption must both meet certain conditions. In actual applications, it is also possible to set the first preset condition to either the terminal's available computing power or the terminal's power consumption. The above first preset condition is only an example. In actual applications, the first preset condition can be set as needed and will not be repeated here.

[0173] Assume that the device information of devices B, C, D, and E that have a first communication connection with the first terminal (device A) is as shown in Table 1:

[0174] Table 1

[0175]

[0176] In Table 1 above, BLE represents Bluetooth low energy communication mode, BR represents traditional Bluetooth communication mode, 2.4G P2P represents 2.4G point-to-point communication mode, 5G P2P represents 5G point-to-point communication mode, and WIFI represents WiFi communication mode.

[0177] Assuming that the first threshold in the above-mentioned first preset condition is 50% and the second threshold is 40%, since the remaining power of device B is less than the second threshold of 40% and is not in a charging state, device B is a non-cooperative device. Since the available computing power of device C is less than the first threshold of 50%, device C is a non-cooperative device; since the available computing power of device D is greater than the first threshold of 50%, and the remaining power is greater than the second threshold of 40%, device D is a cooperative device; since the available computing power of device E is greater than the first threshold of 50%, and the remaining power is greater than the second threshold of 40%, device E is a cooperative device. In summary, the above-mentioned devices B and C are non-cooperative devices, and devices D and E are cooperative devices. That is to say, among the four terminals that have a first communication connection with the first terminal (device A), device D and device E are the second terminals that can cooperate with the first terminal (device A) to process tasks.

[0178] Secondly, the multiple communication modes supported by the second terminal with the first terminal may be determined in the following manner.

[0179] The same communication mode among the communication modes supported by the first terminal and the communication modes supported by the second terminal may be determined as the multiple communication modes supported by the second terminal with the first terminal.

[0180] Assuming that the communication methods supported by the first terminal (device A) include: BLE, BR, 2.4G P2P, 5G P2P, and WIFI, the communication methods supported by device D with the first terminal (device A) include: 2.4G P2P, 5G P2P, and WIFI, and the communication methods supported by device E with the first terminal (device A) include: BLE, BR, 2.4GP2P, 5G P2P, and WIFI.

[0181] Step S202: determining a target terminal and its corresponding target communication mode from the second terminal according to the capability performance of the second terminal in processing the historical tasks from the first terminal under the multiple communication modes supported by the second terminal with the first terminal.

[0182] The target terminal's ability to process historical tasks from the first terminal in the target communication mode is optimal.

[0183] After determining the second terminal and the multiple communication methods it supports with the first terminal, it is necessary to determine a target terminal and target communication method from the multiple second terminal + communication method combinations, so that the target terminal's ability to execute historical tasks under the target communication method is optimal. Assume that the second terminals include device D and device E. Device D supports three communication methods with the first terminal (device A), and device E supports five communication methods with the first terminal (device A). Therefore, there are eight possible combinations of second terminals and communication methods. From these eight combinations, it is necessary to find the combination (i.e., target terminal + target communication method) that performs best in processing historical tasks.

[0184] In this embodiment, the capability performance includes latency and power consumption. Optimal capability performance indicates that latency and power consumption are balanced, that is, the difference between latency and power consumption is not too large.

[0185] Specifically, the combination (i.e., target terminal + target communication method) with the best performance in processing historical tasks can be found in the following way.

[0186] Exemplarily, based on the ability performance of the second terminal in processing historical tasks from the first terminal under multiple communication modes supported with the first terminal, a target terminal and its corresponding target communication mode are determined from the second terminal, including: determining the actual ability gain of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal based on the ability performance of the second terminal in processing historical tasks from the first terminal under multiple communication modes supported with the first terminal; determining the target terminal and its corresponding target communication mode from the second terminal based on one or more of the actual ability gain of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal, the total number of historical tasks, and the number of historical tasks from the first terminal processed by the second terminal under each communication mode supported with the first terminal.

[0187] In this embodiment, the actual capability gain corresponding to the ability of the second terminal and the communication mode to execute historical tasks can be determined based on the ability performance of the combination of the second terminal and the communication mode, wherein the better the capability performance, the greater the corresponding actual capability gain. In this way, the combination with the best ability performance for processing historical tasks (i.e., the target terminal + target communication mode) can be determined based on one or more of the actual capability gain corresponding to the historical tasks processed by the second terminal under each supported communication mode with the first terminal, the total number of historical tasks, and the number of historical tasks processed by the second terminal under each supported communication mode with the first terminal. This provides a method for measuring the quality of the ability performance for processing historical tasks based on the actual capability gain.

[0188] The following describes how to measure the performance of handling historical tasks based on actual performance gains:

[0189] Exemplarily, based on the ability performance of the second terminal in processing historical tasks from the first terminal under multiple communication modes supported with the first terminal, the actual ability benefit of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal is determined, including: when the delay corresponding to the historical task is less than or equal to the delay requirement, based on the delay and power consumption corresponding to the historical tasks from the first terminal under multiple communication modes supported with the first terminal, the actual ability benefit of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal is determined; when the delay corresponding to the historical task is greater than the delay requirement, based on the power consumption and preset penalty value corresponding to the historical tasks from the first terminal under multiple communication modes supported with the first terminal, the actual ability benefit of the second terminal in processing historical tasks from the first terminal under each communication mode supported with the first terminal is determined.

[0190] First, the delay Ta corresponding to the second terminal processing the historical task a from the first terminal under the multiple communication modes supported by the first terminal can be obtained by observing the time from the first terminal sending the historical task a to receiving the task processing result of the historical task a.

[0191] Secondly, the power consumption Ea of the second terminal for processing the historical task a from the first terminal under the multiple communication modes supported by the second terminal can be calculated by the following formula:

[0192] Ea=P k *(T a,tx +T a,rx )*2

[0193] Among them, P k is the power consumption required to send data per unit time under each communication mode, T a,tx is the time required to send historical task a, P k ×T a,tx It represents the power consumption required to send the historical task a. a,rx is the time required to receive the task processing result of historical task a, P k ×T a,rx Indicates the power consumption required to receive the task processing result of historical task a.

[0194] In this embodiment, it is considered that the power consumption of the terminal receiving and transmitting the same data under the same communication mode (for example, BLE or P2P) is the same, that is, the power consumption of the first terminal transmitting the historical task a is the same as the power consumption of the second terminal receiving the historical task a, and the power consumption of the first terminal receiving the task processing of the historical task a is the same as the power consumption of the second terminal transmitting the task processing of the historical task a. Therefore, multiplying 2 directly in the above formula can obtain the sum of the power consumption of the first terminal and the second terminal transmitting and receiving data, which can also be calculated respectively in actual problems, and will not be described in this embodiment.

[0195] Finally, the formula for determining the actual capability benefit R(a) according to the time delay Ta and the power consumption Ea is as follows:

[0196]

[0197] In the above formula, ta is the time delay requirement of the historical task a, and there is a corresponding time delay requirement ta for each historical task a. For example, for multiple video stream processing tasks, if the third video stream processed and completed starts to play before the task processing result of the second video stream is received, then even if the task processing result of the second video stream is received later, it will not be played because the task of the second video stream has been invalidated at this time.

[0198] Therefore, each historical task a will set a corresponding time delay requirement, and if the time delay of processing the historical task a does not exceed the corresponding time delay requirement Ta, that is, Ta≤ta, then the actual capability benefit R(a) can be determined according to the time delay Ta and the power consumption Ea, that is, R(a)=α*1 / Ta-β*Ea. Wherein, α is a coefficient set for the time delay Ta, and β is a coefficient set for the power consumption Ea, the time delay Ta is inversely proportional to R(a), the greater the time delay Ta, the smaller the R(a); the power consumption Ea is also inversely proportional to R(a), the greater the power consumption Ea, the smaller the R(a).

[0199] If the time delay of processing the historical task a exceeds the corresponding time delay requirement Ta, that is, Ta>ta, then the historical task a has been invalidated, and the task processing result of the historical task a cannot be used by the first terminal. At this time, R(a)=-β*Ea-C, wherein the time delay related benefit of executing the historical task a is 0; the power consumption Ea is inversely proportional to R(a), the greater the power consumption Ea, the smaller the R(a). In addition, a preset penalty term C can be set to punish the power consumption related benefit of processing the historical task a.

[0200] In the above formula, the coefficients α, β, and the preset penalty term C are all constants, for example, α can be set to 1000, β can be set to 0.01, and C can be set to 1. In actual application, they can be set by experience, which is not limited in this embodiment.

[0201] The following describes how to determine the target terminal and its corresponding target communication mode from the second terminal:

[0202] In this embodiment, there are two ways to determine the target terminal and its corresponding target communication mode from the second terminal:

[0203] Method 1: Determine the expected capacity benefit corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal based on the actual capacity benefit corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal, the total number of historical tasks, and the number of historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal; determine the target terminal and its corresponding target communication mode from the second terminal based on the expected capacity benefit corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal.

[0204] In this embodiment, the problem of determining the target terminal and target communication method from multiple second terminal + communication method combinations can be viewed as an optimal scheduling problem, namely, selecting the optimal target communication method and its corresponding target terminal for each pending task. However, as the number of terminals within the effective connection range of the first terminal (device A) increases, the number of selectable second terminal and communication method combinations increases exponentially, and the resulting solution space for the overall scheduling optimization problem becomes extremely large. Rule-based algorithms are therefore unsuitable. Therefore, this embodiment proposes an optimal task scheduling algorithm based on reinforcement learning.

[0205] Specifically, the problem of determining the combination (i.e., target terminal and target communication method) with the best performance in executing historical tasks from multiple combinations of second terminals and communication methods is transformed into a multi-armed bandit (MAB) problem. Each second terminal and communication method combination can be regarded as an "arm" in the MAB problem. For a given task, selecting any of the arms will result in corresponding benefits.

[0206] In response to the MAB problem, the following decision formula is proposed in this embodiment:

[0207]

[0208] Wherein, i is the i-th combination among multiple combinations of second terminals + communication modes, is the expected capacity gain corresponding to the historical task processed by the combination of the i-th second terminal + communication mode, is the average revenue of the i-th second terminal + communication mode combination in processing historical tasks, N is the total number of historical tasks, n iThe number of historical tasks processed for the i-th second terminal + communication mode combination, where n i Less than N; U and ε are constants, where U can be 1 and ε can be 0.1.

[0209] The average profit of the i-th second terminal + communication mode combination in processing historical tasks The actual capacity benefit R of each historical task can be processed according to the combination of i second terminals + communication modes, and the number of historical tasks processed by the combination of second terminals + communication modes n i To calculate it.

[0210] The average return in the above formula is The formula after this is represented by the exploration term. A larger value for the exploration term indicates a greater incentive to select other second terminal + communication mode combinations, while a smaller value for the exploration term indicates a greater preference for the current second terminal + communication mode combination. In practice, the two constants U and ε can be set based on practical experience.

[0211] According to the above decision formula, the expected capability benefit corresponding to the processing of historical tasks by each second terminal + communication mode combination can be determined, and the second terminal + communication mode combination with the largest expected capability benefit corresponding to the processing of historical tasks is determined as the target terminal and target communication mode.

[0212] In this implementation, the expected capacity benefit corresponding to the second terminal processing historical tasks from the first terminal under each communication mode supported by the first terminal is calculated, and the target terminal and its corresponding target communication mode are determined from the second terminal based on the expected benefit capacity, and the result is more accurate.

[0213] Method 2: Determine the target terminal and its corresponding target communication method from the second terminal based on the actual capacity gain corresponding to the historical tasks processed by the second terminal under each communication method supported by the first terminal, and the number of historical tasks processed by the second terminal under each communication method supported by the first terminal.

[0214] Based on the actual capacity gain R corresponding to the historical tasks processed by each second terminal + communication mode combination and the number of historical tasks processed by this second terminal + communication mode combination, the average gain corresponding to the historical tasks processed by each second terminal + communication mode combination is calculated. The second terminal + communication mode combination with the highest average gain corresponding to the historical tasks processed is determined as the target terminal and target communication mode.

[0215] In the present implementation, the actual capability gain corresponding to the historical task from the first terminal in each communication mode supported by the second terminal is determined, and then the target terminal and the corresponding target communication mode are determined from the second terminal according to the actual capability gain, which is simple to calculate.

[0216] Step S203: If it is determined that the to-be-processed task is generated, it is judged whether the current communication mode of the first terminal and the target terminal is consistent with the target communication mode. If not, step S204 is entered; if yes, step S206 is entered.

[0217] If the first terminal determines that the to-be-processed task is generated, it can be judged whether the current communication mode of the first terminal and the target terminal is consistent with the target communication mode. If not, step S204 (a second communication connection is established according to the target communication mode and the target terminal) is entered; if yes, step S206 (the to-be-processed task is sent to the target terminal through the current communication mode, and the target terminal processes the to-be-processed task) is entered.

[0218] Step S204: A second communication connection is established according to the target communication mode and the target terminal.

[0219] Suppose the determined target terminal is device D, and the target communication mode is 2.4G P2P. If the current communication mode of the first terminal (device A) and device D is a WIFI communication mode, a second communication connection (2.4G P2P connection) needs to be established between the first terminal (device A) and the target terminal (device D) based on the target communication mode (2.4G P2P).

[0220] Step S205: The to-be-processed task is sent to the target terminal through the second communication connection, and the target terminal processes the to-be-processed task.

[0221] After the second communication connection between the first terminal (device A) and the target terminal (device D) is established, the to-be-processed task is sent to the target terminal through the second communication connection, and the target terminal (device D) processes the to-be-processed task.

[0222] Step S206: The to-be-processed task is sent to the target terminal through the current communication mode, and the target terminal processes the to-be-processed task.

[0223] Suppose the determined target terminal is device D, and the target communication mode is WIFI. If the current communication mode of the first terminal (device A) and device D is also a WIFI communication mode, the to-be-processed task can be directly sent to the target terminal (device D) through the current communication mode, and the target terminal (device D) processes the to-be-processed task.

[0224] After the above steps S205 and S206, step S207 is executed.

[0225] Step S207: Receive the task processing result returned by the target terminal.

[0226] The first terminal receives the task processing result returned by the target terminal.

[0227] In the embodiment of the present application, the target terminal cooperates with the first terminal to process the pending task in the target communication mode, which makes up for the defect of insufficient computing resources when the first terminal processes the pending task and avoids excessive consumption of computing resources of a single terminal device. In addition, when determining the target terminal and its corresponding target communication mode for cooperating with the first terminal to process the pending task, the pending task is not simply randomly assigned to other terminal devices, but the target terminal and the target communication mode are determined based on the corresponding capability performance when the second terminal cooperates with the first terminal to process the historical task, wherein the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, so that when the target terminal cooperates with the first terminal to process the pending task, the possibility of the pending task being successfully executed can be increased, thereby improving the corresponding user experience of the first terminal. At the same time, since the target terminal's capability performance in processing the historical task from the first terminal in the target communication mode is optimal, this solution can greatly reduce the impact of the above-mentioned collaborative processing of the target terminal on the processing of the target terminal's own tasks, thereby avoiding deteriorating the user experience of the user on the collaborative device.

[0228] The second aspect of the embodiment of the present application provides a task processing method, such as Figure 7 The following steps are shown.

[0229] Step S301: When the device collaboration function of the first terminal is turned on, determine a second terminal that can collaborate with the first terminal to process tasks from multiple terminals that have a first communication connection with the first terminal, and multiple communication methods supported by the second terminal with the first terminal.

[0230] Step S302: Based on the ability performance of the second terminal to process historical tasks corresponding to the first terminal under the multiple communication modes supported by the first terminal, determine the target terminal and its corresponding target communication mode from the second terminal, and the ability performance of the second terminal to process historical tasks, including: the ability performance of the second terminal to process subtasks preceding the current subtask.

[0231] Step S303: If it is determined that the current subtask is generated, it is determined whether the current communication mode of the first terminal and the target terminal is consistent with the target communication mode. If it is determined to be not, the process proceeds to step S304; if it is determined to be yes, the process proceeds to step S306.

[0232] Step S304: Establish a second communication connection with the target terminal according to the target communication mode.

[0233] Step S305: Send the current subtask to the target terminal via the second communication connection, and the target terminal processes the current subtask.

[0234] Step S306: Send the current subtask to the target terminal via the current communication method, and the target terminal processes the current subtask.

[0235] After the above steps S305 and S306, step S307 is executed.

[0236] Step S307: Receive the task processing result returned by the target terminal.

[0237] After step S307, the process returns to step S302.

[0238] The above steps S301 to S307 are substantially the same as steps 201 to S207 in the above embodiment. To avoid repetition, they are not further described in this embodiment. The difference between this embodiment and the above embodiment is that the task to be processed in this embodiment is the current subtask to be processed among multiple subtasks to be processed in sequence. The second terminal's ability to process the corresponding historical task includes: the second terminal's ability to process the corresponding subtask located before the current subtask. After step S307, it is necessary to return to step S302.

[0239] For example, suppose that when executing the current subtask (Task 1), the target terminal is determined to be device D, and the target communication mode is 2.4G P2P. After completing Task 1, the process returns to step S302, and based on the performance of device D in completing Task 1 under the 2.4G P2P communication mode, the target terminal is re-determined to be device E, and the target communication mode is BR. At this point, device E's performance in executing the current subtask (Task 2) under the BR communication mode is optimal. If device D is still selected to execute the current subtask (Task 2) under the 2.4G P2P communication mode, the latency required for device D to execute the current subtask (Task 2) under the 2.4G P2P communication mode may be greater, or the power consumption may be higher, which may impair the user experience when the first terminal or the target terminal processes the pending task.

[0240] After each subtask is processed, the second terminal processing the subtask and the corresponding communication mode of the second terminal change, so the target terminal and the corresponding target communication mode need to be updated in time, so as to ensure that the performance of the target terminal in processing the current subtask in the target communication mode is optimal. The scheme can greatly reduce the impact of the above-mentioned cooperative processing of the target terminal on the processing of the target terminal itself, thereby avoiding the degradation of the user experience on the cooperative device.

[0241] In a third aspect, the embodiments of the present application provide a task processing method, as shown in the following. Figure 8 The method comprises the following steps.

[0242] Step S401: In the case where it is detected that the device cooperation function is turned on, a first communication connection is established with a plurality of terminals within the effective communication range of the first terminal.

[0243] The effective communication range refers to the Bluetooth connection range of the first terminal and / or the wireless local area network connection range in which the first terminal is located.

[0244] The first terminal supports the device cooperation function. Specifically, the first terminal can be provided with a switch control. When the switch control is turned on, the device cooperation function is turned on. When the switch control is turned off, the device cooperation function is turned off.

[0245] In the case where it is detected that the device cooperation function is turned on, the first terminal sends a connection request broadcast to a plurality of terminal devices within its effective communication range. The effective communication range of the first terminal refers to the Bluetooth connection range of the first terminal and / or the wireless local area network connection range in which the first terminal is located.

[0246] Suppose the first terminal is device A, the effective communication range of the first terminal refers to the Bluetooth connection range of device A, the Bluetooth of device B and device C is turned on, and device B and device C are located within the Bluetooth connection range of device A. After device A sends a connection request broadcast to the terminal devices within its Bluetooth connection range, device B and device C can receive the connection request broadcast. The connection request broadcast can be a Bluetooth self-discovery broadcast. After device B and device C send a Bluetooth connection request to device A based on the Bluetooth self-discovery broadcast, device B and device C establish a first communication connection with device A. The communication mode of the first communication connection is Bluetooth communication.

[0247] Assuming the first terminal is device A, the effective communication range of the first terminal refers to the wireless local area network connection range in which device A is located, the WiFi of device B and device C is turned on and device B and device C are in the same wireless local area network as device A, then after device A sends a connection request broadcast to the terminal devices in the wireless local area network connection range in which device A is located, device B and device C can receive the connection request broadcast, and the connection request broadcast can be a CoAP discovery broadcast. After device B and device C initiate a TCP socket connection to device A based on the broadcast information, device B and device C establish a first communication connection with device A, and the communication mode of the first communication connection is a WiFi communication mode.

[0248] It is worth noting that if device B and device C are not only located in the Bluetooth connection range of device A, but also in the same wireless local area network as device A, then in the case where the effective communication range of device A includes both the Bluetooth connection range and the wireless local area network connection range in which device A is located, the communication mode of the first communication connection between device A and device B includes both the Bluetooth communication mode and the WiFi communication mode, in other words, there are two communication modes between device A and device B, namely the Bluetooth communication mode and the WiFi communication mode. Similarly, there are two communication modes between device A and device C, namely the Bluetooth communication mode and the WiFi communication mode.

[0249] Step S402: receiving device information of a plurality of terminals that have a first communication connection with the first terminal.

[0250] The device information includes one or more of available computing power, remaining power, whether in a charging state, and supported communication modes. The available computing power can be the available computing power of the CPU or GPU of the terminal device, expressed in percentage. The supported communication modes can be obtained by querying the communication capabilities of the terminal device, and the supported communication modes can include one or more of the low-power Bluetooth communication mode, the traditional Bluetooth communication mode, the WiFi communication mode, the 2.4G point-to-point communication mode, and the 5G point-to-point communication mode. It is worth noting that the specific content of the above device information is only an example for illustration, and actual applications can be added or deleted as needed.

[0251] After the first terminal establishes a first communication connection with a plurality of terminals, the first terminal receives device information from the plurality of terminals, for example: assuming that the first terminal is device A, and the plurality of terminals that have a first communication connection with the first terminal include device B and device C. Device A sends first device information of device A to device B and device C, device B sends second device information of device B to device A, and device C sends third device information of device C to device A.

[0252] The first device information, the second device information, and the third device information can include one or more of available computing power, remaining power, whether in a charging state, and supported communication modes.

[0253] Step S403: According to the device information of the first terminal and the device information of the plurality of terminals, determining, from the plurality of terminals having the first communication connection with the first terminal, a second terminal capable of processing the task cooperatively with the first terminal and a plurality of communication modes supported by the second terminal and the first terminal.

[0254] After obtaining the device information of the plurality of terminals, the first terminal can determine, from the plurality of terminals, a second terminal capable of processing the task cooperatively with the first terminal according to the device information (one or more of available computing power, remaining power, and whether in a charging state) of the plurality of terminals.

[0255] Suppose the first terminal is device A, and device A obtains the second device information and the third device information of a plurality of terminals (device B and device C). Device A can determine whether device B is capable of processing the task cooperatively with device A according to one or more of the available computing power, the remaining power, and whether in a charging state in the second device information, that is, determine whether device B is a cooperative device; and device A can determine whether device C is capable of processing the task cooperatively with device A according to one or more of the available computing power, the remaining power, and whether in a charging state in the third device information, that is, determine whether device C is a cooperative device.

[0256] Specifically, a certain judgment condition can be set to determine whether device B and device C are cooperative devices or non-cooperative devices, for example, if the available computing power of device B is greater than or equal to a first threshold value and the remaining power of device B is greater than or equal to a second threshold value, device B is determined to be a cooperative device; for another example, if the available computing power of device B is greater than or equal to a first threshold value and device B is in a charging state, device B is determined to be a cooperative device; for another example, if device C is in a charging state but the available computing power of device C is less than a first threshold value, device C is determined to be a non-cooperative device.

[0257] If it is determined that both device B and device C are cooperative devices, then according to the communication modes supported by device A and the communication modes supported by device B, a plurality of communication modes supported by device B and the first terminal are determined; and according to the communication modes supported by device A and the communication modes supported by device C, a plurality of communication modes supported by device C and the first terminal are determined.

[0258] Specifically, the same communication mode supported by device A and the same communication mode supported by device B can be used as the multiple communication modes supported by device B with the first terminal. For example, if the communication modes supported by device A include: low-power Bluetooth communication mode, traditional Bluetooth communication mode, WiFi communication mode, 2.4G point-to-point communication mode, and 5G point-to-point communication mode; and the communication modes supported by device B include: low-power Bluetooth communication mode, WiFi communication mode, and 5G point-to-point communication mode, then the multiple communication modes supported by device B with the first terminal include: low-power Bluetooth communication mode, WiFi communication mode, and 5G point-to-point communication mode.

[0259] Similarly, if the communication methods supported by device C include: low-power Bluetooth communication method, traditional Bluetooth communication method, 2.4G point-to-point communication method, and 5G point-to-point communication method, then the multiple communication methods supported by device C with the first terminal include: low-power Bluetooth communication method, traditional Bluetooth communication method, 2.4G point-to-point communication method, and 5G point-to-point communication method.

[0260] Step S404: determining a target terminal and its corresponding target communication mode from the second terminal according to the capability performance of the second terminal in processing the historical tasks from the first terminal under the multiple communication modes supported by the second terminal.

[0261] Step S405: If it is determined that a task to be processed is generated, it is determined whether the current communication mode between the first terminal and the target terminal is consistent with the target communication mode. If the determination is no, the process proceeds to step S406; if the determination is yes, the process proceeds to step S408.

[0262] Step S406: Establish a second communication connection with the target terminal according to the target communication mode.

[0263] Step S407: Send the pending task to the target terminal via the second communication connection, and the target terminal processes the pending task.

[0264] Step S408: Send the pending task to the target terminal via the current communication method, and the target terminal processes the pending task.

[0265] After the above steps S406 and S408, step S409 is executed.

[0266] Step S409: Receive the task processing result returned by the target terminal.

[0267] The above steps S404 to S409 are substantially the same as steps S202 to S207 in the above embodiment, and are not described again in this embodiment to avoid repetition.

[0268] In one possible implementation, the method further includes: if it is determined that the first terminal and the second terminal are connected for the first time, generating a first initialization task; transmitting the first initialization task to the second terminal through a communication method supported by the second terminal with the first terminal, and processing it by the second terminal; receiving the task processing result returned by the second terminal, and determining the ability performance of the second terminal corresponding to processing the first initialization task under multiple communication methods supported by the second terminal with the first terminal; the ability performance of the second terminal corresponding to processing historical tasks includes: the ability performance of the second terminal corresponding to processing the first initialization task.

[0269] In this embodiment, before determining the target terminal and its corresponding target communication mode from the second terminal based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal, the second terminal needs to have processed historical tasks from the first terminal under the multiple communication modes it supports with the first terminal. Only in this way can the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal be known. For a second terminal that is connecting for the first time, it has not processed historical tasks from the first terminal. In this case, the first terminal can generate a first initialization task and transmit the first initialization task to the second terminal via the communication mode it supports with the first terminal. The second terminal processes the task and obtains the second terminal's ability to process historical tasks (including the first initialization task) under the multiple communication modes it supports with the first terminal.

[0270] For example, if the first terminal is device A, and the second terminals include devices B and C, and if this is the first time device A and device C are connected, device C supports four communication modes with device A: Bluetooth Low Energy, traditional Bluetooth, 2.4G point-to-point, and 5G point-to-point. A first initialization task is generated for device C, and device C processes the first initialization task under each of the four communication modes to obtain the corresponding performance of device C's ability to process the first initialization task under each of the four communication modes.

[0271] It is worth noting that the first initialization task can be either a simulated task or a real task, which is not limited in this embodiment. Furthermore, the first terminal can generate the first initialization task upon discovering the second terminal connecting for the first time, and the second terminal can process the first initialization task. This eliminates the need to generate the first initialization task and have the second terminal process the first initialization task while the first terminal is scheduling pending tasks, thereby improving efficiency.

[0272] In addition, it is worth noting that if the second terminal supports the initial appearance of the communication mode with the first terminal, the first terminal also generates an initialization task, and the second terminal processes the initialization task in the initial appearance of the communication mode to obtain the performance of the second terminal in processing the initialization task in the initial appearance of the communication mode. For example, if the first terminal is device A, the second terminal includes device B and device C, and if the communication mode supported by device C is the initial appearance of the WiFi communication mode, an initialization task is generated, and device C processes the initialization task in the WiFi communication mode to obtain the performance of device C in processing the initialization task in the WiFi communication mode.

[0273] In addition, since the device position and device information of the terminal are highly dynamic, the multiple terminals in the effective communication range of the first terminal may update, that is, new terminals appear in the effective communication range of the first terminal or the terminals connected to the first terminal leave the effective communication range of the first terminal, which may cause the determined second terminals that can be cooperated to change. In addition, the device information (such as available computing power, remaining power, whether in a charging state, supported communication mode, etc.) of the multiple terminals in the effective communication range of the first terminal also changes frequently, which may cause the determined second terminals that can be cooperated and the communication mode supported by the second terminal to change. If the second terminal and the communication mode supported by the second terminal cannot be updated in time, the performance of the determined target terminal in executing the historical task in the target communication mode may not be optimal, which may seriously affect the user experience when the first terminal and the target terminal process the to-be-processed task.

[0274] To this end, two implementation manners are proposed as follows:

[0275] In one possible implementation manner, after receiving the device information of the multiple terminals that have the first communication connection with the first terminal, the method further includes periodically sending a query request to the multiple terminals, each terminal returning its updated device information in response to the query request; receiving the updated device information from the multiple terminals; and determining the second terminal that can cooperate with the first terminal to process the task and the multiple communication modes supported by the second terminal from the multiple terminals that have the first communication connection with the first terminal, including determining the second terminal that can cooperate with the first terminal to process the task and the multiple communication modes supported by the second terminal according to the device information of the first terminal and the updated device information of the multiple terminals.

[0276] In this embodiment, the first terminal periodically sends query requests to multiple terminals. Each terminal returns its updated device information in response to the query request, and the first terminal is able to receive updated device information from multiple terminals. In this way, the first terminal can promptly obtain the updated device information of multiple terminals, and can promptly update the second terminal and the multiple communication methods supported by the second terminal with the first terminal based on the updated device information of the multiple terminals. This ensures that the target terminal determined based on the updated second terminal and the multiple communication methods supported by the second terminal with the first terminal has the best performance in executing historical tasks under the target communication method. This solution can greatly reduce the impact of the target terminal's collaborative processing on the target terminal's own task processing, thereby avoiding deteriorating the user experience of the collaborative device. The above period can be 1 minute, 2 minutes, etc., and can be set according to actual needs. This is not limited in this embodiment.

[0277] In another possible implementation, after receiving device information of multiple terminals that have a first communication connection with the first terminal, it also includes: receiving device change information from multiple terminals, the device change information being device information sent by the terminal to the first terminal when the terminal changes from being able to collaborate with the first terminal to being unable to collaborate with the first terminal to process tasks, or from being unable to collaborate with the first terminal to being able to collaborate with the first terminal to process tasks; determining a second terminal that can collaborate with the first terminal to process tasks, and multiple communication methods supported by the second terminal with the first terminal from the multiple terminals that have a first communication connection with the first terminal, including: determining a second terminal that can collaborate with the first terminal to process tasks, and multiple communication methods supported by the second terminal with the first terminal from the multiple terminals that have a first communication connection with the first terminal based on the device information of the first terminal and the device change information of the multiple terminals.

[0278] In this embodiment, the terminal monitors its own device information. If it is determined according to the detected own device information that the terminal changes from being able to cooperate with the first terminal to process a task to being unable to cooperate with the first terminal to process the task (for example, the terminal available computing power changes from 0% to 80%), or from being unable to cooperate with the first terminal to process the task to being able to cooperate with the first terminal to process the task (for example, the terminal available computing power is 80%, the remaining power is 35%, and the terminal changes from being unplugged to being plugged in), the terminal sends device change information to the first terminal. The first terminal receives device change information from multiple terminals. In this way, the first terminal can update the second terminal and multiple communication modes supported by the second terminal in a timely manner according to the device change information of the multiple terminals, so as to ensure that the ability performance of the target terminal in executing the historical task in the target communication mode is optimal according to the updated second terminal and multiple communication modes supported by the second terminal and the first terminal. The scheme can greatly reduce the impact of the above-mentioned cooperative processing of the target terminal on the processing of the task of the target terminal itself, thereby avoiding the degradation of the user experience on the cooperative device.

[0279] In addition, the cooperation of the second terminal with the first terminal to process the task is also affected by other occasional factors, such as wireless network interference. A large number of other devices suddenly increase in the network to communicate, affecting the communication delay between the second terminal and the first terminal, so that the corresponding ability performance suddenly changes when the second terminal is determined as the target terminal to process the to-be-processed task. If the network interference disappears, the target terminal and the corresponding target communication mode are still determined according to the ability performance of the second terminal in processing the historical task under the condition of serious network interference. The ability performance of the target terminal in executing the historical task in the target communication mode is likely to be suboptimal. At this time, the ability performance data corresponding to the historical task processed by the second terminal needs to be discarded, and the second terminal needs to be reinitialized to obtain the ability performance of the second terminal in processing the latest task, so as to ensure the effectiveness of the overall task scheduling scheme in the dynamic environment.

[0280] For example, in the case where the task processing result returned by the target terminal is received, a first difference in ability performance of the target terminal in processing the latest historical task and a previous historical task in the target communication mode supported by the target terminal and a historical offset difference value of the target terminal in processing other historical tasks except the latest historical task in the target communication mode supported by the target terminal are determined. The current offset difference value is determined according to the first difference and the historical offset difference value. In the case where the difference between the first difference and the current offset difference value is greater than a first preset threshold, the current device information of multiple terminals having a first communication connection with the first terminal is obtained.

[0281] Determining, from multiple terminals that have a first communication connection with the first terminal, a second terminal that can collaborate with the first terminal to process tasks, and multiple communication methods supported by the second terminal with the first terminal, including: re-determining, based on device information of the first terminal and current device information of the multiple terminals, the second terminal that can collaborate with the first terminal to process tasks, and multiple communication methods supported by the second terminal with the first terminal.

[0282] Before determining the target terminal and its corresponding target communication mode from the second terminal, the method further includes: generating multiple second initialization tasks, and transmitting the multiple second initialization tasks to the re-determined second terminal via multiple communication modes supported by the re-determined second terminal with the first terminal, for processing by the re-determined second terminal; receiving task processing results returned by the re-determined second terminal, and determining the re-determined second terminal's ability to process the second initialization tasks under the multiple communication modes supported by the re-determined second terminal with the first terminal. The second terminal's ability to process historical tasks only includes: the second terminal's ability to process the second initialization tasks.

[0283] Specifically, upon receiving the task processing result returned by the target terminal, the first benefit difference between the target terminal's ability to process the latest historical task t and the previous historical task t-1 under the target communication mode supported by the first terminal is determined. Assume that the benefit of the target terminal processing the latest historical task t under the target communication mode supported by the first terminal is r t , the ability gain of processing the previous historical task t-1 is r t-1 , then the first return difference is dt = r t -r t-1 In addition, determine the historical offset difference of the target terminal's ability to process other historical tasks except the latest historical task t under the target communication mode supported by the first terminal

[0284]

[0285] Wherein, δ is a constant, and δ is greater than 0 and less than 1, and may be 0.5. It is worth noting that δ may also take other values ​​based on actual experience.

[0286] According to the first return difference dt and the historical deviation difference Determine the current offset difference

[0287]

[0288] like Specifically, if the difference between the first return difference and the offset difference is greater than the first preset threshold γ, this indicates that the target terminal's environmental conditions have changed between processing the latest historical task t and processing the previous historical task t-1, resulting in a significant difference in the target terminal's performance corresponding to the latest historical task t relative to the performance corresponding to processing the previous historical task t-1. Therefore, it is necessary to discard the performance data corresponding to the historical tasks processed by the second terminal and reinitialize the second terminal to obtain the performance data for the second terminal's latest tasks, thereby ensuring the effectiveness of the overall task scheduling solution in a dynamic environment. It is worth noting that γ can be 3, but other values ​​can also be used based on practical experience.

[0289] The initialization process is as follows: obtaining the current device information of multiple terminals that have a first communication connection with the first terminal, and redetermining the second terminal that can collaborate with the first terminal to process tasks, as well as the multiple communication methods supported by the second terminal with the first terminal, based on the device information of the first terminal and the current device information of the multiple terminals. Generate multiple second initialization tasks, and transmit the multiple second initialization tasks to the redetermined second terminal through the multiple communication methods supported by the redetermined second terminal with the first terminal, for processing by the redetermined second terminal; receive the task processing results returned by the redetermined second terminal, and determine the ability of the redetermined second terminal to process the second initialization task under the multiple communication methods supported by the first terminal. The ability of the second terminal to process historical tasks only includes: the ability of the second terminal to process the second initialization task.

[0290] In addition, since the second terminal's collaboration with the first terminal in processing tasks will also be affected by other factors, such as the user's random operations, if the user takes the second terminal away, the distance between the second terminal and the first terminal will gradually become farther, and the delay in the second terminal processing tasks will gradually increase. If the second terminal is close to the first terminal, the target terminal and its corresponding target communication mode will still be determined based on the ability to process historical tasks when the distance between the second terminal and the first terminal becomes farther. The ability performance of the determined target terminal to perform historical tasks under the target communication mode is likely to be suboptimal. At this time, it is necessary to discard the ability performance data corresponding to the historical tasks processed by the second terminal, re-initialize the second terminal to obtain the second terminal's latest ability performance in processing tasks, thereby ensuring the effectiveness of the overall task scheduling solution in a dynamic environment.

[0291] Exemplarily, upon receiving a task processing result returned by the target terminal, the current device information of multiple terminals having a first communication connection with the first terminal is obtained based on a cumulative profit difference of a difference between the target terminal's ability to process historical tasks within any two adjacent preset windows under the target communication mode supported by the target terminal. If the cumulative profit difference is greater than a second preset threshold, the current device information of multiple terminals having a first communication connection with the first terminal is obtained.

[0292] Determining, from multiple terminals that have a first communication connection with the first terminal, a second terminal capable of coordinating with the first terminal to process a task, and multiple communication modes supported by the second terminal with the first terminal, includes: re-determining, based on device information of the first terminal and current device information of the multiple terminals, the second terminal capable of coordinating with the first terminal to process a task, and the multiple communication modes supported by the second terminal with the first terminal. Before determining a target terminal and its corresponding target communication mode from the second terminal, the method further includes: generating a third initialization task, and transmitting the third initialization task to the re-determined second terminal via the multiple communication modes supported by the re-determined second terminal with the first terminal, for processing by the re-determined second terminal.

[0293] Receive the task processing result returned by the newly determined second terminal, and determine the ability of the newly determined second terminal to process the third initialization task under the multiple communication modes supported by the first terminal. The ability of the second terminal to process the historical tasks only includes: the ability of the second terminal to process the third initialization task.

[0294] Specifically, when the task processing result returned by the target terminal is received, the cumulative benefit difference is calculated based on the difference in the ability benefit of the target terminal in processing historical tasks within any two adjacent preset windows under the target communication mode supported by the first terminal.

[0295] Assume that the size of a preset window is W, that is, a preset window includes W historical tasks, and the size of the cumulative detection window is m, that is, the cumulative detection window includes m tasks, and m is greater than or equal to W. Then the ability benefit difference μw of the target terminal in processing any historical task in the preset window under the supported target communication mode with the first terminal can be calculated by the following formula:

[0296]

[0297] Among them, l represents the current task in the sliding window.

[0298] Cumulative return difference acc_change t It can be calculated by the following formula:

[0299]

[0300] Among them, j represents the current window, jW represents the next window, μ j,w Represents the capability benefit difference corresponding to the current window, μ j-w,w It represents the capacity benefit difference corresponding to the next window, and m is the total number of historical tasks.

[0301] If the cumulative return difference acc_changet >Δacc, that is, if the cumulative profit difference is greater than the second preset threshold Δacc, it is necessary to discard the performance data corresponding to the historical tasks processed by the second terminal and reinitialize the second terminal to obtain the performance data of the most recent tasks processed by the second terminal, thereby ensuring the effectiveness of the overall task scheduling solution in a dynamic environment. It is worth noting that the preset window size W, the cumulative detection window size m, and the second preset threshold Δacc can be set as needed. In one example, W can be 10, m can be 10, and Δacc can be 5.

[0302] The initialization process is as follows: obtain the current device information of multiple terminals that have a first communication connection with the first terminal. Based on the device information of the first terminal and the current device information of the multiple terminals, redetermine the second terminal that can cooperate with the first terminal to process tasks, and the multiple communication methods supported by the second terminal with the first terminal. Before determining the target terminal and its corresponding target communication method from the second terminal, it also includes: generating a third initialization task, and transmitting the third initialization task to the redetermined second terminal through the multiple communication methods supported by the redetermined second terminal with the first terminal, and processing it by the redetermined second terminal. Receive the task processing result returned by the redetermined second terminal, and determine the ability performance of the redetermined second terminal to process the third initialization task under the multiple communication methods supported by the first terminal. The ability performance of the second terminal to process historical tasks only includes: the ability performance of the second terminal to process the third initialization task.

[0303] In a second aspect, an embodiment of the present application provides a task collaboration method, which is applied to a second terminal, the second terminal has a device collaboration function, and the second terminal has a first communication connection with the first terminal, such as Figure 9 As shown, the task collaboration method includes the following steps:

[0304] Step S501: When the device collaboration function of the second terminal is enabled, determine whether the received connection request is from the first terminal to establish a second communication connection or a pending task. If the connection request is from the first terminal to establish a second communication connection, execute step S502; if the pending task is received from the first terminal via the current communication method, execute step S504.

[0305] The second terminal supports the device collaboration function. Specifically, the second terminal may be provided with a switch control. When the switch control is turned on, the device collaboration function is turned on; when the switch control is turned off, the device collaboration function is turned off.

[0306] If the second terminal receives a connection request from the first terminal to establish a second communication connection, it proceeds to step S520 (establishing a second communication connection with the first terminal based on the connection request to establish the second communication connection); if the second terminal receives a pending task from the first terminal, it proceeds to step S504 (the second terminal processes the pending task).

[0307] Step S502: Establishing a second communication connection with the first terminal based on the connection request for establishing the second communication connection.

[0308] Step S503: receiving the to-be-processed task from the first terminal through the second communication connection, and processing the to-be-processed task.

[0309] Step S504: Process pending tasks.

[0310] After step S503 and step S504, step S505 is executed.

[0311] Step S505: Return the task processing result to the first terminal.

[0312] In this embodiment, the second terminal can cooperate with the first terminal to process the pending tasks from the first terminal, thereby avoiding excessive consumption of resources of a single terminal device.

[0313] In one possible implementation, before establishing a second communication connection with the first terminal based on a connection request for establishing a second communication connection, it also includes: upon receiving a connection request for establishing a second communication connection from the first terminal, if the first communication connection and the second communication connection cannot coexist, disconnecting the first communication connection with the first terminal.

[0314] In this embodiment, before establishing a second communication connection with the first terminal based on a connection request to establish a second communication connection, if the current first communication connection between the second terminal and the first terminal and the second communication connection to be established cannot coexist, the first communication connection with the first terminal needs to be disconnected. For example, if the second terminal is device B and the first terminal is device A, the first communication connection between device B and device A is a 2.4G point-to-point communication connection, and the second communication connection at the end of the connection request is a 5G point-to-point communication connection, since the 2.4G point-to-point communication connection and the 5G point-to-point communication connection cannot coexist, it is necessary to disconnect the 2.4G point-to-point communication connection with the first terminal and re-establish the 5G point-to-point communication connection.

[0315] The embodiment of the present application also provides another task collaboration method, which is applied to a second terminal, wherein the second terminal has a device collaboration function, such as Figure 10 As shown, the task collaboration method includes the following steps:

[0316] Step S601: When the device collaboration function of the second terminal is turned on, a first connection request from the first terminal is received.

[0317] Upon detecting that the device collaboration feature is enabled, the first terminal (device A) sends a first connection request to multiple devices within its effective communication range. If the device collaboration feature is enabled on the second terminal (device B) and the second terminal is within the effective communication range of the first terminal, the second terminal (device B) receives the first connection request from the first terminal. The first connection request can be, for example, a Bluetooth self-discovery broadcast or a CoAP discovery broadcast.

[0318] Step S602: Establishing a first communication connection with the first terminal based on the first connection request.

[0319] The second terminal (device B) establishes a first communication connection with the first terminal (device A) based on the first connection request. If the first connection request is a Bluetooth self-discovery broadcast, the second terminal (device B) establishes a Bluetooth communication connection with the first terminal (device A); if the first connection request is a CoAP discovery broadcast, the second terminal (device B) establishes a WiFi communication connection with the first terminal (device A).

[0320] Afterwards, the second terminal (device B) exchanges respective device information with the first terminal (device A) through the first communication connection. Device A sends the first device information to device B, and device B sends the second device information to device A.

[0321] Step S603: Determine whether the received connection request is from the first terminal to establish a second communication connection or a pending task. If the received connection request is from the first terminal to establish a second communication connection, then execute step S640; if the received task is from the first terminal via the current communication method, then execute step S660.

[0322] Step S604: Establishing a second communication connection with the first terminal based on the connection request for establishing the second communication connection.

[0323] Step S605: receiving the pending task from the first terminal through the second communication connection, and processing the pending task.

[0324] Step S606: Process pending tasks.

[0325] After step S605 and step S606, step S607 is executed.

[0326] Step S607: Return the task processing result to the first terminal.

[0327] The above steps S603 to S607 are substantially the same as steps S501 to S505 in the above embodiment, and are not described again in this embodiment to avoid repetition.

[0328] In one possible implementation, the method further includes: if the second terminal is connected to the first terminal for the first time, receiving a first initialization task from the first terminal through multiple communication methods supported by the second terminal with the first terminal; processing the first initialization task, and returning the task processing result to the first terminal through multiple communication methods supported by the second terminal with the first terminal.

[0329] In this embodiment, before determining the target terminal and its corresponding target communication mode from the second terminal based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal, the second terminal needs to have processed historical tasks from the first terminal under the multiple communication modes it supports with the first terminal. Only in this way can the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes it supports with the first terminal be known. For the second terminal that is connecting for the first time, it has not processed historical tasks from the first terminal. In this case, the first terminal can generate a first initialization task and transmit the first initialization task to the second terminal via the communication mode it supports with the first terminal. The second terminal will process the task and return the task processing result to the first terminal. The first terminal can then obtain the second terminal's ability to process historical tasks (including the first initialization task) under the multiple communication modes it supports with the first terminal.

[0330] Since the device location and device information of the terminal are highly dynamic, multiple terminals within the effective communication range of the first terminal may be updated, that is, a new terminal appears within the effective communication range of the first terminal or the terminal connected to the first terminal leaves the effective communication range of the first terminal, which will cause the determined second terminal to change. In addition, the device information of multiple terminals within the effective communication range of the first terminal (such as available computing power, remaining power, whether it is in charging status, supported communication methods, etc.) will also change frequently. Therefore, the determined second terminal that can cooperate and the communication method supported by the second terminal with the first terminal will change. If the second terminal and the communication method supported by the second terminal with the first terminal cannot be updated in time, the ability of the determined target terminal to perform historical tasks under the target communication method may not be optimal, which may seriously affect the impact on the user experience when the first terminal and the target terminal process pending tasks.

[0331] To this end, two implementation methods are proposed below:

[0332] In one possible implementation, after sending the device information of the second terminal to the first terminal through the first communication connection, it also includes: receiving a query request from the first terminal; in response to the query request, obtaining the updated device information of the second terminal, and sending the updated device information of the second terminal to the first terminal.

[0333] In this embodiment, the first terminal periodically sends query requests to multiple terminals, and the second terminal responds to the query requests by returning its updated device information. This allows the first terminal to promptly obtain the updated device information of multiple second terminals and, based on the updated device information, promptly update the target terminal and its corresponding target communication mode, ensuring that the determined target terminal's ability to perform historical tasks under the target communication mode is optimal. This solution can significantly reduce the impact of the target terminal's collaborative processing on the target terminal's own task processing, thereby avoiding degradation of the user experience of the collaborative device.

[0334] In another possible implementation, after sending the device information of the second terminal to the first terminal through the first communication connection, it also includes: when monitoring that the second terminal changes from being able to collaborate with the first terminal to being unable to collaborate with the first terminal to process tasks, or from being unable to collaborate with the first terminal to being able to collaborate with the first terminal to process tasks, obtaining the device change information of the second terminal and sending the device change information to the first terminal.

[0335] In this embodiment, the second terminal monitors its own device information. If it is determined based on the detected device information that the second terminal has changed from being able to collaborate with the first terminal to processing tasks to being unable to collaborate with the first terminal (for example, the available computing power of the second terminal changes from 0% to 80%), or from being unable to collaborate with the first terminal to processing tasks to being able to collaborate with the first terminal (for example, the available computing power of the second terminal is 80%, the remaining power is 35%, and it changes from being unplugged to being plugged in), the second terminal sends device change information to the first terminal. The first terminal receives device change information from multiple terminals. In this way, the first terminal can timely update the target terminal and its corresponding target communication mode based on the device change information of multiple second terminals, so that the determined target terminal has the best performance in executing historical tasks under the target communication mode. This solution can greatly reduce the impact of the above-mentioned collaborative processing of the target terminal on the processing of the target terminal's own tasks, thereby avoiding deteriorating the user experience of the collaborative device.

[0336] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the above examples, and such modifications or variations also fall within the scope of the embodiments of the present application.

[0337] Figure 11 7 is a schematic structural block diagram of a terminal device 700 provided in an embodiment of the present application. The terminal device 700 includes: a processor 710, a memory 720, a communication interface 730, and a bus 740.

[0338] The processor 710 may be connected to a memory 720. The memory 720 may be used to store the program code and data. Therefore, the memory 720 may be a storage unit within the processor 710, an external storage unit independent of the processor 710, or a component including both a storage unit within the processor 710 and an external storage unit independent of the processor 710.

[0339] Optionally, the terminal device 700 may further include a bus 740. The memory 720 and the communication interface 730 may be connected to the processor 710 via the bus 740. The bus 740 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 740 may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 11 The fact that only one line is used does not mean that there is only one bus or one type of bus.

[0340] It should be understood that in the embodiment of the present application, the processor 710 can adopt a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Alternatively, the processor 710 uses one or more integrated circuits to process related programs to implement the technical solutions provided in the embodiments of the present application.

[0341] The memory 720 may include a read-only memory and a random access memory, and provides instructions and data to the processor 710. A portion of the processor 710 may also include a non-volatile random access memory. For example, the processor 710 may also store information about the device type.

[0342] When the terminal device 700 is running, the processor 710 processes the processor execution instructions in the memory 720 to use the hardware resources in the device to process the operation steps of the above-mentioned task processing method or task coordination method.

[0343] It should be understood that the terminal device 700 according to the embodiment of the present application may correspond to the processing according to the embodiment of the present application. Figure 5 、 Figures 7 to 10 The corresponding subjects in the method shown, and the above and other operations and / or functions of each module in the terminal device 700 are respectively to implement Figure 5 、 Figures 7 to 10 For the sake of brevity, the corresponding process of the method will not be repeated here.

[0344] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed, the task processing method or task collaboration method provided in the embodiments of the present application is implemented.

[0345] The present application also provides a computer program product, which includes: computer program code, which, when running on a computer, enables a processor to execute the task processing method or task collaboration method provided in an embodiment of the present application.

[0346] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or processed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid state drive (SSD).

[0347] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are processed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.

[0348] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0349] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not processed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0350] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.

[0351] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0352] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a memory (which can be a personal computer, a server, or a network device, etc.) to process all or part of the steps of the method described in each embodiment of the embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0353] The above description is merely a specific implementation of the embodiments of the present application, but the scope of protection of the embodiments of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the embodiments of the present application should be included in the scope of protection of the embodiments of the present application. Therefore, the scope of protection of the embodiments of the present application should be based on the scope of protection of the claims.

Claims

1. A task processing method, characterized in that: The method is applied to a first terminal, the first terminal having a device collaboration function, and the method includes: When the device collaboration function of the first terminal is enabled, determining, from multiple terminals having a first communication connection with the first terminal, a second terminal capable of collaborating with the first terminal to process a task, and multiple communication modes supported by the second terminal with the first terminal; determining a target terminal and its corresponding target communication mode from among the second terminals based on the second terminal's ability to process historical tasks from the first terminal under multiple communication modes supported by the second terminal, wherein the target terminal has the best ability to process historical tasks from the first terminal under the target communication mode; In the case of determining that a task to be processed is generated, if the current communication mode between the first terminal and the target terminal is inconsistent with the target communication mode, establishing a second communication connection with the target terminal according to the target communication mode; sending the pending task to the target terminal via the second communication connection, so that the target terminal processes the pending task; If the current communication mode between the first terminal and the target terminal is consistent with the target communication mode, sending the pending task to the target terminal via the current communication mode, and having the target terminal process the pending task; Receive the task processing result returned by the target terminal.

2. The task processing method according to claim 1, characterized in that: The capability performance includes latency and power consumption, and the capability performance is optimal when a balance is achieved between the latency and the power consumption.

3. The task processing method according to claim 1 or 2, characterized in that: The to-be-processed task is a current subtask to be processed among a plurality of subtasks to be processed in sequence, and the second terminal processes the capability performance corresponding to the historical task, including: the second terminal processes the capability performance corresponding to the subtask located before the current subtask; After receiving the task processing result returned by the target terminal, return to the step of determining the target terminal and its corresponding target communication mode from the second terminal based on the second terminal's ability to process historical tasks from the first terminal under the multiple communication modes supported with the first terminal.

4. The task processing method according to any one of claims 1 to 3, characterized in that: The determining, from the second terminal, a target terminal and its corresponding target communication mode based on the second terminal's ability to process historical tasks from the first terminal in multiple communication modes supported by the first terminal, includes: determining, based on the capability performance of the second terminal in processing historical tasks from the first terminal in multiple supported communication modes with the first terminal, an actual capability gain of the second terminal in processing historical tasks from the first terminal in each supported communication mode with the first terminal; The target terminal and its corresponding target communication mode are determined from the second terminal based on one or more of the actual capacity gain corresponding to the historical tasks processed by the second terminal from the first terminal under each communication mode supported with the first terminal, the total number of historical tasks, and the number of historical tasks processed by the second terminal from the first terminal under each communication mode supported with the first terminal.

5. The task processing method according to claim 4, characterized in that: The determining, from the second terminal, a target terminal and its corresponding target communication mode based on one or more of an actual capacity gain corresponding to historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, a total number of the historical tasks, and a number of historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, includes: Determining, based on the actual capacity gain corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal, the total number of the historical tasks, and the number of historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, an expected capacity gain corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal; A target terminal and its corresponding target communication mode are determined from the second terminal according to the expected capability gain corresponding to the second terminal processing historical tasks from the first terminal under each supported communication mode with the first terminal.

6. The task processing method according to claim 4, characterized in that: The determining, from the second terminal, a target terminal and its corresponding target communication mode based on one or more of an actual capacity gain corresponding to historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, a total number of the historical tasks, and a number of historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, includes: Based on the actual capacity gain corresponding to the historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, and the number of historical tasks processed by the second terminal from the first terminal under each supported communication mode with the first terminal, the target terminal and its corresponding target communication mode are determined from the second terminal.

7. The task processing method according to any one of claims 4 to 6, characterized in that: The capability performance includes latency and power consumption; The determining, based on the capability performance of the second terminal in processing the historical tasks from the first terminal in the multiple communication modes supported by the first terminal, an actual capability gain corresponding to the second terminal processing the historical tasks from the first terminal in each communication mode supported by the first terminal, includes: When the latency corresponding to the historical task is less than or equal to the latency requirement, determining, based on the latency and power consumption corresponding to the second terminal processing the historical task from the first terminal under multiple supported communication modes with the first terminal, an actual capacity gain of the second terminal processing the historical task from the first terminal under each supported communication mode with the first terminal; When the delay corresponding to the historical task is greater than the delay requirement, the actual capacity gain of the second terminal in processing the historical tasks from the first terminal under each supported communication mode with the first terminal is determined based on the power consumption and preset penalty value corresponding to the second terminal processing the historical tasks from the first terminal under multiple supported communication modes with the first terminal.

8. The task processing method according to any one of claims 1 to 7, characterized in that: The method further comprises: When detecting that the device collaboration function is enabled, establishing a first communication connection with a plurality of terminals within an effective communication range of the first terminal; receiving device information of the plurality of terminals that have a first communication connection with the first terminal; The determining, from a plurality of terminals having a first communication connection with the first terminal, a second terminal capable of cooperating with the first terminal to process a task, and a plurality of communication modes supported by the second terminal with the first terminal, includes: Based on the device information of the first terminal and the device information of the multiple terminals, determine from the multiple terminals that have a first communication connection with the first terminal a second terminal that can collaborate with the first terminal to process tasks, and multiple communication modes supported by the second terminal with the first terminal.

9. The task processing method according to claim 8, characterized in that: The device information includes at least one or more of available computing power, remaining power, whether the device is in a charging state, and supported communication methods; The determining, based on the device information of the first terminal and the device information of the multiple terminals, a second terminal capable of cooperating with the first terminal to process a task, and multiple communication modes supported by the second terminal with the first terminal, from multiple terminals having a first communication connection with the first terminal, includes: Determining, from the multiple terminals, a second terminal that can collaborate with the first terminal to process a task based on one or more of available computing power, remaining power, and whether the terminals are in a charging state; According to the communication modes supported by the first terminal and the communication modes supported by the second terminal, a plurality of communication modes supported by the second terminal with the first terminal are determined.

10. The task processing method according to claim 9, characterized in that: The determining, from the multiple terminals, the second terminal that can collaborate with the first terminal to process the task based on one or more of available computing power, remaining power, and whether the multiple terminals are in a charging state, includes: If one or more of the available computing power, the remaining power, and whether the terminal is in a charging state meets a first preset condition, determining that the terminal is the second terminal capable of cooperating with the first terminal to process tasks; The first preset condition is: the available computing power of the terminal is greater than or equal to a first threshold and the remaining power of the terminal is greater than or equal to a second threshold; or, the available computing power of the terminal is greater than or equal to the first threshold, the remaining power of the terminal is less than the second threshold, and the terminal is in a charging state.

11. The task processing method according to any one of claims 8 to 10, characterized in that: The method further comprises: If it is determined that the first terminal and the second terminal are connected for the first time, generating a first initialization task; transmitting the first initialization task to the second terminal via a communication method supported by the second terminal with the first terminal, and processing the task by the second terminal; receiving a task processing result returned by the second terminal, and determining a capability performance of the second terminal in processing the first initialization task under multiple supported communication modes with the first terminal; The capability performance of the second terminal in processing the historical task includes: the capability performance of the second terminal in processing the first initialization task.

12. The task processing method according to any one of claims 8 to 11, characterized in that: After receiving the device information of the plurality of terminals having the first communication connection with the first terminal, the method further includes: Periodically sending query requests to the plurality of terminals, each of the terminals returning updated device information in response to the query request; receiving updated device information from the plurality of terminals; The determining, from a plurality of terminals having a first communication connection with the first terminal, a second terminal capable of cooperating with the first terminal to process a task, and a plurality of communication modes supported by the second terminal with the first terminal, includes: A second terminal capable of cooperating with the first terminal to process tasks and multiple communication modes supported by the second terminal with the first terminal are determined based on the device information of the first terminal and the updated device information of the multiple terminals.

13. The task processing method according to any one of claims 8 to 12, characterized in that: After receiving the device information of the plurality of terminals having the first communication connection with the first terminal, the method further includes: receiving device change information from the plurality of terminals, the device change information being device information sent by the terminal to the first terminal when the terminal changes from being able to process a task in collaboration with the first terminal to being unable to process a task in collaboration with the first terminal, or from being unable to process a task in collaboration with the first terminal to being able to process a task in collaboration with the first terminal; The determining, from a plurality of terminals having a first communication connection with the first terminal, a second terminal capable of cooperating with the first terminal to process a task, and a plurality of communication modes supported by the second terminal with the first terminal, includes: Based on the device information of the first terminal and the device change information of the multiple terminals, determine from the multiple terminals that have a first communication connection with the first terminal a second terminal that can collaborate with the first terminal to process tasks, and multiple communication methods supported by the second terminal with the first terminal.

14. The task processing method according to any one of claims 1 to 13, characterized in that: The method further comprises: Upon receiving the task processing result returned by the target terminal, determining a first benefit difference between the target terminal's ability to process the latest historical task and the ability to process the previous historical task under the supported target communication mode with the first terminal, and a historical offset difference between the target terminal's ability to process other historical tasks except the latest historical task under the supported target communication mode with the first terminal; determining a current offset difference according to the first return difference and the historical offset difference; When the difference between the first profit difference and the current offset difference is greater than a first preset threshold, obtaining current device information of a plurality of terminals having a first communication connection with the first terminal; The determining, from a plurality of terminals having a first communication connection with the first terminal, a second terminal capable of cooperating with the first terminal to process a task, and a plurality of communication modes supported by the second terminal with the first terminal, includes: re-determining, based on the device information of the first terminal and the current device information of the multiple terminals, a second terminal capable of cooperating with the first terminal to process a task, and multiple communication modes supported by the second terminal with the first terminal; Before determining the target terminal and its corresponding target communication mode from the second terminal, the method further includes: generating a plurality of second initialization tasks, and transmitting the plurality of second initialization tasks to the re-determined second terminal through a plurality of communication modes supported by the re-determined second terminal with the first terminal, for processing by the re-determined second terminal; receiving a task processing result returned by the re-determined second terminal, and determining an ability performance of the re-determined second terminal in processing the second initialization task under the multiple communication modes supported by the second terminal with the first terminal; The capability performance of the second terminal in processing the historical task only includes: the capability performance of the second terminal in processing the second initialization task.

15. The task processing method according to any one of claims 1 to 14, characterized in that: The method further comprises: Upon receiving the task processing result returned by the target terminal, a cumulative benefit difference is calculated based on the difference between the capability benefits of the target terminal in processing historical tasks within any two adjacent preset windows under the target communication mode supported by the target terminal with the first terminal; When the cumulative profit difference is greater than a second preset threshold, obtaining current device information of a plurality of terminals having a first communication connection with the first terminal; The determining, from a plurality of terminals having a first communication connection with the first terminal, a second terminal capable of cooperating with the first terminal to process a task, and a plurality of communication modes supported by the second terminal with the first terminal, includes: re-determining, based on the device information of the first terminal and the current device information of the multiple terminals, a second terminal capable of cooperating with the first terminal to process a task, and multiple communication modes supported by the second terminal with the first terminal; Before determining the target terminal and its corresponding target communication mode from the second terminal, the method further includes: generating a third initialization task, and transmitting the third initialization task to the re-determined second terminal through multiple communication modes with the first terminal supported by the re-determined second terminal, for processing by the re-determined second terminal; receiving a task processing result returned by the re-determined second terminal, and determining an ability performance of the re-determined second terminal in processing the third initialization task under the multiple communication modes supported by the second terminal with the first terminal; The capability performance of the second terminal in processing the historical task only includes: the capability performance of the second terminal in processing the third initialization task.

16. The task processing method according to any one of claims 8 to 13, characterized in that: The effective communication range refers to the Bluetooth connection range of the first terminal and / or the wireless local area network connection range where the first terminal is located.

17. A task collaboration method, characterized in that: Applied to a second terminal, the second terminal having a device collaboration function, and the second terminal having a first communication connection with the first terminal, the method comprising: When the device cooperation function of the second terminal is in an enabled state, if a connection request for establishing a second communication connection is received from the first terminal, establishing a second communication connection with the first terminal based on the connection request for establishing the second communication connection; receiving a task to be processed from the first terminal through the second communication connection, and processing the task to be processed; If a task to be processed is received from the first terminal through the current communication method, processing the task to be processed; The task processing result is returned to the first terminal.

18. The task collaboration method according to claim 17, characterized in that: Before establishing the second communication connection with the first terminal based on the connection request for establishing the second communication connection, the method further includes: In case of receiving a connection request for establishing a second communication connection from the first terminal, if the first communication connection and the second communication connection cannot coexist, disconnecting the first communication connection with the first terminal.

19. The task collaboration method according to claim 17 or 18, characterized in that: The first communication connection between the second terminal and the first terminal is established in the following manner: When the device collaboration function of the second terminal is enabled, receiving a first connection request from the first terminal; A first communication connection is established with the first terminal based on the first connection request.

20. The task collaboration method according to claim 19, characterized in that: The method further comprises: If the second terminal is connected to the first terminal for the first time, receiving a first initialization task from the first terminal through multiple communication modes supported by the second terminal with the first terminal; The first initialization task is processed, and a task processing result is returned to the first terminal via a plurality of communication modes supported by the second terminal with the first terminal.

21. The task collaboration method according to claim 19 or 20, characterized in that: After sending the device information of the second terminal to the first terminal through the first communication connection, the method further includes: receiving a query request from the first terminal; In response to the query request, updated device information of the second terminal is acquired, and the updated device information of the second terminal is sent to the first terminal.

22. The task collaboration method according to any one of claims 19 to 21, characterized in that: After sending the device information of the second terminal to the first terminal through the first communication connection, the method further includes: When it is monitored that the second terminal changes from being able to collaborate with the first terminal to processing tasks to being unable to collaborate with the first terminal, or from being unable to collaborate with the first terminal to processing tasks to being able to collaborate with the first terminal, the device change information of the second terminal is obtained and the device change information is sent to the first terminal.

23. A terminal device, characterized in that: The terminal device includes a memory and a processor, the memory is used to store instructions, and when the instructions are executed by the processor, the terminal device implements the task processing method as described in any one of claims 1 to 16, or implements the task collaboration method as described in any one of claims 17 to 22.

24. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed, the task processing method according to any one of claims 1 to 16 is implemented, or the task collaboration method according to any one of claims 17 to 22 is implemented.

25. A computer program product, characterized in that The computer program product includes: computer program code, which, when running on a computer, enables the processor to implement the task processing method according to any one of claims 1 to 16, or execute the task collaboration method according to any one of claims 17 to 22.

Citation Information

Patent Citations

  • Data processing method and electronic equipment

    CN111371849A

  • Data transmission method and device, equipment and storage medium

    CN115551043A

  • Multilateral cooperative computing task unloading method and device, storage medium and electronic equipment

    CN117729205A

  • Cloud and multi-edge network node collaborative micro-service deployment method

    CN118337640A

  • Communication service system, method for implementing communication service, device and storage medium

    WO2024104395A1