Business collaboration method, electronic device, readable storage medium and chip system

By adjusting the heartbeat node and cycle, terminal devices reduce the number of wake-up calls and the wake-up time in distributed scenarios, solving the problem of increased device power consumption and achieving more efficient data synchronization.

CN116528337BActive Publication Date: 2025-11-21HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210075719.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-22
Publication Date
2025-11-21
Estimated Expiration
2042-01-22

AI Technical Summary

Technical Problem

In distributed scenarios, when terminal devices synchronize data with other devices, the process is unpredictable and sudden, causing other terminal devices to be frequently woken up, increasing power consumption.

Method used

By adjusting the heartbeat node and heartbeat cycle of the terminal device, the device is woken up in the same time period, thereby reducing the number of wake-ups and the time spent waking up, and data synchronization is performed during the wake-up time period of the device.

Benefits of technology

It reduces the power consumption of terminal devices, decreases the number and time of device wake-ups, and improves the energy efficiency of devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116528337B_ABST
    Figure CN116528337B_ABST
Patent Text Reader

Abstract

The application is suitable for the terminal technical field, and provides a service cooperation method, an electronic device, a readable storage medium and a chip system.The method comprises the following steps: adjusting the time corresponding to the heartbeat node of a first terminal device and the heartbeat node of a second terminal device respectively; receiving a heartbeat message sent by the second terminal device, wherein the heartbeat message comprises a service identifier, and the service identifier is used for indicating a first service running in the foreground of the second terminal device; and performing data synchronization with the second terminal device according to the service identifier and the service running in the foreground of the first terminal device, in combination with the adjusted heartbeat node. The first terminal device can determine the first service running in the foreground of the second terminal device according to the received heartbeat message, can perform real-time or delayed cooperative work with the second terminal device, can complete data synchronization with other terminal devices by using the wake-up time period of the second terminal device, the number of times of wake-up of each terminal device can be reduced, and the power consumption of the second terminal device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal equipment technology, and in particular to a business collaboration method, electronic device, readable storage medium, and chip system. Background Technology

[0002] With the continuous development of terminal devices, the functions of a single terminal device can no longer meet user needs. Based on this, a distributed scenario is proposed, in which multiple terminal devices can network together to interact with each other, and the different functions of multiple terminal devices can simultaneously provide services to users.

[0003] For each terminal device in a distributed scenario, the terminal device can send heartbeat messages to other terminal devices to determine whether other terminal devices are still in the distributed scenario; the terminal device can also add, delete or replace stored data according to the detected operations, and can also synchronize the added, deleted or replaced data to other terminal devices.

[0004] However, when a terminal device synchronizes data with other terminal devices, the process is spontaneous and unpredictable, requiring other terminal devices to be frequently woken up, which increases the power consumption of other terminal devices. Summary of the Invention

[0005] This application provides a business collaboration method, an electronic device, a readable storage medium, and a chip system, which solves the problem of increased power consumption of terminal devices in distributed scenarios in the prior art.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, a business collaboration method is provided, applied to a first terminal device in a distributed system, wherein the distributed system comprises the first terminal device and a second terminal device, the first terminal device and the second terminal device being connected, the method comprising:

[0008] The times corresponding to the heartbeat nodes of the first terminal device and the second terminal device are adjusted respectively to obtain the adjusted heartbeat nodes;

[0009] The device receives a heartbeat message sent by the second terminal device. The heartbeat message includes a service identifier, which is used to indicate a first service running in the foreground of the second terminal device.

[0010] Based on the service identifier and the service running in the foreground of the first terminal device, and in conjunction with the adjusted heartbeat node, data synchronization is performed with the second terminal device.

[0011] In a distributed scenario, the first and second terminal devices first adjust the times corresponding to their respective heartbeat nodes to obtain the adjusted heartbeat nodes. Then, the first terminal device can obtain the service status of each service of the second terminal device based on the heartbeat messages received from the second terminal device. Based on the service identifiers of each service and the services currently running in the foreground on the first terminal device, it completes data synchronization with the second terminal device using the adjusted heartbeat nodes. This allows data synchronization to be completed within the wake-up time period of the second terminal device, reducing the number of times the second terminal device is woken up and thus lowering its power consumption.

[0012] In a first possible implementation of the first aspect, the step of synchronizing data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, includes:

[0013] Based on the service identifier, determine whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device;

[0014] If the second service running in the foreground of the first terminal device is inconsistent with the first service running in the foreground of the second terminal device, then at the time corresponding to the next adjusted heartbeat node, a service message is sent to the second terminal device. The service message is used to synchronize the second service between the first terminal device and the second terminal device.

[0015] If the service running in the foreground of the second terminal device is different from the service currently running in the foreground of the first terminal device, the terminal device can delay its collaborative operation with other terminal devices. At the time corresponding to the heartbeat node, heartbeat messages and service messages are sent simultaneously, utilizing the wake-up time of the second terminal device, thereby reducing the power consumption of the second terminal device.

[0016] Based on the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the step of sending a service message to the second terminal device at the time corresponding to the next adjusted heartbeat node includes:

[0017] For the second service running in the foreground of the first terminal device, register a non-real-time collaborative task;

[0018] Upon reaching the time corresponding to the next adjusted heartbeat node, the non-real-time collaborative task is triggered, and the service message is sent to the second terminal device.

[0019] In a third possible implementation of the first aspect, the step of synchronizing data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, includes:

[0020] Based on the service identifier, determine whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device;

[0021] If the first service running in the foreground of the first terminal device is the same as the first service running in the foreground of the second terminal device, then the service message is sent to the second terminal device. The service message is used to synchronize the first service between the first terminal device and the second terminal device.

[0022] If the service running in the foreground of the second terminal device is the same as the service currently running in the foreground of the first terminal device, the first terminal device can collaborate with other terminal devices in real time to complete data synchronization. By synchronizing data with the second terminal device during the period when the second terminal device is currently awake, the first terminal device can reduce the number of times the second terminal device is woken up, thereby reducing its power consumption.

[0023] Based on any of the above possible implementations of the first aspect, in a fourth possible implementation of the first aspect, before synchronizing data with the second terminal device according to the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, the method further includes:

[0024] The service identifier bit of the heartbeat message is extracted to obtain the service identifier corresponding to the first service.

[0025] Based on any of the possible implementations of the first aspect, in the fifth possible implementation of the first aspect, adjusting the times corresponding to the heartbeat nodes of the first terminal device and the second terminal device respectively to obtain the adjusted heartbeat nodes includes:

[0026] Receive the heartbeat node and heartbeat cycle sent by the second terminal device;

[0027] The adjusted heartbeat node is obtained by calculating the heartbeat node based on the pre-set heartbeat coordination formula, combined with the heartbeat node and heartbeat cycle sent by the second terminal device and the heartbeat node and heartbeat cycle of the first terminal device.

[0028] In a distributed scenario, the first and second terminal devices can adjust their heartbeat nodes and heartbeat cycles to ensure that the time periods during which they are woken up are consistent. In other words, the time when the first and second terminal devices send and receive heartbeat messages is consistent, thereby reducing the number of times each terminal device is woken up.

[0029] Secondly, a business collaboration method is provided, applied to a second terminal device in a distributed system, wherein the distributed system comprises a first terminal device and a second terminal device, the first terminal device and the second terminal device being connected, the method comprising:

[0030] The times corresponding to the heartbeat nodes of the first terminal device and the second terminal device are adjusted respectively to obtain the adjusted heartbeat nodes;

[0031] At the time corresponding to the adjusted heartbeat node, a heartbeat message is sent to the first terminal device. The heartbeat message includes a service identifier, which is used to indicate the first service running in the foreground of the second terminal device.

[0032] Data synchronization is performed with the first terminal device based on the service message sent by the first terminal device.

[0033] In a distributed scenario, the first and second terminal devices first adjust the times corresponding to their respective heartbeat nodes to obtain the adjusted heartbeat nodes. Then, the second terminal device can send heartbeat messages to the first terminal device to inform it of the service status of each service it is running. Based on the service messages returned by the first terminal device using the service identifiers of each service, data synchronization with the first terminal device is achieved. This synchronization can be completed using the second terminal device's wake-up time period, reducing the number of times the second terminal device is woken up and thus lowering its power consumption.

[0034] In a first possible implementation of the second aspect, sending a heartbeat message to the first terminal device includes:

[0035] Determine the service identifier corresponding to the service running in the foreground of the second terminal device;

[0036] The heartbeat message is generated based on the service identifier;

[0037] The heartbeat message is sent to the first terminal device.

[0038] By adding a service identifier to the heartbeat message, the second terminal device can indicate the service currently running in the foreground. This allows the first terminal device to determine the time to synchronize data with the second terminal device based on the service identifier in the heartbeat message. By utilizing the wake-up time period of the second terminal device to complete data synchronization, the number of times the second terminal device is woken up can be reduced, thereby reducing the power consumption of the second terminal device.

[0039] Based on the first possible implementation of the second aspect, in the second possible implementation of the second aspect, determining the service identifier corresponding to the service running in the foreground of the second terminal device includes:

[0040] Based on the hand-raising action triggered by the first service, it is determined that the first service is running in the foreground of the second terminal device;

[0041] Obtain the service identifier corresponding to the first service.

[0042] Based on any of the possible implementations of the second aspect described above, in a third possible implementation of the second aspect, the step of synchronizing data with the first terminal device according to the service message sent by the first terminal device includes:

[0043] The system receives a service message sent by the first terminal device, the service message being used to synchronize data for the second service between the first terminal device and the second terminal device.

[0044] Based on the service message, data synchronization is performed with the first terminal device for the second service.

[0045] If the service running in the foreground of the first terminal device is the same as the service currently running in the foreground of the second terminal device, the first terminal device can work collaboratively with the second terminal device in real time to complete data synchronization. If the service running in the foreground of the first terminal device is different from the service currently running in the foreground of the second terminal device, the first terminal device can delay working collaboratively with the second terminal device and use the wake-up time period of the second terminal device to complete data synchronization. This can reduce the number of times the second terminal device is woken up, thereby reducing the power consumption of the second terminal device.

[0046] Based on any of the possible implementations of the second aspect described above, in the fourth possible implementation of the second aspect, adjusting the times corresponding to the heartbeat nodes of the first terminal device and the second terminal device respectively to obtain the adjusted heartbeat nodes includes:

[0047] Send the heartbeat node and heartbeat cycle of the second terminal device to the first terminal device;

[0048] Receive the absolute time sent by the first terminal device and synchronize the absolute time with the first terminal device, wherein the absolute time represents the power-on duration;

[0049] Receive the calculated optimal heartbeat cycle sent by the first terminal device;

[0050] The adjusted heartbeat node is obtained based on the optimal heartbeat cycle and the absolute time after synchronization.

[0051] In a distributed scenario, the first and second terminal devices can adjust their heartbeat nodes and heartbeat cycles to ensure that the time periods during which they are woken up are consistent. In other words, the time when the first and second terminal devices send and receive heartbeat messages is consistent, thereby reducing the number of times each terminal device is woken up.

[0052] Thirdly, a business collaboration device is provided, applied to a first terminal device in a distributed system, the distributed system comprising the first terminal device and a second terminal device, the first terminal device and the second terminal device being connected, the device comprising:

[0053] The adjustment module is used to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, so as to obtain the adjusted heartbeat node;

[0054] A receiving module is configured to receive a heartbeat message sent by the second terminal device, the heartbeat message including a service identifier, the service identifier being used to indicate a first service running in the foreground of the second terminal device;

[0055] The synchronization module is used to synchronize data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node.

[0056] In a first possible implementation of the third aspect, the synchronization module is specifically used to determine, based on the service identifier, whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; if the second service running in the foreground of the first terminal device is inconsistent with the first service running in the foreground of the second terminal device, then at the time corresponding to the next adjusted heartbeat node, a service message is sent to the second terminal device, the service message being used to synchronize the second service between the first terminal device and the second terminal device.

[0057] Based on the first possible implementation of the third aspect, in the second possible implementation of the third aspect, the synchronization module is further specifically used to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the time corresponding to the next adjusted heartbeat node is reached, the non-real-time collaborative task is triggered to send the service message to the second terminal device.

[0058] In a third possible implementation of the third aspect, the synchronization module is further specifically used to determine, based on the service identifier, whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; if the first service running in the foreground of the first terminal device is consistent with the first service running in the foreground of the second terminal device, then the service message is sent to the second terminal device, the service message being used to synchronize the first service between the first terminal device and the second terminal device.

[0059] Based on any of the possible implementations of the third aspect described above, in a fourth possible implementation of the third aspect, the apparatus further includes:

[0060] The extraction module is used to extract the service identifier bits of the heartbeat message to obtain the service identifier corresponding to the first service.

[0061] Based on any of the above possible implementations of the third aspect, in the fifth possible implementation of the third aspect, the adjustment module is specifically used to receive the heartbeat node and heartbeat cycle sent by the second terminal device; and to calculate the adjusted heartbeat node according to a pre-set heartbeat coordination formula, combined with the heartbeat node and heartbeat cycle sent by the second terminal device and the heartbeat node and heartbeat cycle of the first terminal device.

[0062] Fourthly, a business collaboration device is provided, applied to a second terminal device in a distributed system, wherein the distributed system comprises a first terminal device and a second terminal device, the first terminal device and the second terminal device being connected, and the device comprising:

[0063] The adjustment module is used to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, so as to obtain the adjusted heartbeat node;

[0064] The sending module is used to send a heartbeat message to the first terminal device at the time corresponding to the adjusted heartbeat node. The heartbeat message includes a service identifier, which is used to indicate the first service running in the foreground of the second terminal device.

[0065] The synchronization module is used to synchronize data with the first terminal device based on the service messages sent by the first terminal device.

[0066] In a first possible implementation of the fourth aspect, the sending module is specifically used to determine the service identifier corresponding to the service running in the foreground of the second terminal device; generate the heartbeat message according to the service identifier; and send the heartbeat message to the first terminal device.

[0067] Based on the first possible implementation of the fourth aspect, in the second possible implementation of the fourth aspect, the sending module is further specifically used to determine that the first service is running in the foreground of the second terminal device based on the hand-raising action triggered by the first service; and to obtain the service identifier corresponding to the first service.

[0068] Based on any of the above possible implementations of the fourth aspect, in the third possible implementation of the fourth aspect, the synchronization module is specifically used to receive a service message sent by the first terminal device, the service message being used to perform data synchronization of the second service between the first terminal device and the second terminal device; and to perform data synchronization with the first terminal device for the second service according to the service message.

[0069] Based on any of the above possible implementations of the fourth aspect, in the fourth possible implementation of the fourth aspect, the adjustment module is specifically used to send the heartbeat node and heartbeat cycle of the second terminal device to the first terminal device; receive the absolute time sent by the first terminal device and synchronize the absolute time with the first terminal device, wherein the absolute time represents the power-on duration; receive the calculated optimal heartbeat cycle sent by the first terminal device; and obtain the adjusted heartbeat node based on the optimal heartbeat cycle and the synchronized absolute time.

[0070] Fifthly, an electronic device is provided, comprising: a processor for running a computer program stored in a memory to enable the electronic device to implement the business collaboration method as described in any one of the first or second aspects.

[0071] In a sixth aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the business collaboration method as described in any one of the first or second aspects.

[0072] In a seventh aspect, a chip system is provided, the chip system including a memory and a processor, the processor executing a computer program stored in the memory to implement the business collaboration method as described in any one of the first or second aspects.

[0073] It is understood that the beneficial effects of the third to seventh aspects mentioned above can be found in the relevant descriptions in the first and second aspects mentioned above, and will not be repeated here. Attached Figure Description

[0074] Figure 1A This application provides a schematic diagram of a distributed scenario as an embodiment of the present application.

[0075] Figure 1B This application provides a schematic diagram illustrating the status of various terminal devices in a distributed scenario.

[0076] Figure 2 This is a schematic diagram illustrating the collaborative operation of various terminal devices in a distributed scenario, as provided in an embodiment of this application.

[0077] Figure 3 A schematic flowchart illustrating a business collaboration method provided in an embodiment of this application;

[0078] Figure 4 This is a flowchart illustrating how the heartbeat times of the central node and child nodes are adjusted, as provided in an embodiment of this application.

[0079] Figure 5A A schematic diagram of a heartbeat node for unified heartbeat management across devices is provided in an embodiment of this application;

[0080] Figure 5B A schematic diagram of a heartbeat node for unified heartbeat management within the same terminal device, provided as an embodiment of this application;

[0081] Figure 6 This application provides a schematic diagram of a heartbeat node for multiple terminal devices in a distributed scenario.

[0082] Figure 7 This is a schematic diagram illustrating a process for business collaboration among multiple terminal devices, provided as an embodiment of this application.

[0083] Figure 8 A schematic diagram of a heartbeat message provided in an embodiment of this application;

[0084] Figure 9 This is another schematic diagram of the status of various terminal devices provided in an embodiment of this application;

[0085] Figure 10 This is a schematic diagram of the state changes of a terminal device provided in an embodiment of this application;

[0086] Figure 11 A schematic diagram of a software process for collaborative operation of multiple terminal devices provided in an embodiment of this application;

[0087] Figure 12 A structural block diagram of a business collaboration device provided in an embodiment of this application;

[0088] Figure 13 A structural block diagram of another business collaboration device provided in the embodiments of this application;

[0089] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0090] Figure 15 This is a software structure block diagram of a terminal device according to an embodiment of this application. Detailed Implementation

[0091] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known device networking access methods, resource release / recovery methods, and electronic devices are omitted to avoid unnecessary detail from hindering the description of this application.

[0092] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “the,” “the,” and “the” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise.

[0093] First, we will introduce the distributed scenarios involved in business collaboration methods.

[0094] Distributed scenarios can be application scenarios that use distributed technologies to implement cross-device services.

[0095] Specifically, a distributed scenario can include multiple terminal devices, and the hardware of each terminal device can be added to a shared resource pool within the distributed scenario. That is, the various terminal devices can share their hardware and functionalities. Consequently, in practical applications, each terminal device can, based on the resources in the shared resource pool, call upon the hardware of other terminal devices for different types of services, thereby enabling the completion of different business tasks in the distributed scenario (such as audio and video calls, cross-terminal collaborative office work, and cross-device services like smart vehicle systems).

[0096] For example, in a distributed scenario involving a mobile phone and a television, if a user wants to watch a video currently playing on their phone using the larger screen of the television, the phone can, based on a triggered action, utilize the television's screen and speakers to play the video. Alternatively, while the television is playing a program, the phone's microphone can be used to receive voice commands directed to the television, adjusting the volume, channel, or program being played.

[0097] It should be noted that in a distributed scenario, various terminal devices can be connected through a communication module. This communication module can be considered a transmission protocol. In a distributed scenario, various terminal devices can easily and quickly connect to other terminal devices through the communication module, thereby enabling them to access the hardware of other terminal devices and complete corresponding business tasks.

[0098] In other words, the communication module can serve as the communication base for various terminal devices in distributed scenarios such as mobile phones, tablets, wearable devices, smart screens, and in-vehicle systems, providing unified communication capabilities for interconnection between various terminal devices and creating conditions for seamless discovery and zero-wait transmission between devices.

[0099] For example, in existing technology, if a mobile phone needs to send photos to a computer via Bluetooth, the phone must first enable Bluetooth, search for the computer, and then pair and authorize the connection. After establishing a Bluetooth connection, the phone can send the photos to the computer.

[0100] In a distributed scenario, each terminal device can proactively discover other terminal devices based on the communication module. A mobile phone can proactively discover a computer in a distributed environment and establish a connection with the computer through the communication module. Furthermore, when both the mobile phone and the computer are configured with a photo library service, the mobile phone can proactively send photos to the computer, achieving data synchronization between the two devices for the photo library service.

[0101] See Figure 1A , Figure 1A This is a schematic diagram of a distributed scenario provided in an embodiment of this application. The distributed scenario may include: terminal device A, terminal device B, and terminal device C.

[0102] In this setup, terminal device B is connected to both terminal device A and terminal device C. Furthermore, each terminal device located in the same distributed environment can send heartbeat messages and / or service messages to other terminal devices.

[0103] Among them, the heartbeat message is used to detect which terminal devices are included in the distributed scenario, that is, to detect whether other terminal devices are still in the distributed scenario.

[0104] Furthermore, service messages are used to enable cross-device services between various terminal devices. Each terminal device can synchronize data for the same service through service messages. For example, each terminal device can send service data to other terminal devices through service messages, enabling other terminal devices to synchronize service data and complete cross-device services.

[0105] Specifically, terminal device B can send heartbeat messages to remote devices (terminal device A and terminal device C) via the communication module to detect whether the remote devices are still in a distributed environment. Terminal device B can also receive heartbeat messages sent by remote devices via the communication module.

[0106] Alternatively, both terminal device A and terminal device B include a distributed image library service. If terminal device A is currently running the distributed image library service in the foreground, and terminal device A detects that a deletion operation has been triggered on an image in the distributed image library, then terminal device A can delete the corresponding image in the distributed image library. Furthermore, terminal device A can also send a service message to terminal device B, instructing terminal device B to synchronize data in its distributed image library according to the service message, which also means deleting the corresponding image in the distributed image library.

[0107] Similarly, both terminal device B and terminal device C include a distributed file manager service. If terminal device B is currently running the distributed file manager service in the foreground, and terminal device B detects that a storage operation has been triggered on a certain file, then terminal device B can store that file through the distributed file manager. Furthermore, terminal device B can also send a service message to terminal device C, instructing terminal device C to perform data synchronization through the distributed file manager in terminal device C, that is, to store the file on terminal device C as well.

[0108] See Figure 1B , Figure 1B This is a schematic diagram illustrating the status of various terminal devices in a distributed scenario, provided by an embodiment of this application. Figure 1B The diagram shows the heartbeat messages sent by each of the aforementioned terminal devices. Figure 1B The time point of the hollow triangle in the diagram also indicates the time when terminal device A and terminal device C send service messages ( Figure 1B The time point (the solid triangle in the diagram) also shows the time point at which terminal device B receives the service message.

[0109] If terminal devices A, B, and C are not currently running cross-device services in the foreground, each terminal device can enter a sleep state to reduce power consumption. Each terminal device still needs to periodically send heartbeat messages to other devices to determine if they are still in a distributed environment.

[0110] Accordingly, see Figure 1B Terminal devices A, B, and C send heartbeat messages to other terminal devices at different times, waking up the receiving terminal devices from sleep mode. Furthermore, terminal device B also sends service messages to terminal devices A and C at different times, waking up terminal devices A and C upon receiving these service messages. Therefore, terminal devices A, B, and C are frequently woken up at multiple times, increasing the power consumption of each terminal device.

[0111] Therefore, this application proposes a service collaboration method. A terminal device can determine the service running in the foreground of a remote device based on a heartbeat message received from the remote device. If the service running in the foreground of the terminal device differs from the service running in the foreground of the remote device, the terminal device can delay data synchronization with the remote device (e.g., sending a service message to the remote device while sending a heartbeat message). If the service running in the foreground of the terminal device is the same as the service running in the foreground of the remote device, the terminal device can synchronize data with the remote device in real time, achieving collaborative operation. By using different methods to perform collaborative operation and complete data synchronization based on the services running in the foreground of the terminal device and the remote device, the duration and frequency of wake-up for both the terminal and remote devices can be reduced, thus lowering their power consumption.

[0112] See Figure 2 , Figure 2 This is a schematic diagram of a process for collaborative operation of various terminal devices in a distributed scenario provided by an embodiment of this application. The distributed scenario includes a first terminal device and a second terminal device, wherein the first terminal device and the second terminal device are connected.

[0113] The first terminal device can first form a network with the second terminal device to access the distributed scenario. Then, the first terminal device can receive heartbeat messages sent by the second terminal device and determine the first service that the second terminal device is currently running in the foreground based on the service status information carried in the heartbeat message.

[0114] The first terminal device is running the second service in the foreground, not the first service, which is different from the second terminal device running the first service in the foreground. To reduce the power consumption of the first and second terminal devices, the first terminal device no longer performs real-time collaborative work with the second terminal device to complete data synchronization. Instead, it can register delayed non-real-time tasks in the task scheduler of the first terminal device, that is, register non-real-time tasks that perform data synchronization and collaborative work between the first service and the second terminal device.

[0115] The task scheduler of the first terminal device controls the first terminal device to execute various tasks registered in the task scheduler in a pre-set order. Furthermore, the task scheduler can also control the first terminal device to delay the execution of non-real-time tasks. For example, the first terminal device may only execute a non-real-time task in the task scheduler when certain conditions are met.

[0116] Furthermore, non-real-time tasks can be tasks registered in the task scheduler that can be executed with a delay, or tasks that the terminal device can only execute when the terminal device's state meets certain conditions.

[0117] Correspondingly, the task scheduler can obtain the status of the timer, power supply, and network of the first terminal device, and set constraints for the aforementioned non-real-time tasks based on the obtained status. When the status of the timer, power supply, and network all meet the status indicated by the constraints, the first terminal device can execute the registered non-real-time task through the task scheduler. That is, the second service in the first terminal device executes cross-device service through the communication module, enabling the first service of the first terminal device and the first service of the second terminal device to work together to complete data synchronization.

[0118] Specifically, when the first terminal device and the second terminal device are awakened again, that is, when they can send and receive heartbeat messages, the first terminal device can perform cross-device services, enabling data transmission between the first terminal device and the second terminal device, thereby controlling the first service of the second terminal device to coordinate with the first service of the first terminal device to perform cross-device services, and completing the data synchronization of the first terminal device and the second terminal device for the first service.

[0119] It should be noted that in practical applications, a distributed scenario may include multiple networked terminal devices. For the sake of simplicity, this application embodiment uses two terminal devices as an example for description. This application embodiment does not limit the number of terminal devices in a distributed scenario.

[0120] The following example, using two terminal devices in a distributed scenario, illustrates a method for collaborative execution of cross-device services by various terminal devices in order to reduce the power consumption of the terminal devices.

[0121] Figure 3 This is a schematic flowchart illustrating a business collaboration method provided in an embodiment of this application. It is intended as an example and not a limitation. This method can be applied to the first terminal device and the second terminal device in the aforementioned distributed scenario. (See also...) Figure 3 The method includes:

[0122] Step 301: Adjust the times corresponding to the heartbeat nodes of the first terminal device and the second terminal device respectively to obtain the adjusted heartbeat nodes.

[0123] In this scenario, both the first and second terminal devices are located in a distributed environment and are connected to each other. A heartbeat node represents the time at which each terminal device sends a heartbeat message, and since each terminal device sends heartbeat messages periodically, the duration between any two adjacent heartbeat nodes is the heartbeat cycle.

[0124] In a distributed scenario, multiple terminal devices can periodically send heartbeat messages to identify their current location within the distributed environment. However, each terminal device needs to be woken up to send and receive heartbeat messages, and the timing of these heartbeat messages varies, resulting in frequent wake-ups and increased standby current, thus increasing power consumption.

[0125] Therefore, in this embodiment, the first terminal device and the second terminal device can first adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, so that each terminal device can send heartbeat messages at the same time. That is, the first terminal device and the second terminal device send heartbeat messages after the same amount of time has elapsed for a certain absolute time (such as the power-on time of the first terminal device or the power-on time of the second terminal device), thereby reducing the time that each terminal device is in the wake-up state and reducing the power consumption of each terminal device.

[0126] In one optional embodiment, after the first terminal device and the second terminal device form a network, the communication module in the distributed scenario can use the first terminal device as the central node and the second terminal device as a child node. After the second terminal device accesses the distributed scenario, the central node can generate an adjusted heartbeat cycle and heartbeat node based on a pre-set heartbeat coordination formula, combining the heartbeat cycle and heartbeat node of the central node with the heartbeat cycle and heartbeat node of the child node, and send the adjusted heartbeat cycle and heartbeat node to the child node, thereby managing the heartbeat node of the child node through the central node.

[0127] See Figure 4 , Figure 4 This application provides a flowchart illustrating the adjustment of the heartbeat times of the central node and child nodes, respectively. Both the central node and child nodes include a heartbeat management module for unified heartbeat management, and transmit data such as the heartbeat cycle and heartbeat nodes of the central node and child nodes through the time management module of the communication module in the distributed scenario.

[0128] Specifically, after the child node connects to the distributed scenario through the network with the central node, the child node can send its heartbeat cycle to the central node through the time management module of the communication module. The central node can also synchronize the absolute time of the first terminal device with the child node through the time management module of the communication module, that is, synchronize the power-on duration of the first terminal device with the child node.

[0129] Subsequently, the heartbeat management module of the central node can generate an optimal heartbeat cycle based on the heartbeat cycles of the child nodes, combined with the heartbeat cycle of the central node and the heartbeat node (i.e., the existing timer task of the first terminal device), using a pre-set heartbeat coordination formula. The central node can also send the generated optimal heartbeat cycle to the child nodes via the communication module. Correspondingly, the heartbeat management module of the child nodes can adjust the heartbeat node of the second terminal device based on the received optimal heartbeat cycle, thereby completing the adjustment of the timing corresponding to the heartbeat nodes of the first and second terminal devices respectively.

[0130] In the process of generating the optimal heartbeat cycle, the central node can generate the optimal heartbeat cycle based on the minimum heartbeat cycle of each terminal device in the distributed scenario. Of course, it can also generate the optimal heartbeat cycle in other ways. This application embodiment does not limit this.

[0131] Furthermore, in a distributed scenario, each terminal device can run multiple services simultaneously on the same device. Each service can collaborate with services on other terminal devices in real time, or, based on adjusted heartbeat nodes, collaborate with services on other terminal devices at the corresponding times of the heartbeat nodes.

[0132] Accordingly, before coordinating operations based on heartbeat nodes, terminal devices can align the time when a service triggers a collaborative operation with the terminal device's heartbeat node. Specifically, the terminal device can reset the time when a service triggers a collaborative operation based on its absolute time, the time when the service triggers the collaborative operation, and the terminal device's heartbeat cycle, using a pre-set heartbeat coordination formula. This allows the services running on the terminal device to collaborate with other terminal devices at the time corresponding to the heartbeat node, achieving data synchronization.

[0133] For example, see Figure 5A This illustrates a diagram of heartbeat nodes for unified heartbeat management across devices, such as... Figure 5A As shown, the power-on time of the central node is 11:02:00, and the power-on time of the child nodes is 11:00:00. The heartbeat cycle of both the central node and the child nodes is 5 minutes. When the child node accesses the distributed scenario and forms a network with the central node at 11:08:00, the absolute time of the central node is 6 minutes, and the absolute time of the child node is 8 minutes.

[0134] Correspondingly, the absolute times corresponding to the original heartbeat nodes of the central node and child nodes are 5 min, 10 min, and 15 min, respectively. That is, the original heartbeat nodes of the central node correspond to multiple times such as 11:07:00, 11:12:00, and 11:17:00, and the original heartbeat nodes of the child nodes correspond to multiple times such as 11:05:00, 11:10:00, and 11:15:00.

[0135] In a distributed scenario where child nodes are connected to the central node and form a distributed network, the central node can synchronize the absolute time of the child nodes. Then, it can calculate the absolute time corresponding to each new heartbeat node of the child node according to the pre-set heartbeat coordination formula, thereby obtaining the time corresponding to each new heartbeat node of the child node.

[0136] The heartbeat coordination formula can be realTrigger=[(expectTrigger+Time / 2) / Time]*Time+Δ, where realTrigger represents the absolute time corresponding to each new heartbeat node of the child node, expectTrigger represents the absolute time corresponding to each original heartbeat node of the child node, Time represents the heartbeat cycle of the central node, and Δ is the absolute time difference between the power-on time of the central node and the power-on time of the child node.

[0137] After the child nodes and the central node form a distributed network, the central node can calculate (expectTrigger+Time / 2) / Time=(8+5 / 2) / 5=2.1 using the heartbeat coordination formula based on the original heartbeat node of the child node (the absolute time after synchronization is 8min, and the time is 11:10:00) and the heartbeat cycle of the central node (5min). After rounding, [(expectTrigger+Time / 2) / Time]=2. Combining Δ=2min, the absolute time realTrigger corresponding to the new heartbeat node of the child node is calculated as realTrigger=2*5+2=12min. Thus, the time corresponding to the new heartbeat node of the child node is 11:12:00.

[0138] Similarly, the central node can also calculate the time corresponding to other new heartbeat nodes of the child nodes (such as 11:17:00, etc.), which will not be elaborated here.

[0139] See Figure 5B This illustrates a diagram of heartbeat nodes within the same terminal device that manages unified heartbeats. Figure 5BAs shown, the terminal device powers on at 11:00:00, with a heartbeat cycle of 5 minutes. Therefore, the absolute times corresponding to each heartbeat node are 5 minutes, 10 minutes, and 15 minutes, respectively, which translates to heartbeat nodes such as 11:05:00, 11:10:00, and 11:15:00. The timer for the service running on the terminal device triggers at 11:04:00, meaning the currently running service triggers collaborative work at an absolute time of 4 minutes. The terminal device can adjust the trigger time of this timer according to the heartbeat coordination formula, using the closest heartbeat node as the trigger time for the service's corresponding timer.

[0140] The heartbeat coordination formula is realTrigger=[(expectTrigger+5min / 2) / 5min]*5min, where realTrigger represents the absolute time corresponding to the updated trigger time, expectTrigger represents the absolute time corresponding to the original trigger time, and Time represents the heartbeat cycle of the central node.

[0141] Accordingly, the original trigger time was 11:04:00, and the corresponding absolute time expectTrigger was 4 minutes. Therefore, the absolute time realTrigger corresponding to the updated trigger time is [(4+5 / 2) / 5]*5=5 minutes, which is 11:05:00, thus aligning with the heartbeat node of the terminal device.

[0142] It should be noted that this application embodiment uses two terminal devices as an example to illustrate cross-device unified heartbeat management. In practical applications, distributed scenarios may include multiple networked terminal devices. After a new child node is connected in a distributed scenario, the central node can adjust the heartbeat node and heartbeat cycle of the new child node based on the heartbeat node and heartbeat cycle of the central node, so that the heartbeat node and heartbeat cycle of the new child node are consistent with the heartbeat node and heartbeat cycle of the central node, thereby realizing cross-device unified heartbeat management.

[0143] For example, see Figure 6 , Figure 6 This application provides a schematic diagram of heartbeat nodes for multiple terminal devices in a distributed scenario. The distributed scenario may include terminal device A, terminal device B, terminal device C, and terminal device D. Before networking, the heartbeat nodes of each terminal device are different. After networking, the heartbeat node closest to the current time can be determined as the heartbeat node of terminal device B based on the heartbeat nodes of multiple terminal devices.

[0144] Furthermore, multiple terminal devices can select a central node based on their respective power supply types. If terminal device A is powered by a high-capacity battery, terminal device B is connected to the mains power via a power cord, and terminal devices C and D are powered by low-capacity batteries, then terminal device B can maintain continuous power supply. Terminal device B can be designated as the central node, and the other terminal devices can be designated as child nodes. The heartbeat nodes and heartbeat cycles of the other terminal devices can then be adjusted based on the heartbeat node and heartbeat cycle of terminal device B.

[0145] Step 302: The second terminal device sends a heartbeat message to the first terminal device.

[0146] The heartbeat message includes the service identifiers of various services currently in operation on the second terminal device.

[0147] After the first terminal device and the second terminal device have coordinated the heartbeat nodes, the first terminal device can send a heartbeat message to the second terminal device based on the heartbeat node, and the second terminal device can also send a heartbeat message to the first terminal device based on the heartbeat node. The following explanation uses the example of the second terminal device sending a heartbeat message to the first terminal device.

[0148] During operation, if the second terminal device is currently running the first service in the foreground, it can detect the hand-raising action triggered by the first service, indicating that the first service is currently running in the foreground. Accordingly, the second terminal device can determine the service status of the first service as running based on this hand-raising action, while other services that have not triggered a hand-raising action are in a dormant or paused state.

[0149] The hand-raising action triggered by the first service can be a broadcast signal for the first service, used to inform the system that the first service is currently running in the foreground. Service status can include: running, paused, and dormant. Running indicates that the service is currently running in the foreground, paused indicates that the service is currently running in the background, and dormant indicates that the service is not currently running.

[0150] Subsequently, during the generation of the heartbeat message, the second terminal device can also obtain the service identifier of the first service based on the hand-raising action triggered by the first service, and add it to the heartbeat message along with the service status of the first service. This allows the heartbeat message to carry the service identifier and service status of the first service running in the foreground of the second terminal device, so that the first terminal device can determine the first service currently running in the foreground of the second terminal device through the heartbeat message.

[0151] If the services running in the foreground of the first terminal device are the same as those running in the foreground of the second terminal device, the first terminal device can execute step 303 to achieve collaborative operation with the second terminal device and synchronize the data of the second terminal device in the first terminal device. If the services running in the foreground of the first terminal device are different from those running in the foreground of the second terminal device, the first terminal device can execute step 304 to achieve collaborative operation with the second terminal device based on the heartbeat cycle and heartbeat node of the first terminal device.

[0152] For example, see Figure 7 , Figure 7 This is a schematic diagram illustrating a process for business collaboration among multiple terminal devices, provided in an embodiment of this application. The distributed image library service on the computer is in running mode, while the distributed file manager service on the tablet is in dormant mode. Correspondingly, the mobile phone can determine, through the business status collaboration module in the resource scheduling subsystem, whether the computer is running the distributed image library service in the foreground based on the heartbeat messages sent by the computer and tablet via the bus channel module of the communication module.

[0153] If the mobile phone is also running the distributed image library service in the foreground, the mobile phone's resource scheduling subsystem can add the collaborative tasks corresponding to the distributed image library service to the system activity window (unfreeze window). Through the resource scheduling subsystem, the distributed image library service's resources are restored in the communication module (such as restoring the BR link and WiFi link), so that the mobile phone can send the service messages corresponding to the distributed image library service to the computer through the communication module.

[0154] If the mobile phone is running the distributed file manager service in the foreground, while the tablet's distributed file manager service is not running but in a dormant state, the mobile phone's resource scheduling subsystem can add the collaborative task corresponding to the distributed file manager service to the system freeze window. The resource scheduling subsystem can also release the resources corresponding to the distributed file manager service in the communication module (such as restoring the BR link and WiFi link). This prevents the mobile phone from sending the service messages corresponding to the distributed file manager service to the tablet via the communication module. The mobile phone can only send the service messages corresponding to the distributed file manager service to the tablet after the system freeze window meets the constraints and is unfrozen.

[0155] For example, such as Figure 8 As shown, Figure 8This is a schematic diagram of a heartbeat message provided in an embodiment of this application. In addition to a frame header, a frame tail, and a device identifier of a second terminal device, the heartbeat message may also include a service raising bit. The service raising bit includes a service identifier bit and a service status bit of the raising service. The service identifier bit of the raising service can be the identifier of a first service, and the service status bit of the raising service can be the running state.

[0156] It should be noted that during the operation of the first service of the second terminal device in the foreground, a hand-raising action can be periodically triggered so that the heartbeat message sent by the second terminal device can continuously carry the service identifier and service status of the first service. The triggering period can be the same as or less than the heartbeat period of the second terminal device; this embodiment does not limit the triggering period.

[0157] Furthermore, if the first service switches from running to paused, it can trigger a hand-raising action to indicate that it is currently paused. Correspondingly, the heartbeat message from the second terminal device can also include the service identifier of the first service and the service status indicating the paused state.

[0158] Step 303: If the service running in the foreground of the first terminal device is the same as the service running in the foreground of the second terminal device, then the first terminal device sends a service message to the second terminal device.

[0159] This service message is used to initiate data synchronization between the first terminal device and the second terminal device, so that the second terminal device can send data to the first terminal device according to the service message, thereby achieving data synchronization.

[0160] After receiving a heartbeat message from the second terminal device, the first terminal device can determine from the heartbeat message that the second terminal device is running the first service in the foreground. If the first terminal device is also currently running the first service in the foreground, it can send a service message to the second terminal device so that in subsequent steps, the first terminal device and the second terminal device can collaborate to complete the task for the first service.

[0161] Specifically, after receiving the heartbeat message from the second terminal device, the first terminal device can extract the data from the heartbeat message to determine that the second terminal device is running the first service in the foreground. Furthermore, the first terminal device is currently running the first service in the foreground as well. The first service of the first terminal device can initiate a collaborative task. The first terminal device can then add this collaborative task to the system activity window of the resource scheduling subsystem based on the running status of the first service. This allows the communication module subsystem of the first terminal device to restore resources for the collaborative task and send service messages to the second terminal device through the communication module. In step 305, the second terminal device can then perform collaborative work based on the received service messages.

[0162] Furthermore, in practical applications, if the first terminal device is also currently running the first service in the foreground, it indicates that the first terminal device also has data that needs to be synchronized with the second terminal device for the first service. Accordingly, the heartbeat message sent by the first terminal device to the second terminal device can also include the service identifier of the first service and the service status indicating its running state. Similarly, the second terminal device can also adopt a similar approach to the first terminal device; the first service of the second terminal device can also initiate collaborative work with the first terminal device to complete data synchronization.

[0163] Step 304: If the service running in the foreground of the first terminal device is inconsistent with the service running in the foreground of the second terminal device, the first terminal device sends a service message to the second terminal device according to the heartbeat node.

[0164] If the first terminal device is currently running the second service in the foreground, and the heartbeat message determines that the second terminal device is currently running the first service in the foreground, then the first terminal device can delay sending the service message for collaborative operation of the second service to the second terminal device.

[0165] Specifically, after receiving the heartbeat message sent by the second terminal device, the first terminal device can extract the data in the heartbeat message to determine that the second terminal device is running the first service in the foreground, while the first terminal device is currently running the second service in the foreground. The services running in the foreground of the first terminal device are different from those running in the foreground of the second terminal device.

[0166] Correspondingly, the first terminal device can mark the first service as running and exempt it from control. Then, through the resource scheduling subsystem of the first terminal device, the collaborative work task initiated by the first service can be added to the system freeze window so that at the next heartbeat node, the first terminal device can work collaboratively with the second terminal device for the first service to complete data synchronization.

[0167] When the first terminal device reaches the next heartbeat node after one heartbeat cycle, it can send a heartbeat message to the second terminal device. The various tasks in the system freeze window of the first terminal device can also enter the system activity window, so that they can send service messages to the second terminal device. In step 305, the second terminal device can complete the collaborative operation task with the first terminal device for the first service and realize data synchronization.

[0168] Step 305: The second terminal device, based on the service message, collaborates with the first terminal device to execute cross-device services and synchronize data between the first terminal device and the second terminal device.

[0169] Corresponding to step 303 or step 304, the second terminal device can receive service messages sent in real time or with a delay from the first terminal device, and perform collaborative operations with the first terminal device for the first service or the second service based on the received service messages, thereby achieving data synchronization between the first terminal device and the second terminal device.

[0170] In an optional embodiment, corresponding to step 303, if both the first terminal device and the second terminal device are currently running the first service in the foreground, then after the second terminal device sends a heartbeat message to the first terminal device in step 302, it can receive the service message sent by the first terminal device for the first service in real time. Thus, it can send service data to the first terminal device according to the received service message, thereby synchronizing the data corresponding to the first service in the first terminal device and completing the collaborative operation between the first terminal device and the second terminal device.

[0171] In another optional embodiment, corresponding to step 304, if the first terminal device is currently running the second service in the foreground, then after the second terminal device sends a heartbeat message to the first terminal device in step 302, when a heartbeat cycle has elapsed and the next heartbeat node is reached, the first terminal device can simultaneously send a service message for the second service to the second terminal device. That is, the second terminal device needs to wait for one heartbeat cycle before it can receive the service message for the second service sent by the first terminal device. The second terminal device also needs to wait for one heartbeat cycle before it can collaborate with the first terminal device on the second service to achieve data synchronization.

[0172] Correspondingly, the second terminal device can also send a service message for the first service to the first terminal device based on the received heartbeat message, thereby synchronizing the data corresponding to the first service in the first terminal device and completing the collaborative operation between the first terminal device and the second terminal device.

[0173] It should be noted that the embodiments in this application are illustrated using non-real-time services as an example, meaning that the delayed service messages sent by the first terminal device to the second terminal device only apply to non-real-time services. In practical applications, however, terminal devices can run both non-real-time and real-time services, and the types of services that the terminal devices can run in this application embodiment are not limited.

[0174] For example, non-real-time services of terminal devices may include: full or incremental image synchronization triggered outside the foreground, automatic preloading or caching of thumbnails, data change notifications triggered outside the foreground, and synchronization of data interaction services triggered outside the foreground. Furthermore, some services of terminal devices can be classified as real-time or non-real-time services based on different conditions, as shown in Table 1, which illustrates how different services are classified as real-time or non-real-time services under different conditions.

[0175] Table 1

[0176]

[0177] Accordingly, see Figure 9 , Figure 9 This is another schematic diagram of the states of various terminal devices provided in an embodiment of this application. After adjusting the heartbeat node and heartbeat period, each terminal device (terminal device A, terminal device B, terminal device C, and terminal device D) can send heartbeat messages at the same time (hollow triangles in the diagram), and at the same time as sending the heartbeat messages, simultaneously send service messages corresponding to non-real-time services (striped triangles in the diagram). Moreover, terminal devices B and D can also send service messages corresponding to real-time services at non-heartbeat nodes (solid triangles in the diagram).

[0178] See Figure 10 , Figure 10 This diagram illustrates the state changes of a terminal device according to an embodiment of this application. When cross-device services are not coordinated and unified, the terminal device is frequently woken up, and its standby current frequently increases. After cross-device services are coordinated and unified, the terminal device is periodically in a wake-up state, and the number of times it is woken up decreases significantly. Furthermore, the standby current of the terminal device also shows a significant decrease.

[0179] Furthermore, in existing technologies, when multiple terminal devices are networked, in a distributed scenario, adding one terminal device increases the current of each terminal device to 15.5 mA, with a power consumption increase of 18.32%; adding two terminal devices increases the current to 17.4 mA, with a power consumption increase of 32.82%; adding three terminal devices increases the current to 19.3 mA, with a power consumption increase of 47.33%; and adding four terminal devices increases the current to 20.1 mA, with a power consumption increase of 53.44%.

[0180] After adopting the business collaboration method provided in this application, the power consumption of each terminal device in a distributed scenario is significantly reduced after adding terminal devices. For example, when one terminal device is added in a distributed scenario, the power consumption increases by about 10%; when two or more terminal devices are added in a distributed scenario, the power consumption increases by only 25% to 30%.

[0181] The following example illustrates the collaborative operation of a first terminal device and a second terminal device on a distributed image library, showcasing the workflow of their software architectures during collaborative work. (See also...) Figure 11 , Figure 11 This is a schematic diagram of a software process for collaborative operation of multiple terminal devices, provided as an embodiment of this application.

[0182] In this setup, the first and second terminal devices are networked via a communication module based on a networking protocol, jointly accessing the distributed scenario. Furthermore, the first terminal device can send heartbeat messages through the communication module to determine if the second terminal device is still within the distributed scenario. Similarly, the second terminal device can also send heartbeat messages through the communication module to determine if the first terminal device is still within the distributed scenario.

[0183] The second terminal device runs a distributed image library in the foreground. If it detects a triggered image addition operation, it can store the added image. Furthermore, at the time corresponding to the heartbeat node, the second terminal device can determine through the lifecycle module of the distributed low-power framework in the second terminal device that the distributed image library is currently running, that is, it is currently running in the foreground. Then, the second terminal device can send a service identifier and service status of the distributed image library to the first terminal device.

[0184] Correspondingly, the first terminal device can receive heartbeat messages sent by the second terminal device and determine from the heartbeat messages that the second terminal device is currently running the distributed graph library in the foreground. Then, the first terminal device can exempt the distributed graph library from control through the low-power management module of the distributed low-power framework so that the distributed graph library of the first terminal device can initiate collaborative work to the second terminal device at the next heartbeat node.

[0185] After one heartbeat cycle, the distributed image library of the first terminal device can initiate collaborative tasks to the second terminal device through the task scheduling module and collaborative execution module of the distributed low-power framework. The second terminal device can then interact with the first terminal device through the communication module, storing the images stored in the distributed image library of the second terminal device in the first terminal device, thereby realizing business collaboration and completing data synchronization.

[0186] In summary, the service collaboration method provided in this application allows a terminal device to obtain the service status of various services of other terminal devices based on received heartbeat messages in a distributed scenario. If the service running in the foreground of other terminal devices is the same as the service currently running in the foreground of the terminal device, the terminal device can collaborate with other terminal devices in real time to complete data synchronization. If the service running in the foreground of other terminal devices is different from the service currently running in the foreground of the terminal device, the terminal device can delay collaborating with other terminal devices and utilize the wake-up time of other terminal devices to complete data synchronization, thereby reducing the number of times each terminal device is woken up and thus reducing the power consumption of other terminal devices.

[0187] Moreover, in a distributed scenario, by coordinating heartbeat nodes and heartbeat cycles, the time periods during which each terminal device is woken up can be unified, which means unifying the time when each terminal device sends and receives heartbeat messages, thereby reducing the number of times each terminal device is woken up.

[0188] In addition, each terminal device can send heartbeat messages and service messages simultaneously at the time corresponding to the heartbeat node, based on the adjusted heartbeat node and heartbeat cycle, and jointly utilize the wake-up time period of each terminal device, thereby reducing the power consumption of each terminal device.

[0189] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0190] Corresponding to the business collaboration method described in the above embodiments, Figure 12 This is a structural block diagram of a business collaboration device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0191] Reference Figure 12 The device includes:

[0192] The adjustment module 1201 is used to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, so as to obtain the adjusted heartbeat node.

[0193] The receiving module 1202 is used to receive a heartbeat message sent by the second terminal device. The heartbeat message includes a service identifier, which is used to indicate a first service running in the foreground of the second terminal device.

[0194] The synchronization module 1203 is used to synchronize data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node.

[0195] Optionally, the synchronization module 1203 is specifically used to determine, based on the service identifier, whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; if the second service running in the foreground of the first terminal device is inconsistent with the first service running in the foreground of the second terminal device, then at the time corresponding to the next adjusted heartbeat node, a service message is sent to the second terminal device, and the service message is used to synchronize the second service between the first terminal device and the second terminal device.

[0196] Optionally, the synchronization module 1203 is also specifically used to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the time corresponding to the next adjusted heartbeat node is reached, the non-real-time collaborative task is triggered to send the service message to the second terminal device.

[0197] Optionally, the synchronization module 1203 is further configured to determine, based on the service identifier, whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; if the first service running in the foreground of the first terminal device is consistent with the first service running in the foreground of the second terminal device, then send the service message to the second terminal device, the service message being used to synchronize the first service between the first terminal device and the second terminal device.

[0198] Optionally, the device may also include:

[0199] The extraction module 1204 is used to extract the service identifier bit of the heartbeat message to obtain the service identifier corresponding to the first service.

[0200] Optionally, the adjustment module 1201 is specifically used to receive the heartbeat node and heartbeat cycle sent by the second terminal device; and to calculate the adjusted heartbeat node based on the pre-set heartbeat coordination formula, combined with the heartbeat node and heartbeat cycle sent by the second terminal device and the heartbeat node and heartbeat cycle of the first terminal device.

[0201] Figure 13 This is a structural block diagram of another business collaboration device provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0202] Reference Figure 13 The device includes:

[0203] The adjustment module 1301 is used to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, so as to obtain the adjusted heartbeat node.

[0204] The sending module 1302 is used to send a heartbeat message to the first terminal device at the time corresponding to the adjusted heartbeat node. The heartbeat message includes a service identifier, which is used to indicate the first service running in the foreground of the second terminal device.

[0205] The synchronization module 1303 is used to synchronize data with the first terminal device based on the service messages sent by the first terminal device.

[0206] Optionally, the sending module 1302 is specifically used to determine the service identifier corresponding to the service running in the foreground of the second terminal device; generate the heartbeat message based on the service identifier; and send the heartbeat message to the first terminal device.

[0207] Optionally, the sending module 1302 is further configured to determine, based on the hand-raising action triggered by the first service, that the first service is running in the foreground of the second terminal device; and to obtain the service identifier corresponding to the first service.

[0208] Optionally, the synchronization module 1303 is specifically used to receive a service message sent by the first terminal device, the service message being used to perform data synchronization for the second service between the first terminal device and the second terminal device; and to perform data synchronization with the first terminal device for the second service based on the service message.

[0209] Optionally, the adjustment module 1301 is specifically used to send the heartbeat node and heartbeat cycle of the second terminal device to the first terminal device; receive the absolute time sent by the first terminal device and synchronize the absolute time with the first terminal device, wherein the absolute time represents the power-on duration; receive the calculated optimal heartbeat cycle sent by the first terminal device; and obtain the adjusted heartbeat node based on the optimal heartbeat cycle and the synchronized absolute time.

[0210] In summary, the service collaboration device provided in this application embodiment allows a terminal device to obtain the service status of various services of other terminal devices based on received heartbeat messages in a distributed scenario. If the service running in the foreground of other terminal devices is the same as the service currently running in the foreground of the terminal device, the terminal device can collaborate with other terminal devices in real time to complete data synchronization. If the service running in the foreground of other terminal devices is different from the service currently running in the foreground of the terminal device, the terminal device can delay collaborating with other terminal devices and utilize the wake-up time of other terminal devices to complete data synchronization, thereby reducing the number of times each terminal device is woken up and thus reducing the power consumption of other terminal devices.

[0211] The terminal devices involved in the embodiments of this application are described below. Please refer to... Figure 14 , Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application.

[0212] The terminal device may include a processor 1410, an external memory interface 1420, an internal memory 1421, a universal serial bus (USB) interface 1430, a charging management module 1440, a power management module 1441, a battery 1442, antenna 1, antenna 2, a mobile communication module 1450, a wireless communication module 1460, an audio module 1470, a speaker 1470A, a receiver 1470B, a microphone 1470C, a headphone jack 1470D, a sensor module 1480, buttons 1490, a motor 1491, an indicator 1492, a camera 1493, a display screen 1494, and a subscriber identification module (SIM) card interface 1495, etc. The sensor module 1480 may include a pressure sensor 1480A, a gyroscope sensor 1480B, a barometric pressure sensor 1480C, a magnetic sensor 1480D, an accelerometer sensor 1480E, a distance sensor 1480F, a proximity sensor 1480G, a fingerprint sensor 1480H, a temperature sensor 1480J, a touch sensor 1480K, an ambient light sensor 1480L, a bone conduction sensor 1480M, etc.

[0213] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device. In other embodiments of this application, the terminal device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0214] Processor 1410 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0215] The controller can serve as the nerve center and command center of the terminal device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0216] The processor 1410 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1410 is a cache memory. This memory can store instructions or data that the processor 1410 has just used or that are used repeatedly. If the processor 1410 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 1410, and thus improves the efficiency of the system.

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

[0218] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 1410 may include multiple I2C buses. The processor 1410 can couple to the touch sensor 1480K, charger, flash, camera 1493, etc., through different I2C bus interfaces. For example, the processor 1410 can couple to the touch sensor 1480K through the I2C interface, enabling the processor 1410 and the touch sensor 1480K to communicate through the I2C bus interface, thereby realizing the touch function of the terminal device.

[0219] The I2S interface can be used for audio communication. In some embodiments, the processor 1410 may include multiple I2S buses. The processor 1410 can be coupled to the audio module 1470 via the I2S bus to enable communication between the processor 1410 and the audio module 1470. In some embodiments, the audio module 1470 can transmit audio signals to the wireless communication module 1460 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

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

[0221] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 1410 and the wireless communication module 1460. For example, the processor 1410 communicates with the Bluetooth module in the wireless communication module 1460 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 1470 can transmit audio signals to the wireless communication module 1460 via the UART interface to enable music playback through Bluetooth headphones.

[0222] The MIPI interface can be used to connect the processor 1410 to peripheral devices such as the display screen 1494 and the camera 1493. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 1410 and the camera 1493 communicate via the CSI interface to enable the shooting function of the terminal device. The processor 1410 and the display screen 1494 communicate via the DSI interface to enable the display function of the terminal device.

[0223] The GPIO interface is configurable via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 1410 to a camera 1493, a display screen 1494, a wireless communication module 1460, an audio module 1470, a sensor module 1480, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0224] The USB 1430 interface conforms to the USB standard specification, specifically including Mini USB, Micro USB, and USB Type-C interfaces. The USB 1430 interface can be used to connect a charger to charge terminal devices, and can also be used for data transfer between terminal devices and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other terminal devices, such as AR devices.

[0225] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the terminal device. In other embodiments of this application, the terminal device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0226] The charging management module 1440 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 1440 receives charging input from the wired charger via a USB interface 1430. In some wireless charging embodiments, the charging management module 1440 receives wireless charging input via the wireless charging coil of the terminal device. While charging the battery 1442, the charging management module 1440 can also supply power to the terminal device via the power management module 1441.

[0227] The power management module 1441 connects the battery 1442, the charging management module 1440, and the processor 1410. The power management module 1441 receives input from the battery 1442 and / or the charging management module 1440, providing power to the processor 1410, internal memory 1421, external memory, display 1494, camera 1493, and wireless communication module 1460. The power management module 1441 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 1441 may also be located within the processor 1410. In other embodiments, the power management module 1441 and the charging management module 1440 may be housed in the same device.

[0228] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 1450, wireless communication module 1460, modem processor, and baseband processor.

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

[0230] The mobile communication module 1450 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G on terminal devices. The mobile communication module 1450 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 1450 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 1450 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 1450 may be housed in the processor 1410. In some embodiments, at least some functional modules of the mobile communication module 1450 and at least some modules of the processor 1410 may be housed in the same device.

[0231] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 1470A, receiver 1470B, etc.) or displays images or videos through the display screen 1494. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 1410 and may be housed in the same device as the mobile communication module 1450 or other functional modules.

[0232] The wireless communication module 1460 can provide solutions for wireless communication applications on terminal devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 1460 can be one or more devices integrating at least one communication processing module. The wireless communication module 1460 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 1410. The wireless communication module 1460 can also receive signals to be transmitted from processor 1410, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0233] In some embodiments, antenna 1 of the terminal device is coupled to mobile communication module 1450, and antenna 2 is coupled to wireless communication module 1460, enabling the terminal device to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0234] The terminal device implements display functions through a GPU, a display screen 1494, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 1494 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 1410 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0235] The display screen 1494 is used to display images, videos, etc. The display screen 1494 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device may include one or N displays 1494, where N is a positive integer greater than 1.

[0236] Terminal devices can perform shooting functions through ISP, camera 1493, video codec, GPU, display 1494 and application processor.

[0237] The ISP (Image Signal Processor) is used to process data fed back from the camera 1493. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 1493.

[0238] Camera 1493 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the terminal device may include one or N cameras 1493, where N is a positive integer greater than 1.

[0239] Digital signal processors (DSPs) are used to process digital signals, including digital image signals and other digital signals. For example, when a terminal device selects a frequency, a DSP can perform a Fourier transform on the frequency energy.

[0240] Video codecs are used to compress or decompress digital video. Terminal devices can support one or more video codecs. This allows the terminal device to play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0241] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in terminal devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0242] The external storage interface 1420 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external storage card communicates with the processor 1410 through the external storage interface 1420 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0243] Internal memory 1421 can be used to store computer executable program code, which includes instructions. Processor 1410 executes various functional applications and data processing of the terminal device by running the instructions stored in internal memory 1421. Internal memory 1421 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the terminal device (such as audio data, phonebook, etc.). Furthermore, internal memory 1421 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0244] Terminal devices can implement audio functions, such as music playback and recording, through audio modules 1470, speakers 1470A, receivers 1470B, microphones 1470C, headphone jacks 1470D, and application processors.

[0245] The audio module 1470 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module 1470 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 1470 may be located in the processor 1410, or some functional modules of the audio module 1470 may be located in the processor 1410.

[0246] The 1470A speaker, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Terminal devices can listen to music or make hands-free calls through the 1470A speaker.

[0247] The receiver 1470B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When a terminal device answers a phone call or voice message, the receiver 1470B can be brought close to the user's ear to hear the voice.

[0248] Microphone 1470C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 1470C, inputting the sound signal into microphone 1470C. A terminal device can be equipped with at least one microphone 1470C. In some embodiments, the terminal device can be equipped with two microphones 1470C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, the terminal device can be equipped with three, four, or more microphones 1470C, enabling sound signal collection, noise reduction, sound source identification, and directional recording functions, etc.

[0249] The 1470D headphone jack is used to connect wired headphones. The 1470D headphone jack can be a USB 1430 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0250] Pressure sensor 1480A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 1480A can be disposed on display screen 1494. There are many types of pressure sensors 1480A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 1480A, the capacitance between the electrodes changes. The terminal device determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 1494, the terminal device detects the intensity of the touch operation based on pressure sensor 1480A. The terminal device can also calculate the touch position based on the detection signal from pressure sensor 1480A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0251] The gyroscope sensor 1480B can be used to determine the motion posture of a terminal device. In some embodiments, the gyroscope sensor 1480B can determine the angular velocity of the terminal device around three axes (i.e., the x, y, and z axes). The gyroscope sensor 1480B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 1480B detects the angle of the terminal device's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the terminal device through reverse movement, thus achieving image stabilization. The gyroscope sensor 1480B can also be used in navigation and motion-sensing gaming scenarios.

[0252] The barometric pressure sensor 1480C is used to measure air pressure. In some embodiments, the terminal device calculates altitude using the air pressure value measured by the barometric pressure sensor 1480C to assist in positioning and navigation.

[0253] The magnetic sensor 1480D includes a Hall effect sensor. The terminal device can use the magnetic sensor 1480D to detect the opening and closing of the flip cover. In some embodiments, when the terminal device is a flip phone, the terminal device can detect the opening and closing of the flip cover using the magnetic sensor 1480D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0254] The 1480E accelerometer sensor can detect the magnitude of acceleration in various directions (typically three axes) of a terminal device. When the terminal device is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the attitude of the terminal device, and is applicable to screen orientation switching, pedometers, and other applications.

[0255] The 1480F distance sensor is used to measure distance. The terminal device can measure distance via infrared or laser. In some embodiments, during a shooting scene, the terminal device can utilize the 1480F distance sensor for distance measurement to achieve fast focusing.

[0256] The proximity sensor 1480G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The terminal device emits infrared light outward through the LED. The terminal device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the terminal device. When insufficient reflected light is detected, the terminal device can determine that no object is near the terminal device. The terminal device can use the proximity sensor 1480G to detect when a user holds the terminal device close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 1480G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0257] The 1480L ambient light sensor is used to detect ambient light levels. The terminal device can adaptively adjust the brightness of its display 1494 based on the detected ambient light level. The 1480L ambient light sensor can also be used to automatically adjust white balance when taking photos. The 1480L ambient light sensor can also work in conjunction with the 1480G proximity sensor to detect whether the terminal device is in a pocket, preventing accidental touches.

[0258] The 1480H fingerprint sensor is used to collect fingerprints. Terminal devices can use the collected fingerprint characteristics to achieve fingerprint unlocking, app access lock, fingerprint photography, fingerprint answering of calls, etc.

[0259] Temperature sensor 1480J is used to detect temperature. In some embodiments, the terminal device uses the temperature detected by temperature sensor 1480J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 1480J exceeds a threshold, the terminal device reduces the performance of the processor located near temperature sensor 1480J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, the terminal device heats battery 1442 to prevent abnormal shutdown of the terminal device due to low temperature. In still other embodiments, when the temperature is below yet another threshold, the terminal device boosts the output voltage of battery 1442 to prevent abnormal shutdown due to low temperature.

[0260] Touch sensor 1480K, also known as a "touch panel," can be located on display screen 1494. The touch sensor 1480K and display screen 1494 together form a touchscreen, also known as a "touchscreen." Touch sensor 1480K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 1494. In other embodiments, touch sensor 1480K may also be located on the surface of the terminal device, in a different position than display screen 1494.

[0261] The bone conduction sensor 1480M can acquire vibration signals. In some embodiments, the bone conduction sensor 1480M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 1480M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 1480M can also be incorporated into headphones to form bone conduction headphones. The audio module 1470 can parse the voice signals based on the vibration signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 1480M to realize voice functionality. The application processor can parse heart rate information based on the blood pressure signals acquired by the bone conduction sensor 1480M to realize heart rate detection functionality.

[0262] Buttons 1490 include a power button, volume buttons, etc. Buttons 1490 can be mechanical buttons or touch-sensitive buttons. The terminal device can receive button input and generate key signal inputs related to user settings and function control of the terminal device.

[0263] Motor 1491 can generate vibration alerts. Motor 1491 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 1491 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 1494. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0264] Indicator 1492 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0265] The SIM card interface 1495 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 1495 to achieve contact and separation with the terminal device. The terminal device can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 1495 can support Nano SIM cards, Micro SIM cards, and other SIM cards. Multiple cards can be inserted into the same SIM card interface 1495 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 1495 is also compatible with different types of SIM cards. The SIM card interface 1495 is also compatible with external memory cards. The terminal device interacts with the network through the SIM card to achieve functions such as calls and data communication. In some embodiments, the terminal device uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device and cannot be separated from the terminal device.

[0266] The software system of a terminal device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of the terminal device.

[0267] Figure 15 This is a software structure block diagram of a terminal device according to an embodiment of this application.

[0268] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

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

[0270] like Figure 15 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0271] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0272] like Figure 15 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0273] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0274] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0275] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0276] A phone manager is used to provide communication functions for terminal devices. For example, it manages call status (including connection and disconnection).

[0277] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0278] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

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

[0280] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0281] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0282] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0283] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0284] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

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

[0286] A 2D graphics engine is a graphics engine for 2D drawing.

[0287] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0288] The following example, using a photo capture scenario, illustrates the workflow of the terminal device's software and hardware.

[0289] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.

[0290] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0291] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0292] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art 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.

[0293] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0294] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0295] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0296] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0297] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A business collaboration method, characterized in that, A first terminal device is applied to a distributed system, the distributed system comprising the first terminal device and a second terminal device, the first terminal device and the second terminal device being connected; the method includes: The times corresponding to the heartbeat nodes of the first terminal device and the second terminal device are adjusted respectively to obtain the adjusted heartbeat nodes; The device receives a heartbeat message sent by the second terminal device. The heartbeat message includes a service identifier, which is used to indicate a first service running in the foreground of the second terminal device. Based on the service identifier and the service running in the foreground of the first terminal device, and in conjunction with the adjusted heartbeat node, data synchronization is performed with the second terminal device.

2. The method according to claim 1, characterized in that, The step of synchronizing data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, includes: Based on the service identifier, determine whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; If the second service running in the foreground of the first terminal device is inconsistent with the first service running in the foreground of the second terminal device, then at the time corresponding to the next adjusted heartbeat node, a service message is sent to the second terminal device. The service message is used to synchronize the second service between the first terminal device and the second terminal device.

3. The method according to claim 2, characterized in that, Sending a service message to the second terminal device at the time corresponding to the next adjusted heartbeat node includes: For the second service running in the foreground of the first terminal device, register a non-real-time collaborative task; Upon reaching the time corresponding to the next adjusted heartbeat node, the non-real-time collaborative task is triggered, and the service message is sent to the second terminal device.

4. The method according to claim 1, characterized in that, The step of synchronizing data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, includes: Based on the service identifier, determine whether the service running in the foreground of the first terminal device is consistent with the service running in the foreground of the second terminal device; If the first service running in the foreground of the first terminal device is the same as the first service running in the foreground of the second terminal device, then a service message is sent to the second terminal device. The service message is used to synchronize the first service between the first terminal device and the second terminal device.

5. The method according to any one of claims 1 to 4, characterized in that, Before synchronizing data with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device, combined with the adjusted heartbeat node, the method further includes: The service identifier bit of the heartbeat message is extracted to obtain the service identifier corresponding to the first service.

6. The method according to any one of claims 1 to 5, characterized in that, The step of adjusting the times corresponding to the heartbeat nodes of the first terminal device and the second terminal device respectively to obtain the adjusted heartbeat nodes includes: Receive the heartbeat node and heartbeat cycle sent by the second terminal device; The adjusted heartbeat node is obtained by calculating the heartbeat node based on the pre-set heartbeat coordination formula, combined with the heartbeat node and heartbeat cycle sent by the second terminal device and the heartbeat node and heartbeat cycle of the first terminal device.

7. A business collaboration method, characterized in that, A second terminal device is applied to a distributed system, the distributed system consisting of a first terminal device and a second terminal device, the first terminal device and the second terminal device being connected, the method comprising: The times corresponding to the heartbeat nodes of the first terminal device and the second terminal device are adjusted respectively to obtain the adjusted heartbeat nodes; At the time corresponding to the adjusted heartbeat node, a heartbeat message is sent to the first terminal device. The heartbeat message includes a service identifier, which is used to indicate the first service running in the foreground of the second terminal device. Data synchronization is performed with the first terminal device based on the service message sent by the first terminal device.

8. The method according to claim 7, characterized in that, Sending a heartbeat message to the first terminal device includes: Determine the service identifier corresponding to the service running in the foreground of the second terminal device; The heartbeat message is generated based on the service identifier; The heartbeat message is sent to the first terminal device.

9. The method according to claim 8, characterized in that, The step of determining the service identifier corresponding to the service running in the foreground of the second terminal device includes: Based on the hand-raising action triggered by the first service, it is determined that the first service is running in the foreground of the second terminal device; Obtain the service identifier corresponding to the first service.

10. The method according to any one of claims 7 to 9, characterized in that, The step of synchronizing data with the first terminal device based on the service message sent by the first terminal device includes: The system receives a service message sent by the first terminal device, the service message being used to synchronize data for the second service between the first terminal device and the second terminal device. Based on the service message, data synchronization is performed with the first terminal device for the second service.

11. The method according to any one of claims 7 to 10, characterized in that, The step of adjusting the times corresponding to the heartbeat nodes of the first terminal device and the second terminal device respectively to obtain the adjusted heartbeat nodes includes: Send the heartbeat node and heartbeat cycle of the second terminal device to the first terminal device; Receive the absolute time sent by the first terminal device and synchronize the absolute time with the first terminal device, wherein the absolute time represents the power-on duration; Receive the calculated optimal heartbeat cycle sent by the first terminal device; The adjusted heartbeat node is obtained based on the optimal heartbeat cycle and the absolute time after synchronization.

12. An electronic device, characterized in that, include: A processor for running a computer program stored in a memory to enable the electronic device to implement the business collaboration method as claimed in any one of claims 1 to 6 or 7 to 11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the business collaboration method as claimed in any one of claims 1 to 6 or 7 to 11.

14. A chip system, characterized in that, The chip system includes a memory and a processor, the processor executing a computer program stored in the memory to implement the business collaboration method as claimed in any one of claims 1 to 6 or 7 to 11.

Citation Information

Patent Citations

  • Multimedia content synchronization method and electronic device

    WO2020034227A1

  • Data transmission method and apparatus, electronic device, and readable storage medium

    WO2021175300A1