WO2023138533A1 - Service collaboration method, electronic device, readable storage medium, and chip system - Google Patents

Service collaboration method, electronic device, readable storage medium, and chip system Download PDF

Info

Publication number
WO2023138533A1
WO2023138533A1 PCT/CN2023/072365 CN2023072365W WO2023138533A1 WO 2023138533 A1 WO2023138533 A1 WO 2023138533A1 CN 2023072365 W CN2023072365 W CN 2023072365W WO 2023138533 A1 WO2023138533 A1 WO 2023138533A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal device
service
heartbeat
foreground
node
Prior art date
Application number
PCT/CN2023/072365
Other languages
French (fr)
Chinese (zh)
Inventor
陈登
包尚攀
王娟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023138533A1 publication Critical patent/WO2023138533A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the technical field of terminal equipment, and in particular to a business collaboration method, electronic equipment, a readable storage medium and a chip system.
  • a distributed scenario is proposed.
  • multiple terminal devices can be networked for data interaction, and different functions of multiple terminal devices can provide services to users at the same time.
  • the terminal device can send a heartbeat message 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 the stored data according to the detected operation, and can also synchronize the added, deleted or replaced data to other terminal devices.
  • the present application provides a service collaboration method, electronic equipment, a readable storage medium, and a chip system, which solve the problem of increased power consumption of terminal equipment in distributed scenarios in the prior art.
  • a business collaboration method is provided, which is applied to a first terminal device of a distributed system, the distributed system is composed of the first terminal device and a second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
  • Heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • the first terminal device and the second terminal device first adjust the time corresponding to the heartbeat nodes respectively, to obtain adjusted heartbeat nodes. Afterwards, the first terminal device can obtain the service status of each service of the second terminal device according to the heartbeat message sent by the second terminal device, and according to the service identifier of each service, combined with the business currently running on the foreground of the first terminal device, and then complete data synchronization with the second terminal device based on the adjusted heartbeat node, and complete data synchronization with the second terminal device by using the wake-up time period of the second terminal device, which can reduce the number of wake-up times of the second terminal device, thereby reducing the number of second terminal devices.
  • the power consumption of the second terminal equipment is not limited to the heartbeat message sent by the second terminal device, and according to the service identifier of each service, combined with the business currently running on the foreground of the first terminal device, and then complete data synchronization with the second terminal device based on the adjusted heartbeat node, and complete data synchronization with the second terminal
  • 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 includes:
  • 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;
  • 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, at the next time corresponding to the adjusted heartbeat node, send a service message to the second terminal device, and the service message is used to perform data synchronization on the second service between the first terminal device and the second terminal device.
  • the terminal device may delay the collaborative operation with other terminal devices.
  • the heartbeat message and the service message are sent at the same time, and the wake-up time period of the second terminal device is used, thereby reducing the power consumption of the second terminal device.
  • sending a service message to the second terminal device at a time corresponding to the next adjusted heartbeat node includes:
  • the non-real-time collaborative task is triggered, and the service message is sent to the second terminal device.
  • performing data synchronization with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node includes:
  • 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;
  • the service message is used to perform data synchronization on the first service between the first terminal device and the second terminal device.
  • the terminal device can cooperate with other terminal devices in real time to complete data synchronization.
  • the first terminal device completes data synchronization with the second terminal device during the time period when the second terminal device is currently in the wake-up state, which can reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
  • the method before performing data synchronization with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node, the method further includes:
  • the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device is adjusted to obtain adjusted heartbeat nodes, including:
  • the heartbeat node and the heartbeat period sent by the second terminal device are combined with the heartbeat node and the heartbeat period of the first terminal device to perform calculation to obtain the adjusted heartbeat node.
  • the first terminal device and the second terminal device adjust the heartbeat node and the heartbeat cycle so that the time period for the first terminal device and the second terminal device to wake up is consistent, that is, the first terminal device and the second terminal device send and receive heartbeats
  • the time of the message is consistent, so that the number of times each terminal device is woken up can be reduced.
  • a business collaboration method is provided, which is applied to a second terminal device of a distributed system, the distributed system is composed of a first terminal device and the second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
  • the adjusted heartbeat node send a heartbeat message to the first terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • the first terminal device and the second terminal device first adjust the time corresponding to the heartbeat nodes respectively, to obtain adjusted heartbeat nodes.
  • the second terminal device may send a heartbeat message to the first terminal device to inform the first terminal device of the service status of each service run by the second terminal device, and complete data synchronization with the first terminal device according to the service message fed back by the first terminal device based on the service identifier of each service.
  • the wake-up period of the second terminal device may be used to complete data synchronization with the second terminal device, which may reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
  • the sending a heartbeat message to the first terminal device includes:
  • the second terminal device can indicate the service currently running on the foreground of the second terminal device through the service identifier, so that the first terminal device can determine the time to perform data synchronization with the second terminal device according to the service identifier in the heartbeat message, and use the wake-up period of the second terminal device to complete data synchronization with the second terminal device, which can reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
  • the determining the service identifier corresponding to the service running in the foreground of the second terminal device includes:
  • the hand-raising action triggered by the first service determine that the first service is running in the foreground of the second terminal device;
  • the performing data synchronization with the first terminal device according to the service message sent by the first terminal device includes:
  • the first terminal device can cooperate 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 the cooperative operation with the second terminal device, and use the wake-up time period of the second terminal device to complete data synchronization with the second terminal device, which can reduce the number of times the second terminal device is woken up, thereby reducing the power consumption of the second terminal device.
  • the step of adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device to obtain the adjusted heartbeat node includes:
  • the adjusted heartbeat node is obtained according to the optimal heartbeat period and the synchronized absolute time.
  • the first terminal device and the second terminal device adjust the heartbeat node and the heartbeat cycle to make the first terminal device and the second terminal device wake up at the same time period, that is, the first terminal device and the second terminal device send and receive heartbeat messages at the same time, so that the number of times each terminal device is woken up can be reduced.
  • a service coordination device which is applied to a first terminal device of a distributed system, the distributed system is composed of the first terminal device and a second terminal device, the first terminal device is connected to the second terminal device, and the device includes:
  • An adjustment module configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes
  • a receiving module configured to receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • a synchronization module configured to perform 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 synchronization module is specifically configured to determine, according to 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, send a service message to the second terminal device at the next time corresponding to the adjusted heartbeat node, and the service message is used for data synchronization of the second service between the first terminal device and the second terminal device.
  • the synchronization module is further specifically configured to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the next time corresponding to the adjusted heartbeat node is reached, trigger the non-real-time collaborative task, and send the service message to the second terminal device.
  • the synchronization module is further specifically configured to determine, according to 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, send the service message to the second terminal device, and the service message is used to perform data synchronization on the first service between the first terminal device and the second terminal device.
  • the device further includes:
  • An extracting module configured to extract the service identification bit of the heartbeat message to obtain the service identification corresponding to the first service.
  • the The adjustment module is specifically configured to receive the heartbeat node and the heartbeat cycle sent by the second terminal device; according to the preset heartbeat coordination formula, combine the heartbeat node and the heartbeat cycle sent by the second terminal device, and the heartbeat node and the heartbeat cycle of the first terminal device to perform calculations to obtain the adjusted heartbeat node.
  • a service coordination device which is applied to a second terminal device of a distributed system, the distributed system is composed of a first terminal device and the second terminal device, the first terminal device is connected to the second terminal device, and the device includes:
  • An adjustment module configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes
  • a sending module configured to send a heartbeat message to the first terminal device at a time corresponding to the adjusted heartbeat node, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • a synchronization module configured to perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
  • the sending module is specifically configured to determine a service identifier corresponding to a 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.
  • the sending module is further specifically configured to determine that the first service is running in the foreground of the second terminal device according to a hand-raising action triggered by the first service; and acquire a service identifier corresponding to the first service.
  • the synchronization module is specifically configured to receive a service message sent by the first terminal device, and the service message is used to perform data synchronization on a second service between the first terminal device and the second terminal device; perform data synchronization on the second service with the first terminal device according to the service message.
  • the adjustment module is specifically configured to send the heartbeat node and the heartbeat period 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, where the absolute time represents the boot time; receive the calculated optimal heartbeat period sent by the first terminal device; obtain the adjusted heartbeat node according to the optimal heartbeat period and the synchronized absolute time.
  • an electronic device including: a processor, the processor is configured to run a computer program stored in a memory, so that the electronic device implements the business collaboration method according to any one of the first aspect or the second aspect.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the business collaboration method according to any one of the first aspect or the second aspect is implemented.
  • a chip system includes a memory and a processor, and the processor executes the computer program stored in the memory, so as to realize the business collaboration method according to any one of the first aspect or the second aspect.
  • FIG. 1A is a schematic diagram of a distributed scenario provided by an embodiment of the present application.
  • FIG. 1B is a schematic diagram of the state of each terminal device in a distributed scenario provided by an embodiment of the present application
  • FIG. 2 is a schematic flow diagram of collaborative operations of terminal devices in a distributed scenario provided by an embodiment of the present application
  • FIG. 3 is a schematic flow chart of a business collaboration method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flow diagram of adjusting the time corresponding to the heartbeat nodes of the central node and the child nodes provided by the embodiment of the present application;
  • FIG. 5A is a schematic diagram of a heartbeat node for cross-device unified heartbeat management provided by an embodiment of the present application
  • FIG. 5B is a schematic diagram of a heartbeat node for unified heartbeat management in the same terminal device provided by an embodiment of the present application;
  • FIG. 6 is a schematic diagram of heartbeat nodes of multiple terminal devices in a distributed scenario provided by an embodiment of the present application.
  • FIG. 7 is a schematic flow diagram of a plurality of terminal devices performing service collaboration according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a heartbeat message provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another state of each terminal device provided in the embodiment of the present application.
  • FIG. 10 is a schematic diagram of state changes of a terminal device provided in an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of a software for multi-terminal devices performing collaborative operations provided by an embodiment of the present application
  • FIG. 12 is a structural block diagram of a service collaboration device provided by an embodiment of the present application.
  • FIG. 13 is a structural block diagram of another service collaboration device provided by the embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
  • FIG. 15 is a block diagram of a software structure of a terminal device according to an embodiment of the present application.
  • the distributed scenario may be an application scenario in which distributed technology is used to implement cross-device services.
  • the distributed scenario may include multiple terminal devices, and the hardware of each terminal device may be added to the shared resource pool of the distributed scenario. That is, the hardware and the functions of the hardware can be shared among the various terminal devices.
  • each terminal device can call the hardware of other terminal devices according to the resources in the shared resource pool for different types of services, so as to complete different services in distributed scenarios (such as audio and video calls, cross-terminal collaborative office, and smart vehicle and other cross-device services).
  • the distributed scene includes: mobile phone and TV
  • the mobile phone can call the screen and speakers of the TV to play the video according to the triggered operation.
  • the microphone of the mobile phone can be used to receive voice commands for the TV, and the volume, channel or program played on the TV can be adjusted. etc. to adjust.
  • each terminal device in a distributed scenario can be connected through a communication module, which can be considered as a transmission protocol, and each terminal device in a distributed scenario can be simply and quickly connected to other terminal devices through a communication module, so that the hardware of other terminal devices can be called to complete the corresponding business.
  • a communication module which can be considered as a transmission protocol
  • the communication module can be the communication base of various terminal devices in distributed scenarios such as mobile phones, tablet computers, wearable devices, smart screens, and vehicles, providing a unified communication capability for the interconnection and intercommunication between various terminal devices, and creating conditions for non-inductive discovery and zero-wait transmission between devices.
  • the mobile phone needs to turn on the Bluetooth function first, and after searching for the computer, perform pairing authorization with the computer. After the mobile phone establishes a Bluetooth connection with the computer, the mobile phone can send photos that need to be transferred to the computer.
  • each terminal device can actively discover other terminal devices based on the communication module, and the mobile phone can actively discover the computer in the distributed scenario and establish a connection with the computer through the communication module.
  • the mobile phone and the computer are configured with a photo gallery service, the mobile phone can actively send photos to the computer to realize data synchronization between the mobile phone and the computer for the photo gallery service.
  • FIG. 1A is a schematic diagram of a distributed scenario provided by an embodiment of the present application.
  • the distributed scenario may include: a terminal device A, a terminal device B, and a terminal device C.
  • terminal device B is connected to terminal device A and terminal device C respectively.
  • all terminal devices located in the same distributed scenario can send heartbeat messages and/or service messages to other terminal devices.
  • 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 located in the distributed scenario.
  • the service message is used to realize the cross-device service between each terminal device, and each terminal device can realize data synchronization for the same service through the service message.
  • each terminal device can send service data to other terminal devices through service packets, so that other terminal devices can synchronize service data and complete cross-device services.
  • terminal device B can send heartbeat messages to remote devices (terminal device A and terminal device C) respectively through the communication module to detect whether the remote device is still in the distributed scenario.
  • the terminal device B can also receive the heartbeat message sent by the remote device through the communication module.
  • both terminal device A and terminal device B include the distributed gallery service. If terminal device A is currently running the distributed gallery service in the foreground, and terminal device A detects that a deletion operation is triggered on an image in the distributed gallery, then terminal device A can delete the corresponding image in the distributed gallery. Moreover, terminal device A can also send a service message to terminal device B, instructing terminal device B to perform data synchronization on the distributed gallery in terminal device B according to the service message, that is, to delete the corresponding image in the distributed gallery.
  • both terminal equipment B and terminal equipment C include distributed file manager services. If terminal device B is currently running the distributed file manager service in the foreground, and terminal device B detects that a storage operation is triggered for a file, terminal device B can store the file through the distributed file manager. Moreover, 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 according to the service message, that is, to store the file in terminal device C.
  • FIG. 1B is a schematic diagram of the state of each terminal device in a distributed scenario provided by an embodiment of the present application.
  • FIG. 1B shows the time nodes at which each of the above-mentioned terminal devices sends heartbeat messages (hollow triangles in FIG. 1B ), and also shows the time nodes at which terminal device A and terminal device C send service messages (solid triangles in FIG. 1B ), and also shows the time nodes at which terminal device B receives service messages.
  • each terminal device may enter a sleep state to reduce power consumption of the terminal devices.
  • Each terminal device also needs to periodically send a heartbeat message to other devices to determine whether other terminal devices are still located in the distributed scenario.
  • terminal device A, terminal device B, and terminal device C send heartbeat messages to other terminal devices at different times, and the terminal device receiving the heartbeat message is awakened from the dormant state.
  • terminal device B also sends service packets to terminal device A and terminal device C respectively at different times, then terminal device A and terminal device C are also woken up when receiving the service packets. Therefore, the terminal device A, the terminal device B, and the terminal device C are frequently woken up at multiple times, so that the power consumption of each terminal device increases.
  • the embodiment of the present application proposes a service coordination method, and the terminal device can determine the service running in the foreground of the remote device according to the received heartbeat message sent by the remote device. If the service running in the foreground of the terminal device is different from the service running in the foreground of the remote device, the terminal device can delay data synchronization with the remote device (for example, when the terminal device sends a heartbeat message to the remote device, it also sends a service message to the remote device). If the service running on the foreground of the terminal device is the same as the service running on the foreground of the remote device, the terminal device can synchronize data with the remote device in real time to realize collaborative work.
  • FIG. 2 is a schematic flow diagram of collaborative operation of terminal devices in a distributed scenario provided by an embodiment of the present application.
  • the distributed scenario includes: a first terminal device and a second terminal device, wherein the first terminal device is connected to the second terminal device.
  • the first terminal device may first establish a network with the second terminal device to access a distributed scenario. Afterwards, the first terminal device may receive the heartbeat message sent by the second terminal device, and determine the first service that the second terminal device is currently running in the foreground according to the service state information carried in the heartbeat message.
  • the fact that the first terminal device is running the second service in the foreground but not running the first service in the foreground is different from the fact that the second terminal device is running the first service in the foreground.
  • the first terminal device no longer cooperates with the second terminal device in real time to complete data synchronization. Instead, the delayed non-real-time task can be registered in the task scheduler of the first terminal device, that is, the non-real-time task for synchronizing data between the first service and the second terminal device to realize collaborative operation can be registered.
  • the task scheduler of the first terminal device is used to control the first terminal device to execute each task registered in the task scheduler in a preset order, and the task scheduler can also control the first terminal device to delay execution of non-real-time tasks. For example, the first terminal device executes a certain non-real-time task in the task scheduler only when the first terminal device satisfies a certain condition.
  • the non-real-time task may be a task registered in the task scheduler that can be delayed for execution, or a task that the terminal device can only execute when the state of the terminal device meets a certain condition.
  • the task scheduler may acquire the status of the timer, power supply, and network of the first terminal device, and set constraints for the aforementioned non-real-time tasks according to the acquired statuses.
  • 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 services through the communication module, so that the first service of the first terminal device and the first service of the second terminal device perform cooperative operations to complete data synchronization.
  • the first terminal device and the second terminal device when the first terminal device and the second terminal device are in the wake-up state again, that is, they can send and receive heartbeat messages, the first terminal device can perform cross-device services, so that data transmission can be performed between the first terminal device and the second terminal device, thereby controlling the first service of the second terminal device to cooperate with the first service of the first terminal device to perform cross-device services, and completing the first terminal device.
  • the terminal device and the second terminal device synchronize data for the first service.
  • a distributed scenario may include multiple networked terminal devices.
  • this embodiment of the application uses two terminal devices as an example.
  • the embodiment of this application does not limit the number of terminal devices in a distributed scenario.
  • the following still uses two terminal devices in a distributed scenario as an example to introduce a method for each terminal device to cooperate to execute cross-device services, so as to reduce power consumption of the terminal devices.
  • Fig. 3 is a schematic flowchart of a business collaboration method provided by the embodiment of the present application.
  • the method can be applied to the first terminal device and the second terminal device in the above-mentioned distributed scenario. Referring to Fig. 3 , the method includes:
  • Step 301 Adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes.
  • both the first terminal device and the second terminal device are located in a distributed scenario, and the first terminal device is connected to the second terminal device.
  • the heartbeat node can be the moment when each terminal device sends a heartbeat message, and each terminal device periodically sends a heartbeat message, then the duration between every two adjacent heartbeat nodes is the heartbeat cycle.
  • Multiple terminal devices in the distributed scenario can periodically send heartbeat messages, so as to determine each terminal device currently in the distributed scenario through the heartbeat messages.
  • each terminal device sends and receives a heartbeat message, it needs to be woken up to be in the wake-up state, and the time for each terminal device to send a heartbeat message is different, which will cause frequent wakeups for each terminal device, which will increase the standby current of the terminal device and increase the power consumption of the terminal device.
  • 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, so that each terminal device can send a heartbeat message at the same time, that is, the first terminal device and the second terminal device send the heartbeat message after the same duration 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 each terminal device is in the wake-up state and reducing the power consumption of each terminal device.
  • 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
  • the communication module in the distributed scenario may use the first terminal device as a central node and the second terminal device as a child node.
  • the central node can generate an adjusted heartbeat cycle and heartbeat nodes according to the preset heartbeat coordination formula, combined with the heartbeat cycle and heartbeat nodes of the central node, and the heartbeat cycle and heartbeat nodes of the child nodes, and send the adjusted heartbeat cycle and heartbeat nodes to the child nodes, so as to complete the management of the heartbeat nodes of the child nodes through the central node.
  • FIG. 4 is a schematic flow diagram for adjusting the time corresponding to the heartbeat nodes of the central node and the sub-nodes according to the embodiment of the present application.
  • Both the central node and the sub-nodes include a heartbeat management module for unified heartbeat management, and transmit data such as heartbeat cycles and heartbeat nodes of the central node and sub-nodes through the time management module of the communication module in a distributed scenario.
  • the child node can send the heartbeat cycle of the child node to the central node through the time management module of the communication module, and the central node can also synchronize the absolute time of the first terminal device to the child node through the time management module of the communication module, that is, to synchronize the boot time of the first terminal device to the child node.
  • the heartbeat management module of the central node can generate the optimal heartbeat period through the preset heartbeat coordination formula according to the heartbeat period of the sub-node, combined with the heartbeat period of the central node and the heartbeat node, that is, the timer task currently existing in the first terminal device.
  • the central node can also send the generated optimal heartbeat cycle to the sub-node through the communication module.
  • the heartbeat management module of the sub-node can adjust the heartbeat node of the second terminal device according to the received optimal heartbeat cycle, thereby completing the adjustment of the time corresponding to the heartbeat nodes of the first terminal device and the second terminal device.
  • the central node may generate the optimal heartbeat cycle according to the minimum heartbeat cycle of each terminal device in the distributed scenario, and of course, may also generate the optimal heartbeat cycle in other ways, which is not limited in this embodiment of the present application.
  • each terminal device in the distributed scenario can simultaneously run multiple services on the same terminal device during operation.
  • each service can cooperate with other terminal equipment services in real time, and can also cooperate with other terminal equipment services at the time corresponding to the heartbeat node according to the adjusted heartbeat node.
  • the time when the service triggers the collaborative operation can be unified with the heartbeat node of the terminal device.
  • the terminal device can reset the time when the service triggers the collaborative operation based on the absolute time of the terminal device, combined with the time when the business triggers the collaborative operation and the heartbeat cycle of the terminal device, through the preset heartbeat coordination formula, so that the business running on the terminal device can perform collaborative operations with other terminal devices at the time corresponding to the heartbeat node to achieve data synchronization.
  • FIG. 5A a schematic diagram of a heartbeat node for unified heartbeat management across devices is shown.
  • the power-on time of the central node is 11:02:00
  • the power-on time of the child nodes is 11:00:00
  • the heartbeat periods of the central node and the child nodes are both 5 minutes (min).
  • the absolute time of the central node is 6 minutes
  • the absolute time of the child node is 8 minutes.
  • the absolute time corresponding to each primary heartbeat node of the central node and the sub -node is 5min, 10min, and 15min, respectively, that is, the corresponding moments corresponding to the original heartbeat nodes of the central node are 11: 07: 00, 11: 12: 00, and 11:17:00. 00 and 11:15:00 and other times.
  • the central node can synchronize the absolute time of the sub-nodes, and then calculate according to the preset heartbeat coordination formula to obtain the absolute time corresponding to each new heartbeat node of the sub-node, thereby obtaining the time corresponding to each new heartbeat node of the sub-node.
  • the central node can also calculate the time corresponding to other new heartbeat nodes of the child node (such as 11:17:00, etc.), which will not be repeated here.
  • FIG. 5B a schematic diagram of heartbeat nodes for unified heartbeat management in the same terminal device is shown.
  • the boot time of the terminal device is 11:00:00
  • the heartbeat period is 5 minutes
  • the absolute times corresponding to each heartbeat node of the terminal device are respectively 5 minutes, 10 minutes, and 15 minutes.
  • the timer corresponding to the service run by the terminal device is triggered at 11:03:00, that is, the currently running service triggers the collaborative operation when the absolute time is 3 minutes, then the terminal device can adjust the trigger time of the timer according to the heartbeat coordination formula, and use the closest heartbeat node as the trigger time of the timer corresponding to the service.
  • realTrigger table indicates the absolute time corresponding to the updated trigger moment
  • expectTrigger indicates the absolute time corresponding to the original trigger moment
  • Time indicates the heartbeat cycle of the central node.
  • the original trigger time is 11:03:00
  • the corresponding absolute time expectTrigger is 3 minutes
  • a distributed scenario may include multiple networked terminal devices.
  • the central node may adjust the heartbeat node and heartbeat period of the new subnode based on the heartbeat node and heartbeat period of the central node, so that the heartbeat node and heartbeat period of the new subnode are consistent with the heartbeat node and heartbeat period of the central node, thereby realizing unified heartbeat management across devices.
  • FIG. 6 is a schematic diagram of heartbeat nodes of multiple terminal devices in a distributed scenario provided by an embodiment of the present application.
  • the distributed scenario may include terminal device A, terminal device B, terminal device C, and terminal device D.
  • the heartbeat nodes of each terminal device are different.
  • the heartbeat node closest to the current moment can be determined as the heartbeat node of terminal device B according to the heartbeat nodes of multiple terminal devices.
  • multiple terminal devices may also select a central node according to the power supply type of each terminal device. If the power supply of terminal device A is a large-capacity battery, terminal device B is connected to the mains through a power line, and the power supplies of terminal device C and terminal device D are small-capacity batteries, then terminal device B can maintain the power supply state continuously, and terminal device B can be used as the central node, and other terminal devices can be used as sub-nodes, and then according to the heartbeat node and heartbeat cycle of terminal device B, the heartbeat nodes and heartbeat cycles of other terminal devices can be adjusted.
  • Step 302 the second terminal device sends a heartbeat message to the first terminal device.
  • the heartbeat message includes service identifiers of various services currently in the running state of the second terminal device.
  • the first terminal device can send a heartbeat message to the second terminal device according to the heartbeat node, and the second terminal device can also send a heartbeat message to the first terminal device according to the heartbeat node.
  • the following description takes the second terminal device sending a heartbeat message to the first terminal device as an example.
  • the second terminal device may detect the hand-raising action triggered by the first service, which means that the first service is currently running in the foreground.
  • the second terminal device may determine that the service state of the first service is in the running state according to the hand-raising action, and other services not triggered by the hand-raising action are in the dormant state or the suspended state.
  • the gesture of raising the hand triggered by the first service may be a signaling broadcast by the first service, which is used to inform the system that the first service is currently running in the foreground.
  • the service status can include: running state, paused state and dormant state.
  • the running state means that the business is currently running in the foreground
  • the paused state means that the business is currently running in the background
  • the dormant state means that the business is not currently running.
  • the second terminal device can also acquire the service identifier of the first service according to the hand-raising action triggered by the first service, and add the service status of the first service into the heartbeat message together, so that the heartbeat message carries the service identifier of the first service running in the foreground of the second terminal device and the service status of the first service, 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.
  • the first terminal device can perform step 303 to realize collaborative work with the second terminal device, and synchronize the data of the second terminal device in the first terminal device. 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 may perform step 304 to realize collaborative work with the second terminal device according to the heartbeat period and heartbeat node of the first terminal device.
  • FIG. 7 is a schematic flow diagram of business collaboration of multiple terminal devices provided by the embodiment of the present application.
  • the distributed library service of the computer is in the running state
  • the distributed file manager service of the tablet computer is in the dormant state.
  • the mobile phone can determine that the computer is running the distributed gallery service in the foreground according to the heartbeat messages sent by the computer and the tablet respectively through the bus channel module of the communication module, and through the business status coordination module in the resource scheduling subsystem.
  • the resource scheduling subsystem of the mobile phone can add the collaborative task corresponding to the distributed gallery service to the system activity window (unfreeze window), and perform resource recovery (such as restoring the Br link and WiFi link) for the distributed gallery service in the communication module through the resource scheduling subsystem, so that the mobile phone can send the service message corresponding to the distributed gallery service to the computer through the communication module.
  • the resource scheduling subsystem of the mobile phone can add the collaborative task corresponding to the distributed file manager service to the system freeze window (freeze window), and release the resources corresponding to the distributed file manager service in the communication module through the resource scheduling subsystem (such as restoring the Br link and WiFi link), so that the mobile phone cannot temporarily send the service message corresponding to the distributed file manager service to the tablet computer through the communication module, but in the system of the mobile phone
  • the service message corresponding to the distributed file manager service can be sent to the tablet computer only after the frozen window satisfies the constraint conditions and is thawed.
  • FIG. 8 is a schematic diagram of a heartbeat message provided by the embodiment of the present application.
  • the heartbeat message may also include a service hand-raising position.
  • the first service of the second terminal device when running in the foreground, it can periodically trigger the hand-raising action, 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 trigger period may be consistent with the heartbeat period of the second terminal device, or may be shorter than the heartbeat period of the second terminal device, and the trigger period is not limited in this embodiment of the present application.
  • the first service may trigger a hand-raising action, indicating that the first service is currently in the suspended state.
  • the heartbeat message of the second terminal device may also be added with the service identifier of the first service and the service state indicating the suspended state.
  • Step 303 If 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, the first terminal device sends a service message to the second terminal device.
  • the 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 realizing data synchronization.
  • the first terminal device may determine according to the heartbeat message that the first service is running in the foreground of the second terminal device. If the first terminal device is currently running the first service in the foreground, the first terminal device can send a service message to the second terminal device, so that in subsequent steps, the first terminal device can cooperate with the second terminal device to complete the first service.
  • the first terminal device may extract data in the heartbeat message to determine that the first service is running in the foreground of the second terminal device. Moreover, the first terminal device is currently running the first service in the foreground, and the first service of the first terminal device can initiate a collaborative operation task, and the first terminal device can add the collaborative operation task to the system activity window of the resource scheduling subsystem according to the service status of the first service in the running state, so that the communication module subsystem of the first terminal device can perform resource recovery for the collaborative operation task, and can send a service message to the second terminal device through the communication module, so that in step 305, the second terminal device can perform collaborative work according to the received service message.
  • the first terminal device if the first terminal device is currently running the first service in the foreground, it means that the first terminal device also has data that needs to be synchronized with the second terminal device for the first service.
  • the heartbeat message sent by the first terminal device to the second terminal device may also include the service identifier of the first service and the service status indicating the running state.
  • the second terminal device can also use a method similar to that of the first terminal device, and the first service of the second terminal device can also initiate a collaborative operation with the first terminal device to complete data synchronization.
  • 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.
  • the first terminal device may delay sending a service message for the second service to the second terminal device for collaborative operation.
  • the first terminal device may extract the data in the heartbeat message, and 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, and the service running in the foreground of the first terminal device is different from the service running in the foreground of the second terminal device.
  • the first terminal device can mark the first service as running, and exempt the first service from management and control, and then through the resource scheduling subsystem of the first terminal device, add the collaborative operation task initiated by the first service into the system freezing window, so that at the next heartbeat node, the first terminal device and the second terminal device can perform collaborative work on the first service and complete data synchronization.
  • the first terminal device can send a heartbeat message to the second terminal device, and each task in the system freezing window of the first terminal device can also enter the system active window, thereby sending a service message to the second terminal device, so that in step 305, the second terminal device can complete the cooperative task with the first terminal device for the first business, and realize data synchronization.
  • the second terminal device cooperates with the first terminal device to perform cross-device services according to the service message, and synchronizes data between the first terminal device and the second terminal device.
  • the second terminal device can receive the service message sent in real time or delayed by the first terminal device, and according to the received service message, cooperate with the first terminal device for the first service or the second service to realize data synchronization between the first terminal device and the second terminal device.
  • step 303 if both the first terminal device and the second terminal device are currently running the first service in the foreground, 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, so that 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.
  • the first terminal device may also send a service message for the second service to the second terminal device while sending a heartbeat message to the second terminal device. That is, the second terminal device needs to wait for one heartbeat cycle before it can receive the service packet for the second service sent by the first terminal device. The second terminal device also needs to wait for one heartbeat period before it can cooperate with the first terminal device for the second service to realize data synchronization.
  • the second terminal device can also send a service message for the first service to the first terminal device according to the received heartbeat message, so that the data corresponding to the first service is synchronized in the first terminal device, and the first terminal device and the second terminal device are set up. Prepared collaborative work.
  • a non-real-time service is taken as an example, that is, the service message that the first terminal device delays sending to the second terminal device is only for the non-real-time service.
  • the terminal device may run non-real-time services or real-time services, and the types of services run by the terminal device in the embodiment of the present application are not limited.
  • non-real-time services of terminal devices may include: non-foreground triggered full or incremental image synchronization, automatic thumbnail preloading or caching, non-foreground triggered data change notification, and non-foreground triggered data interaction service synchronization, etc.
  • some services of the terminal equipment can also be classified as real-time services or non-real-time services according to different conditions. As shown in Table 1, it shows that different services are classified as real-time services or non-real-time services under different conditions.
  • FIG. 9 is another schematic diagram of the state of each terminal device provided by the embodiment of the present application.
  • Each terminal device (terminal device A, terminal device B, terminal device C, and terminal device D) can send a heartbeat message at the same time after adjusting the heartbeat node and the heartbeat cycle (the hollow triangle in the figure), and at the time of sending the heartbeat message, simultaneously send the service message corresponding to the non-real-time service (the striped triangle in the figure).
  • terminal device B and terminal device D may also send service packets corresponding to real-time services at non-heartbeat nodes (solid triangles in the figure).
  • FIG. 10 is a schematic diagram of a state change of a terminal device provided by an embodiment of the present application.
  • the terminal device is frequently woken up, and the standby current of the terminal device also frequently rises.
  • the terminal device is periodically in the wake-up state, and the number of wake-up times is significantly reduced.
  • the standby current of terminal equipment has also dropped significantly.
  • the power consumption of each terminal device is significantly reduced after adding terminal devices 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%.
  • FIG. 11 is a schematic flowchart of a software for multi-terminal devices performing collaborative operations provided by an embodiment of the present application.
  • the first terminal device and the second terminal device form a network based on a networking protocol through a communication module, and jointly access the distributed scene.
  • the first terminal device may send a heartbeat message through the communication module to determine whether the second terminal device is still located in the distributed scenario.
  • the second terminal device may also send a heartbeat message through the communication module to determine whether the first terminal device is still located in the distributed scenario.
  • the second terminal device runs the distributed gallery in the foreground, and if a triggered operation of adding a picture is detected, the second terminal device may store the added picture. Moreover, at the moment corresponding to the heartbeat node, the second terminal device can determine that the distributed library is currently running through the lifecycle module of the distributed low-power framework in the second terminal device, that is, the distributed library is currently running in the foreground, then the second terminal device can send the service identifier and service status carrying the distributed library to the first terminal device.
  • the first terminal device can receive the heartbeat message sent by the second terminal device, and determine according to the heartbeat message that the second terminal device is currently running the distributed library in the foreground, then the first terminal device can exempt the distributed library through the low-power management module of the distributed low-power framework, so that at the next heartbeat node, the distributed library of the first terminal device can initiate a collaborative operation to the second terminal device.
  • the distributed library of the first terminal device can initiate a collaborative task to the second terminal device through the task scheduling module and the collaborative execution module of the distributed low-power framework.
  • the second terminal device can perform data interaction with the first terminal device through the communication module, and store images stored in the distributed gallery of the second terminal device in the first terminal device, so as to realize business collaboration and complete data synchronization.
  • a terminal device in a distributed scenario, can obtain the service status of each service of other terminal devices according to the received heartbeat message. If the service running in the foreground of other terminal devices is the same as the service running in the foreground of the terminal device, the terminal device can cooperate 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 the collaborative operation with other terminal devices, and use the wake-up time period of other terminal devices to complete data synchronization with other terminal devices, which can reduce the number of times each terminal device is woken up, thereby reducing the power consumption of other terminal devices.
  • each terminal device in a distributed scenario can unify the wake-up time period for each terminal device, that is, unify the time for each terminal device to send and receive heartbeat messages, thereby reducing the number of wake-up times for each terminal device.
  • each terminal device can simultaneously send heartbeat messages and service messages at the time corresponding to the heartbeat node, and jointly use the wake-up time period of each terminal device, thereby reducing the power consumption of each terminal device.
  • FIG. 12 is a structural block diagram of a service collaboration device provided by the embodiment of the present application. For convenience of description, only the parts related to the embodiment of the present application are shown.
  • the device includes:
  • An adjustment module 1201 configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
  • a receiving module 1202 configured to receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • the synchronization module 1203 is configured to perform 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 synchronization module 1203 is specifically configured to 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 according to the service identifier; 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 next time corresponding to the adjusted heartbeat node, send a service message to the second terminal device, and the service message is used for data synchronization of the second service between the first terminal device and the second terminal device.
  • the synchronization module 1203 is also specifically configured to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the next time corresponding to the adjusted heartbeat node is reached, trigger the non-real-time collaborative task and send the service message to the second terminal device.
  • the synchronization module 1203 is also specifically configured to 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 according to the service identifier; 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, and the service message is used for data synchronization of the first service between the first terminal device and the second terminal device.
  • the device also includes:
  • the extracting module 1204 is configured to extract the service identification bits of the heartbeat message to obtain the service identification corresponding to the first service.
  • the adjustment module 1201 is specifically configured to receive the heartbeat node and the heartbeat period sent by the second terminal device; according to the preset heartbeat coordination formula, combine the heartbeat node and the heartbeat period sent by the second terminal device, and the heartbeat node and the heartbeat period of the first terminal device to perform calculations to obtain the adjusted heartbeat node.
  • FIG. 13 is a structural block diagram of another service collaboration device provided by the embodiment of the present application. For convenience of description, only the parts related to the embodiment of the present application are shown.
  • the device includes:
  • An adjustment module 1301, configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
  • a sending module 1302 configured to send a heartbeat message to the first terminal device at a time corresponding to the adjusted heartbeat node, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
  • the synchronization module 1303 is configured to perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
  • the sending module 1302 is specifically configured 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.
  • the sending module 1302 is further specifically configured to determine that the first service is running in the foreground of the second terminal device according to the hand-raising action triggered by the first service; and obtain a service identifier corresponding to the first service.
  • the synchronization module 1303 is specifically configured to receive a service message sent by the first terminal device, and the service message is used to perform data synchronization on the second service between the first terminal device and the second terminal device; perform data synchronization with the first terminal device on the second service according to the service message.
  • the adjustment module 1301 is specifically configured to send the heartbeat node and the 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, where the absolute time represents the boot time; receive the calculated optimal heartbeat cycle sent by the first terminal device; and obtain the adjusted heartbeat node according to the optimal heartbeat cycle and the synchronized absolute time.
  • a terminal device can obtain the service status of each service of other terminal devices according to the received heartbeat message. If the service running in the foreground of other terminal devices is the same as the service running in the foreground of the terminal device, the terminal device can cooperate 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 the collaborative operation with other terminal devices, and use the wake-up time period of other terminal devices to complete data synchronization with other terminal devices, which can reduce the number of times each terminal device is woken up, thereby reducing the power consumption of other terminal devices.
  • FIG. 14 is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
  • the terminal device may include a processor 1410, an external memory interface 1420, an internal memory 1421, a universal serial bus (universal serial bus, USB) interface 1430, a charging management module 1440, a power management module 1441, a battery 1442, an antenna 1, an 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, Earphone interface 1470D, sensor module 1480, button 1490, motor 1491, indicator 1492, camera 1493, display screen 1494, and subscriber identification module (subscriber identification module, SIM) card interface 1495, etc.
  • a processor 1410 an external memory interface 1420, an internal memory 1421, a universal serial bus (universal serial bus, USB) interface 1430, a charging management module 1440, a power management module 1441, a battery 1442, an antenna 1, an antenna 2, a mobile communication module 1450, a wireless communication module 1460, an audio module 1470,
  • the sensor module 1480 may include a pressure sensor 1480A, a gyroscope sensor 1480B, an air pressure sensor 1480C, a magnetic sensor 1480D, an acceleration sensor 1480E, a distance sensor 1480F, a proximity light sensor 1480G, a fingerprint sensor 1480H, a temperature sensor 1480J, a touch sensor 1480K, an ambient light sensor 1480L, a bone conduction sensor 1480M, and the like.
  • the structure shown in the embodiment of the present invention does not constitute a specific limitation on the terminal device.
  • the terminal device may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 1410 may include one or more processing units, for example: the processor 1410 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural network processor). ural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal device.
  • the controller can be based on the instruction opcode and timing information No., generate operation control signals, and complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 1410 for storing instructions and data.
  • the memory in processor 1410 is a cache memory.
  • the memory may hold instructions or data that the processor 1410 has just used or recycled. If the processor 1410 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 1410 is reduced, thus improving the efficiency of the system.
  • processor 1410 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI) ), a general-purpose input/output (general-purpose input/output, GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • processor 1410 may include multiple sets of I2C buses.
  • the processor 1410 may be respectively coupled to the touch sensor 1480K, the charger, the flashlight, the camera 1493 and the like through different I2C bus interfaces.
  • the processor 1410 may be coupled to the touch sensor 1480K through the I2C interface, so that the processor 1410 and the touch sensor 1480K communicate through the I2C bus interface to realize the touch function of the terminal device.
  • the I2S interface can be used for audio communication.
  • processor 1410 may include multiple sets of I2S buses.
  • the processor 1410 may be coupled to the audio module 1470 through an I2S bus to implement communication between the processor 1410 and the audio module 1470 .
  • the audio module 1470 can transmit audio signals to the wireless communication module 1460 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
  • the audio module 1470 and the wireless communication module 1460 can be coupled through a PCM bus interface.
  • the audio module 1470 can also transmit audio signals to the wireless communication module 1460 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 1410 and the wireless communication module 1460 .
  • the processor 1410 communicates with the Bluetooth module in the wireless communication module 1460 through the UART interface to realize the Bluetooth function.
  • the audio module 1470 can transmit audio signals to the wireless communication module 1460 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 1410 with the display screen 1494, the camera 1493 and other peripheral devices.
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 1410 communicates with the camera 1493 through a CSI interface to implement a shooting function of the terminal device.
  • the processor 1410 communicates with the display screen 1494 through the DSI interface to realize the display function of the terminal device.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 1410 with the camera 1493 , the display screen 1494 , the wireless communication module 1460 , the audio module 1470 , the sensor module 1480 and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 1430 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 1430 can be used to connect the charger to charge the terminal equipment, and can also be used for the terminal equipment Transfer data to and from peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other terminal devices, such as AR devices.
  • the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation on the terminal device.
  • the terminal device may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 1440 is used for receiving charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 1440 can receive charging input from a wired charger through the USB interface 1430 .
  • the charging management module 1440 may receive wireless charging input through a wireless charging coil of the terminal device. While the charging management module 1440 is charging the battery 1442 , it can also provide power for the terminal device through the power management module 1441 .
  • the power management module 1441 is used for connecting the battery 1442 , the charging management module 1440 and the processor 1410 .
  • the power management module 1441 receives the input of the battery 1442 and/or the charging management module 1440, and supplies power for the processor 1410, the internal memory 1421, the external memory, the display screen 1494, the camera 1493, and the wireless communication module 1460, etc.
  • the power management module 1441 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 1441 can also be set in the processor 1410 .
  • the power management module 1441 and the charging management module 1440 may also be set in the same device.
  • the wireless communication function of the terminal device can be realized by the antenna 1, the antenna 2, the mobile communication module 1450, the wireless communication module 1460, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an end device can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 1450 can provide wireless communication solutions including 2G/3G/4G/5G applied on terminal equipment.
  • the mobile communication module 1450 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 1450 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 1450 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 1450 may be set in the processor 1410 .
  • at least part of the functional modules of the mobile communication module 1450 and at least part of the modules of the processor 1410 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 1470A, receiver 1470B, etc.), or displays images or videos through display screen 1494 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 1410, and be set in the same device as the mobile communication module 1450 or other functional modules.
  • the wireless communication module 1460 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), short-range wireless communication technology (near field com communication, NFC), infrared technology (infrared, IR) and other wireless communication solution.
  • the wireless communication module 1460 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 1460 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 1410 .
  • the wireless communication module 1460 can also receive the signal to be sent from the processor 1410 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the terminal device is coupled to the mobile communication module 1450, and the antenna 2 is coupled to the wireless communication module 1460, so that the terminal device can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division multiple access) vision code division multiple access, TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA wideband code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division multiple access
  • LTE long term evolution
  • BT GNSS
  • WLAN NFC
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation) ation systems, SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou satellite navigation system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation system
  • the terminal device realizes the display function through the GPU, the display screen 1494, and the application processor.
  • the GPU is a microprocessor for image processing, connected to the display screen 1494 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 1410 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 1494 is used to display images, videos and the like.
  • Display 1494 includes a display panel.
  • the display panel can be liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting Diodes (quantum dot light emitting diodes, QLED), etc.
  • the terminal device may include 1 or N display screens 1494, where N is a positive integer greater than 1.
  • the terminal device can realize the shooting function through the ISP, the camera 1493, the video codec, the GPU, the display screen 1494, and the application processor.
  • the ISP is used to process the data fed back by the camera 1493 .
  • the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 1493.
  • Camera 1493 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the terminal device may include 1 or N cameras 1493, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal equipment selects the frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • An end device can support one or more video codecs.
  • the terminal device can play or record video in various encoding formats, such as: moving picture expert group (moving picture experts group, MPEG)1, MPEG2, MPEG3, MPEG4, etc.
  • the NPU is a neural-network (NN) computing processor.
  • NPU neural-network
  • Applications such as intelligent cognition of terminal equipment can be realized through NPU, such as: image recognition, face recognition, speech recognition, text understanding, etc.
  • the external memory interface 1420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device.
  • the external memory card communicates with the processor 1410 through the external memory interface 1420 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 1421 may be used to store computer-executable program codes including instructions.
  • the processor 1410 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 1421 .
  • the internal memory 1421 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the terminal device.
  • the internal memory 1421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the terminal device may implement an audio function through an audio module 1470, a speaker 1470A, a receiver 1470B, a microphone 1470C, an earphone interface 1470D, and an application processor. Such as music playback, recording, etc.
  • the audio module 1470 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 1470 may also be used to encode and decode audio signals.
  • the audio module 1470 may be set in the processor 1410 , or some functional modules of the audio module 1470 may be set in the processor 1410 .
  • Loudspeaker 1470A also called “horn" is used to convert audio electrical signals into sound signals.
  • the terminal device can listen to music through speaker 1470A, or listen to hands-free calls.
  • Receiver 1470B also called “earpiece” is used to convert audio electrical signals into audio signals.
  • the terminal device answers a phone call or voice information, it can listen to the voice by bringing the receiver 1470B close to the human ear.
  • Microphone 1470C also known as “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 1470C to make a sound, and input the sound signal to the microphone 1470C.
  • the terminal device may be provided with at least one microphone 1470C. In other embodiments, the terminal device may be provided with two microphones 1470C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the terminal device can also be equipped with three, four or more microphones 1470C to realize sound signal collection, noise reduction, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 1470D is used to connect wired earphones.
  • the earphone interface 1470D may be a USB interface 1430, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 1480A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 1480A may be located on display screen 1494 .
  • pressure sensors 1480A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when there is When the touch operation whose touch operation intensity is less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • the gyroscope sensor 1480B may be used to determine the motion posture of the terminal device.
  • the angular velocity of the terminal device around three axes ie, x, y and z axes
  • the gyro sensor 1480B can be used for image stabilization.
  • the gyro sensor 1480B detects the shake angle of the terminal device, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the terminal device through reverse movement to achieve anti-shake.
  • the gyro sensor 1480B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 1480C is used to measure air pressure. In some embodiments, the terminal device calculates the altitude based on the air pressure value measured by the air pressure sensor 1480C to assist positioning and navigation.
  • the magnetic sensor 1480D includes a Hall sensor.
  • the terminal device can use the magnetic sensor 1480D to detect the opening and closing of the flip leather case.
  • the terminal device when the terminal device is a clamshell machine, the terminal device can detect the opening and closing of the clamshell according to the magnetic sensor 1480D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 1480E can detect the acceleration of the terminal device in various directions (generally three axes). When the terminal device is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device, and it can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the end device can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device may use the distance sensor 1480F for distance measurement to achieve fast focusing.
  • Proximity light sensor 1480G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the terminal device emits infrared light through the light-emitting diode. End devices use photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device. When insufficient reflected light is detected, the terminal device may determine that there is no object near the terminal device.
  • the terminal device can use the proximity light sensor 1480G to detect that the user holds the terminal device close to the ear to make a call, so as to automatically turn off the screen to save power.
  • the proximity light sensor 1480G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
  • the ambient light sensor 1480L is used for sensing ambient light brightness.
  • the terminal device can adaptively adjust the brightness of the display screen 1494 according to the perceived ambient light brightness.
  • the ambient light sensor 1480L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 1480L can also cooperate with the proximity light sensor 1480G to detect whether the terminal device is in the pocket to prevent accidental touch.
  • the fingerprint sensor 1480H is used to collect fingerprints.
  • the terminal device can use the collected fingerprint characteristics to unlock the fingerprint, access the application lock, take a photo with the fingerprint, answer the incoming call with the fingerprint, etc.
  • the temperature sensor 1480J is used to detect temperature.
  • the terminal device uses the temperature detected by the temperature sensor 1480J to implement a temperature processing strategy. For example, when the temperature reported by the temperature sensor 1480J exceeds the threshold, the terminal device may reduce the performance of a processor located near the temperature sensor 1480J, so as to reduce power consumption and implement thermal protection.
  • the terminal device when the temperature is lower than another threshold, the terminal device heats the battery 1442 to avoid abnormal shutdown of the terminal device due to low temperature.
  • the terminal device boosts the output voltage of the battery 1442 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 1480K also known as "touch panel”.
  • the touch sensor 1480K can be arranged on the display screen 1494, and the touch sensor 1480K and the display screen 1494 form a touch screen, also called “touch screen”.
  • the touch sensor 1480K is used to detect a touch operation acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations can be provided through the display screen 1494 .
  • the touch sensor 1480K may also be arranged on the surface of the terminal device, which is different from the position where the display screen 1494 is located.
  • the bone conduction sensor 1480M can acquire vibration signals. In some embodiments, the bone conduction sensor 1480M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 1480M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 1480M can also be disposed in the earphone, combined into a bone conduction earphone.
  • the audio module 1470 can analyze the voice signal based on the vibration signal of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 1480M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 1480M, so as to realize the heart rate detection function.
  • the keys 1490 include a power key, a volume key, and the like. Key 1490 may be a mechanical key. It can also be a touch button.
  • the terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
  • Motor 1491 can generate a vibrating reminder.
  • the motor 1491 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations applied to different applications may correspond to different vibration feedback effects.
  • the motor 1491 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 1494 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 1492 can be an indicator light, which can be used to indicate the charging status, the change of the battery capacity, and can also be used to indicate messages, missed calls, notifications, etc.
  • SIM card interface 1495 is used for connecting SIM card.
  • the SIM card can be inserted into the SIM card interface 1495 or pulled out from the SIM card interface 1495 to achieve contact and separation with the terminal device.
  • the terminal device can support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • SIM card interface 1495 can support Nano SIM card, Micro SIM card, SIM card, etc.
  • the same SIM card interface 1495 can insert multiple cards at the same time. The types of the multiple cards may be the same or different.
  • 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 realize functions such as calling and data communication.
  • the terminal device adopts eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the terminal device and cannot be separated from the terminal device.
  • the software system of the terminal device may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the Android system with layered architecture is taken as an example to illustrate the software structure of the terminal device.
  • FIG. 15 is a block diagram of a software structure of a terminal device according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.
  • the application layer can consist of a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
  • the view system can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the telephony manager is used to provide the communication function of the terminal equipment. For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompting text information in the status bar issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
  • the Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • a corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, and other information). Raw input events are stored at the kernel level.
  • the application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch-click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer, starts the camera application, and then starts the camera driver by calling the kernel layer, and captures still images or videos through the camera 1493.
  • the disclosed devices and methods may be implemented in other ways.
  • the above-described system embodiments are only illustrative.
  • the division of modules or units is only a logical function division.
  • multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the methods of the above-mentioned embodiments in the present application can be completed by instructing related hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be realized.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device capable of carrying computer program codes to a terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium.
  • ROM Read-only memory
  • RAM Random Access Memory
  • an electrical carrier signal a telecommunication signal
  • software distribution medium Such as U disk, mobile hard disk, magnetic disk or optical disk, etc.
  • computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.

Abstract

The present application is applicable to the technical field of terminals, and provides a service collaboration method, an electronic device, a readable storage medium, and a chip system. The method comprises: adjusting the moments corresponding to a heartbeat node of a first terminal device and a heartbeat node of a second terminal device, respectively; receiving a heartbeat packet sent by the second terminal device, wherein the heartbeat packet 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 according to the service identifier and the service running in the foreground of the first terminal device and in combination with the adjusted heartbeat nodes, performing data synchronization with the second terminal device. The first terminal device can determine, according to the received heartbeat packet, a first service running in the foreground of the second terminal device, perform a collaborative operation with the second terminal device in real time or delay, and complete data synchronization with other terminal devices by using the wake-up time period of the second terminal device, so that the number of wake-ups of each terminal device can be reduced, and the power consumption of the second terminal device can be reduced.

Description

业务协同方法、电子设备、可读存储介质和芯片系统Business collaboration method, electronic device, readable storage medium and chip system
本申请要求于2022年1月22日提交国家知识产权局、申请号为202210075719.6、申请名称为“业务协同方法、电子设备、可读存储介质和芯片系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on January 22, 2022, with the application number 202210075719.6 and the application title "Business Collaboration Method, Electronic Device, Readable Storage Medium, and Chip System", the entire contents of which are incorporated in this application by reference.
技术领域technical field
本申请涉及终端设备技术领域,尤其涉及一种业务协同方法、电子设备、可读存储介质和芯片系统。The present application relates to the technical field of terminal equipment, and in particular to a business collaboration method, electronic equipment, a readable storage medium and a chip system.
背景技术Background technique
随着终端设备的不断发展,单一终端设备所具备的功能已无法满足用户的需求。基于此提出了分布式场景,在分布式场景中多个终端设备可以组网进行数据交互,多个终端设备的不同功能可以同时为用户提供服务。With the continuous development of terminal equipment, the functions of a single terminal equipment can no longer meet the needs of users. Based on this, a distributed scenario is proposed. In a distributed scenario, multiple terminal devices can be networked for data interaction, and different functions of multiple terminal devices can provide services to users at the same time.
对于分布式场景中的每个终端设备,终端设备可以向其他终端设备发送心跳报文,确定其他终端设备是否还在分布式场景中;终端设备还可以根据检测的操作,增加、删除或替换存储的数据,同时还可以向其他终端设备同步增加、删除或替换后的数据。For each terminal device in the distributed scenario, the terminal device can send a heartbeat message 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 the stored data according to the detected operation, and can also synchronize the added, deleted or replaced data to other terminal devices.
但是,终端设备在与其他终端设备同步数据时,具有随时性和突发性,其他终端设备需要被频繁唤醒,造成其他终端设备的功耗增加。However, when a terminal device synchronizes data with other terminal devices, it is timely and sudden, and other terminal devices need to be woken up frequently, resulting in increased power consumption of other terminal devices.
发明内容Contents of the invention
本申请提供一种业务协同方法、电子设备、可读存储介质和芯片系统,解决了现有技术中分布式场景中终端设备的功耗增加的问题。The present application provides a service collaboration method, electronic equipment, a readable storage medium, and a chip system, which solve the problem of increased power consumption of terminal equipment in distributed scenarios in the prior art.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above object, the application adopts the following technical solutions:
第一方面,提供一种业务协同方法,应用于分布式系统的第一终端设备,所述分布式系统由所述第一终端设备和第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述方法包括:In the first aspect, a business collaboration method is provided, which is applied to a first terminal device of a distributed system, the distributed system is composed of the first terminal device and a second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;Adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain the adjusted heartbeat node;
接收所述第二终端设备发送的心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;Receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步。Perform data synchronization with the second terminal device in combination with the adjusted heartbeat node according to the service identifier and the service running in the foreground of the first terminal device.
在分布式场景中,第一终端设备和第二终端设备先对心跳节点分别对应的时刻进行调整,得到调整后的心跳节点。之后,第一终端设备可以根据接收第二终端设备发送的心跳报文,获取第二终端设备的各个业务的业务状态,并根据各个业务的业务标识,结合第一终端设备当前前台运行的业务,再基于调整后的心跳节点与第二终端设备完成数据同步,可以利用第二终端设备的唤醒时间段与第二终端设备完成数据同步,可以减少第二终端设备被唤醒的次数,从而可以降低第 二终端设备的功耗。In a distributed scenario, the first terminal device and the second terminal device first adjust the time corresponding to the heartbeat nodes respectively, to obtain adjusted heartbeat nodes. Afterwards, the first terminal device can obtain the service status of each service of the second terminal device according to the heartbeat message sent by the second terminal device, and according to the service identifier of each service, combined with the business currently running on the foreground of the first terminal device, and then complete data synchronization with the second terminal device based on the adjusted heartbeat node, and complete data synchronization with the second terminal device by using the wake-up time period of the second terminal device, which can reduce the number of wake-up times of the second terminal device, thereby reducing the number of second terminal devices. The power consumption of the second terminal equipment.
在第一方面的第一种可能的实现方式中,所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步,包括:In a first possible implementation manner of the first aspect, 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 includes:
根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;According to 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, at the next time corresponding to the adjusted heartbeat node, send a service message to the second terminal device, and the service message is used to perform data synchronization on the second service between the first terminal device and the second terminal device.
若第二终端设备前台运行的业务与第一终端设备当前前台运行的业务不同,则终端设备可以延迟与其他终端设备进行协同作业。在心跳节点对应的时刻,同时发送心跳报文和业务报文,利用第二终端设备的唤醒时间段,从而可以降低第二终端设备的功耗。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 may delay the collaborative operation with other terminal devices. At the moment corresponding to the heartbeat node, the heartbeat message and the service message are sent at the same time, and the wake-up time period of the second terminal device is used, thereby reducing the power consumption of the second terminal device.
基于第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述在下一个所述调整后的心跳节点所对应的时刻,向所述第二终端设备发送业务报文,包括:Based on the first possible implementation of the first aspect, in the second possible implementation of the first aspect, sending a service message to the second terminal device at a time corresponding to the next adjusted heartbeat node includes:
针对所述第一终端设备前台运行的第二业务,注册非实时协同作业任务;For the second service running in the foreground of the first terminal device, registering a non-real-time collaborative task;
在到达下一个所述调整后的心跳节点所对应的时刻时,触发所述非实时协同作业任务,向所述第二终端设备发送所述业务报文。When the time corresponding to the next adjusted heartbeat node is reached, the non-real-time collaborative task is triggered, and the service message is sent to the second terminal device.
在第一方面的第三种可能的实现方式中,所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步,包括:In a third possible implementation manner of the first aspect, performing data synchronization with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node includes:
根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;According to 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 consistent with the first service running in the foreground of the second terminal device, sending the service message to the second terminal device, where the service message is used to perform data synchronization on the first service between the first terminal device and the second terminal device.
若第二终端设备前台运行的业务与终端设备当前前台运行的业务相同,则终端设备可以实时与其他终端设备进行协同作业,完成数据同步。第一终端设备在第二终端设备当前处于唤醒状态的时间段,与第二终端设备完成数据同步,可以减少第二终端设备被唤醒的次数,从而可以降低第二终端设备的功耗。If the service running in the foreground of the second terminal device is the same as the service running in the current foreground of the terminal device, the terminal device can cooperate with other terminal devices in real time to complete data synchronization. The first terminal device completes data synchronization with the second terminal device during the time period when the second terminal device is currently in the wake-up state, which can reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
基于第一方面的上述任意一种可能的实现方式,在第一方面的第四种可能的实现方式中,在所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步之前,所述方法还包括:Based on any of the above possible implementations of the first aspect, in the fourth possible implementation of the first aspect, before performing data synchronization with the second terminal device based on the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node, the method further includes:
对所述心跳报文的业务标识位进行提取,得到所述第一业务对应的所述业务标识。Extracting the service identification bit of the heartbeat message to obtain the service identification corresponding to the first service.
基于第一方面的上述任意一种可能的实现方式,在第一方面的第五种可能的实现方式中,所述对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点,包括:Based on any one of the above possible implementation manners of the first aspect, in a fifth possible implementation manner of the first aspect, the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device is adjusted to obtain adjusted heartbeat nodes, including:
接收所述第二终端设备发送的心跳节点和心跳周期;receiving the heartbeat node and the heartbeat period sent by the second terminal device;
根据预先设置的心跳协调公式,结合所述第二终端设备发送的心跳节点和心跳周期,以及所述第一终端设备的心跳节点和心跳周期进行计算,得到所述调整后的心跳节点。According to the preset heartbeat coordination formula, the heartbeat node and the heartbeat period sent by the second terminal device are combined with the heartbeat node and the heartbeat period of the first terminal device to perform calculation to obtain the adjusted heartbeat node.
分布式场景中的第一终端设备和第二终端设备通过调整心跳节点和心跳周期,使得第一终端设备和第二终端设备被唤醒的时间段一致,也即是第一终端设备和第二终端设备发送和接收心跳 报文的时间一致,从而可以减少各个终端设备被唤醒的次数。In the distributed scenario, the first terminal device and the second terminal device adjust the heartbeat node and the heartbeat cycle so that the time period for the first terminal device and the second terminal device to wake up is consistent, that is, the first terminal device and the second terminal device send and receive heartbeats The time of the message is consistent, so that the number of times each terminal device is woken up can be reduced.
第二方面,提供一种业务协同方法,应用于分布式系统的第二终端设备,所述分布式系统由第一终端设备和所述第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述方法包括:In a second aspect, a business collaboration method is provided, which is applied to a second terminal device of a distributed system, the distributed system is composed of a first terminal device and the second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;Adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain the adjusted heartbeat node;
在所述调整后的心跳节点所对应的时刻,向所述第一终端设备发送心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;At the moment corresponding to the adjusted heartbeat node, send a heartbeat message to the first terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
根据所述第一终端设备发送的业务报文,与所述第一终端设备进行数据同步。Perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
在分布式场景中,第一终端设备和第二终端设备先对心跳节点分别对应的时刻进行调整,得到调整后的心跳节点。之后,第二终端设备可以向第一终端设备发送心跳报文,以向第一终端设备告知第二终端设备运行的各个业务的业务状态,并根据第一终端设备基于各个业务的业务标识反馈的业务报文,从而与第一终端设备完成数据同步,可以利用第二终端设备的唤醒时间段与第二终端设备完成数据同步,可以减少第二终端设备被唤醒的次数,从而可以降低第二终端设备的功耗。In a distributed scenario, the first terminal device and the second terminal device first adjust the time corresponding to the heartbeat nodes respectively, to obtain adjusted heartbeat nodes. Afterwards, the second terminal device may send a heartbeat message to the first terminal device to inform the first terminal device of the service status of each service run by the second terminal device, and complete data synchronization with the first terminal device according to the service message fed back by the first terminal device based on the service identifier of each service. The wake-up period of the second terminal device may be used to complete data synchronization with the second terminal device, which may reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
在第二方面的第一种可能的实现方式中,所述向所述第一终端设备发送心跳报文,包括:In a first possible implementation manner of the second aspect, the sending a heartbeat message to the first terminal device includes:
确定所述第二终端设备前台运行的业务所对应的业务标识;determining the service identifier corresponding to the service running in the foreground of the second terminal device;
根据所述业务标识生成所述心跳报文;generating the heartbeat message according to the service identifier;
向所述第一终端设备发送所述心跳报文。Send the heartbeat message to the first terminal device.
第二终端设备通过在心跳报文中加入业务标识,可以通过该业务标识指示第二终端设备当前前台运行的业务,以便第一终端设备可以根据心跳报文中的业务标识,确定与第二终端设备进行数据同步的时刻,利用第二终端设备的唤醒时间段与第二终端设备完成数据同步,可以减少第二终端设备被唤醒的次数,从而可以降低第二终端设备的功耗。By adding the service identifier in the heartbeat message, the second terminal device can indicate the service currently running on the foreground of the second terminal device through the service identifier, so that the first terminal device can determine the time to perform data synchronization with the second terminal device according to the service identifier in the heartbeat message, and use the wake-up period of the second terminal device to complete data synchronization with the second terminal device, which can reduce the number of times the second terminal device is woken up, thereby reducing power consumption of the second terminal device.
基于第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述确定所述第二终端设备前台运行的业务所对应的业务标识,包括:Based on the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the determining the service identifier corresponding to the service running in the foreground of the second terminal device includes:
根据所述第一业务触发的举手动作,确定所述第一业务在所述第二终端设备前台运行;According to the hand-raising action triggered by the first service, determine that the first service is running in the foreground of the second terminal device;
获取所述第一业务对应的业务标识。Obtain the service identifier corresponding to the first service.
基于第二方面的上述任意一种可能的实现方式,在第二方面的第三种可能的实现方式中,所述根据所述第一终端设备发送的业务报文,与所述第一终端设备进行数据同步,包括:Based on any of the above possible implementations of the second aspect, in a third possible implementation of the second aspect, the performing data synchronization with the first terminal device according to the service message sent by the first terminal device includes:
接收所述第一终端设备发送的业务报文,所述业务报文用于在所述第一终端设备与所述第二终端设备之间,对第二业务进行数据同步;receiving a service message sent by the first terminal device, where the service message is used to perform data synchronization on a second service between the first terminal device and the second terminal device;
根据所述业务报文,与所述第一终端设备针对所述第二业务进行数据同步。Perform data synchronization with the first terminal device for the second service according to the service message.
若第一终端设备前台运行的业务与第二终端设备当前前台运行的业务相同,则第一终端设备可以实时与第二终端设备进行协同作业,完成数据同步。若第一终端设备前台运行的业务与第二终端设备当前前台运行的业务不同,则第一终端设备可以延迟与第二终端设备进行协同作业,利用第二终端设备的唤醒时间段与第二终端设备完成数据同步,可以减少第二终端设备被唤醒的次数,从而可以降低第二终端设备的功耗。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 cooperate 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 the cooperative operation with the second terminal device, and use the wake-up time period of the second terminal device to complete data synchronization with the second terminal device, which can reduce the number of times the second terminal device is woken up, thereby reducing the power consumption of the second terminal device.
基于第二方面的上述任意一种可能的实现方式,在第二方面的第四种可能的实现方式中,所 述对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点,包括:Based on any of the above possible implementations of the second aspect, in the fourth possible implementation of the second aspect, the The step of adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device to obtain the adjusted heartbeat node includes:
向所述第一终端设备发送所述第二终端设备的心跳节点和心跳周期;sending the heartbeat node and the heartbeat cycle of the second terminal device to the first terminal device;
接收所述第一终端设备发送的绝对时间,并与所述第一终端设备同步所述绝对时间,所述绝对时间表示开机时长;receiving the absolute time sent by the first terminal device, and synchronizing the absolute time with the first terminal device, where the absolute time represents the boot time;
接收所述第一终端设备发送的计算得到的最佳心跳周期;receiving the calculated optimal heartbeat period sent by the first terminal device;
根据所述最佳心跳周期和同步后的绝对时间,得到所述调整后的心跳节点。The adjusted heartbeat node is obtained according to the optimal heartbeat period and the synchronized absolute time.
分布式场景中的第一终端设备和第二终端设备通过调整心跳节点和心跳周期,使得第一终端设备和第二终端设备被唤醒的时间段一致,也即是第一终端设备和第二终端设备发送和接收心跳报文的时间一致,从而可以减少各个终端设备被唤醒的次数。In the distributed scenario, the first terminal device and the second terminal device adjust the heartbeat node and the heartbeat cycle to make the first terminal device and the second terminal device wake up at the same time period, that is, the first terminal device and the second terminal device send and receive heartbeat messages at the same time, so that the number of times each terminal device is woken up can be reduced.
第三方面,提供一种业务协同装置,应用于分布式系统的第一终端设备,所述分布式系统由所述第一终端设备和第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述装置包括:In a third aspect, a service coordination device is provided, which is applied to a first terminal device of a distributed system, the distributed system is composed of the first terminal device and a second terminal device, the first terminal device is connected to the second terminal device, and the device includes:
调整模块,用于对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;An adjustment module, configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
接收模块,用于接收所述第二终端设备发送的心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;A receiving module, configured to receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
同步模块,用于根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步。A synchronization module, configured to perform 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.
在第三方面的第一种可能的实现方式中,所述同步模块,具体用于根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;若所述第一终端设备前台运行的第二业务与所述第二终端设备前台运行的第一业务不一致,则在下一个所述调整后的心跳节点所对应的时刻,向所述第二终端设备发送业务报文,所述业务报文用于在所述第一终端设备与所述第二终端设备之间,对所述第二业务进行数据同步。In a first possible implementation manner of the third aspect, the synchronization module is specifically configured to determine, according to 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, send a service message to the second terminal device at the next time corresponding to the adjusted heartbeat node, and the service message is used for data synchronization of the second service between the first terminal device and the second terminal device.
基于第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述同步模块,还具体用于针对所述第一终端设备前台运行的第二业务,注册非实时协同作业任务;在到达下一个所述调整后的心跳节点所对应的时刻时,触发所述非实时协同作业任务,向所述第二终端设备发送所述业务报文。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 configured to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the next time corresponding to the adjusted heartbeat node is reached, trigger the non-real-time collaborative task, and send the service message to the second terminal device.
在第三方面的第三种可能的实现方式中,所述同步模块,还具体用于根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;若所述第一终端设备前台运行的第一业务与所述第二终端设备前台运行的第一业务一致,则向所述第二终端设备发送所述业务报文,所述业务报文用于在所述第一终端设备与所述第二终端设备之间,对所述第一业务进行数据同步。In a third possible implementation manner of the third aspect, the synchronization module is further specifically configured to determine, according to 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, send the service message to the second terminal device, and the service message is used to perform data synchronization on the first service between the first terminal device and the second terminal device.
基于第三方面的上述任意一种可能的实现方式,在第三方面的第四种可能的实现方式中,所述装置还包括:Based on any one of the above possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, the device further includes:
提取模块,用于对所述心跳报文的业务标识位进行提取,得到所述第一业务对应的所述业务标识。An extracting module, configured to extract the service identification bit of the heartbeat message to obtain the service identification corresponding to the first service.
基于第三方面的上述任意一种可能的实现方式,在第三方面的第五种可能的实现方式中,所 述调整模块,具体用于接收所述第二终端设备发送的心跳节点和心跳周期;根据预先设置的心跳协调公式,结合所述第二终端设备发送的心跳节点和心跳周期,以及所述第一终端设备的心跳节点和心跳周期进行计算,得到所述调整后的心跳节点。Based on any of the above possible implementations of the third aspect, in the fifth possible implementation of the third aspect, the The adjustment module is specifically configured to receive the heartbeat node and the heartbeat cycle sent by the second terminal device; according to the preset heartbeat coordination formula, combine the heartbeat node and the heartbeat cycle sent by the second terminal device, and the heartbeat node and the heartbeat cycle of the first terminal device to perform calculations to obtain the adjusted heartbeat node.
第四方面,提供一种业务协同装置,应用于分布式系统的第二终端设备,所述分布式系统由第一终端设备和所述第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述装置包括:In a fourth aspect, a service coordination device is provided, which is applied to a second terminal device of a distributed system, the distributed system is composed of a first terminal device and the second terminal device, the first terminal device is connected to the second terminal device, and the device includes:
调整模块,用于对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;An adjustment module, configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
发送模块,用于在所述调整后的心跳节点所对应的时刻,向所述第一终端设备发送心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;A sending module, configured to send a heartbeat message to the first terminal device at a time corresponding to the adjusted heartbeat node, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
同步模块,用于根据所述第一终端设备发送的业务报文,与所述第一终端设备进行数据同步。A synchronization module, configured to perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
在第四方面的第一种可能的实现方式中,所述发送模块,具体用于确定所述第二终端设备前台运行的业务所对应的业务标识;根据所述业务标识生成所述心跳报文;向所述第一终端设备发送所述心跳报文。In a first possible implementation manner of the fourth aspect, the sending module is specifically configured to determine a service identifier corresponding to a 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.
基于第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述发送模块,还具体用于根据所述第一业务触发的举手动作,确定所述第一业务在所述第二终端设备前台运行;获取所述第一业务对应的业务标识。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 configured to determine that the first service is running in the foreground of the second terminal device according to a hand-raising action triggered by the first service; and acquire a service identifier corresponding to the first service.
基于第四方面的上述任意一种可能的实现方式,在第四方面的第三种可能的实现方式中,所述同步模块,具体用于接收所述第一终端设备发送的业务报文,所述业务报文用于在所述第一终端设备与所述第二终端设备之间,对第二业务进行数据同步;根据所述业务报文,与所述第一终端设备针对所述第二业务进行数据同步。Based on any one of the foregoing possible implementation manners of the fourth aspect, in a third possible implementation manner of the fourth aspect, the synchronization module is specifically configured to receive a service message sent by the first terminal device, and the service message is used to perform data synchronization on a second service between the first terminal device and the second terminal device; perform data synchronization on the second service with the first terminal device according to the service message.
基于第四方面的上述任意一种可能的实现方式,在第四方面的第四种可能的实现方式中,所述调整模块,具体用于向所述第一终端设备发送所述第二终端设备的心跳节点和心跳周期;接收所述第一终端设备发送的绝对时间,并与所述第一终端设备同步所述绝对时间,所述绝对时间表示开机时长;接收所述第一终端设备发送的计算得到的最佳心跳周期;根据所述最佳心跳周期和同步后的绝对时间,得到所述调整后的心跳节点。Based on any one of the above possible implementation manners of the fourth aspect, in a fourth possible implementation manner of the fourth aspect, the adjustment module is specifically configured to send the heartbeat node and the heartbeat period 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, where the absolute time represents the boot time; receive the calculated optimal heartbeat period sent by the first terminal device; obtain the adjusted heartbeat node according to the optimal heartbeat period and the synchronized absolute time.
第五方面,提供一种电子设备,包括:处理器,所述处理器用于运行存储器中存储的计算机程序,以使得所述电子设备实现如第一方面或第二方面中任一项所述的业务协同方法。In a fifth aspect, an electronic device is provided, including: a processor, the processor is configured to run a computer program stored in a memory, so that the electronic device implements the business collaboration method according to any one of the first aspect or the second aspect.
第六方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面或第二方面中任一项所述的业务协同方法。In a sixth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the business collaboration method according to any one of the first aspect or the second aspect is implemented.
第七方面,提供一种芯片系统,所述芯片系统包括存储器和处理器,所述处理器执行所述存储器中存储的计算机程序,以实现如第一方面或第二方面中任一项所述的业务协同方法。According to a seventh aspect, a chip system is provided, the chip system includes a memory and a processor, and the processor executes the computer program stored in the memory, so as to realize the business collaboration method according to any one of the first aspect or the second aspect.
可以理解的是,上述第三方面至第七方面的有益效果可以参见上述第一方面和第二方面中的相关描述,在此不再赘述。 It can be understood that, for the beneficial effects of the above-mentioned third aspect to the seventh aspect, reference can be made to the relevant descriptions in the above-mentioned first aspect and the second aspect, and details are not repeated here.
附图说明Description of drawings
图1A为本申请实施例提供的一种分布式场景的场景示意图;FIG. 1A is a schematic diagram of a distributed scenario provided by an embodiment of the present application;
图1B为本申请实施例提供的一种分布式场景中各终端设备的状态示意图;FIG. 1B is a schematic diagram of the state of each terminal device in a distributed scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种分布式场景中各终端设备协同作业的流程示意图;FIG. 2 is a schematic flow diagram of collaborative operations of terminal devices in a distributed scenario provided by an embodiment of the present application;
图3为本申请实施例提供的一种业务协同方法的示意性流程图;FIG. 3 is a schematic flow chart of a business collaboration method provided by an embodiment of the present application;
图4为本申请实施例提供的一种对中心节点与子节点的心跳节点分别对应的时刻进行调整的流程示意图;FIG. 4 is a schematic flow diagram of adjusting the time corresponding to the heartbeat nodes of the central node and the child nodes provided by the embodiment of the present application;
图5A为本申请实施例提供的一种跨设备统一心跳管理的心跳节点示意图;FIG. 5A is a schematic diagram of a heartbeat node for cross-device unified heartbeat management provided by an embodiment of the present application;
图5B为本申请实施例提供的一种同一终端设备内统一心跳管理的心跳节点示意图;FIG. 5B is a schematic diagram of a heartbeat node for unified heartbeat management in the same terminal device provided by an embodiment of the present application;
图6为本申请实施例提供的一种分布式场景中多个终端设备的心跳节点示意图;FIG. 6 is a schematic diagram of heartbeat nodes of multiple terminal devices in a distributed scenario provided by an embodiment of the present application;
图7为本申请实施例提供的一种多个终端设备进行业务协同的流程示意图;FIG. 7 is a schematic flow diagram of a plurality of terminal devices performing service collaboration according to an embodiment of the present application;
图8为本申请实施例提供的一种心跳报文的示意图;FIG. 8 is a schematic diagram of a heartbeat message provided by an embodiment of the present application;
图9为本申请实施例提供的另一种各终端设备的状态示意图;FIG. 9 is a schematic diagram of another state of each terminal device provided in the embodiment of the present application;
图10为本申请实施例提供的一种终端设备的状态变化示意图;FIG. 10 is a schematic diagram of state changes of a terminal device provided in an embodiment of the present application;
图11为本申请实施例提供的一种多终端设备进行协同作业的软件流程示意图;FIG. 11 is a schematic flowchart of a software for multi-terminal devices performing collaborative operations provided by an embodiment of the present application;
图12为本申请实施例提供的一种业务协同装置的结构框图;FIG. 12 is a structural block diagram of a service collaboration device provided by an embodiment of the present application;
图13为本申请实施例提供的另一种业务协同装置的结构框图;FIG. 13 is a structural block diagram of another service collaboration device provided by the embodiment of the present application;
图14为本申请实施例提供的一种终端设备的结构示意图;FIG. 14 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;
图15为本申请实施例的终端设备的软件结构框图。FIG. 15 is a block diagram of a software structure of a terminal device according to an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的设备组网接入方法、资源释放/恢复方法和电子设备的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known device networking access methods, resource release/restoration methods, and electronic devices are omitted, so as not to hinder the description of this application with unnecessary details.
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“所述”、“上述”和“该”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。The terms used in the following examples are for the purpose of describing particular examples only, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "the", "above" and "the" are intended to also include expressions such as "one or more" unless the context clearly indicates otherwise.
首先,对业务协同方法所涉及的分布式场景进行介绍。First, the distributed scenarios involved in the business collaboration method are introduced.
分布式场景可以为采用分布式技术实现跨设备业务的应用场景。The distributed scenario may be an application scenario in which distributed technology is used to implement cross-device services.
具体地,分布式场景中可以包括多个终端设备,每个终端设备所具备的硬件均可以被加入分布式场景的共享资源池中。也即是,各个终端设备之间可以对具备的硬件和硬件具备的功能进行共享。相应的,各个终端设备在实际应用中,可以针对不同类型的业务,根据共享资源池中的资源,调用其他终端设备的硬件,从而可以在分布式场景中完成不同的业务(如音视频通话、跨终端协同办公和智慧车载等跨设备业务)。Specifically, the distributed scenario may include multiple terminal devices, and the hardware of each terminal device may be added to the shared resource pool of the distributed scenario. That is, the hardware and the functions of the hardware can be shared among the various terminal devices. Correspondingly, in practical applications, each terminal device can call the hardware of other terminal devices according to the resources in the shared resource pool for different types of services, so as to complete different services in distributed scenarios (such as audio and video calls, cross-terminal collaborative office, and smart vehicle and other cross-device services).
例如,若分布式场景中包括:手机和电视,若用户想通过电视具有的较大的屏幕观看手机当前播放的视频,则手机可以根据触发的操作,调用电视的屏幕和扬声器播放视频。或者,电视在播放节目时,可以调用手机的麦克风接收针对电视的语音指令,对电视的音量、频道或播放的节 目等进行调整。For example, if the distributed scene includes: mobile phone and TV, if the user wants to watch the video currently played by the mobile phone through the larger screen of the TV, the mobile phone can call the screen and speakers of the TV to play the video according to the triggered operation. Or, when the TV is playing a program, the microphone of the mobile phone can be used to receive voice commands for the TV, and the volume, channel or program played on the TV can be adjusted. etc. to adjust.
需要说明的是,分布式场景中的各个终端设备可以通过通信模组连接,可以认为该通信模组是一种传输协议,分布式场景中的各个终端设备可以通过通信模组简单快速地与其他终端设备相连接,从而可以调用其他终端设备的硬件,完成相应的业务。It should be noted that each terminal device in a distributed scenario can be connected through a communication module, which can be considered as a transmission protocol, and each terminal device in a distributed scenario can be simply and quickly connected to other terminal devices through a communication module, so that the hardware of other terminal devices can be called to complete the corresponding business.
也即是,通信模组可以是手机、平板电脑、可穿戴设备、智慧屏和车机等分布式场景中各终端设备的通信基座,为各终端设备之间的互联互通提供了统一的通信能力,为设备之间的无感发现和零等待传输创造了条件。That is to say, the communication module can be the communication base of various terminal devices in distributed scenarios such as mobile phones, tablet computers, wearable devices, smart screens, and vehicles, providing a unified communication capability for the interconnection and intercommunication between various terminal devices, and creating conditions for non-inductive discovery and zero-wait transmission between devices.
例如,现有技术中,若手机需要采用蓝牙传输的方式向电脑发送照片,则手机需要先开启蓝牙功能,搜索到电脑后与电脑进行配对授权。手机与电脑建立蓝牙连接后,手机可以向电脑发送需要传输的照片。For example, in the prior art, if the mobile phone needs to send photos to the computer through Bluetooth transmission, the mobile phone needs to turn on the Bluetooth function first, and after searching for the computer, perform pairing authorization with the computer. After the mobile phone establishes a Bluetooth connection with the computer, the mobile phone can send photos that need to be transferred to the computer.
而在分布式场景中,各个终端设备可以基于通信模组主动发现其他终端设备,手机可以在分布式场景中主动发现电脑,并与电脑通过通信模组建立连接。而且,还可以在手机与电脑均配置有图库业务时,手机可以主动向电脑发送照片,实现手机与电脑之间针对图库业务的数据同步。In the distributed scenario, each terminal device can actively discover other terminal devices based on the communication module, and the mobile phone can actively discover the computer in the distributed scenario and establish a connection with the computer through the communication module. Moreover, when both the mobile phone and the computer are configured with a photo gallery service, the mobile phone can actively send photos to the computer to realize data synchronization between the mobile phone and the computer for the photo gallery service.
参见图1A,图1A为本申请实施例提供的一种分布式场景的场景示意图,该分布式场景可以包括:终端设备A、终端设备B和终端设备C。Referring to FIG. 1A, FIG. 1A is a schematic diagram of a distributed scenario provided by an embodiment of the present application. The distributed scenario may include: a terminal device A, a terminal device B, and a terminal device C.
其中,终端设备B分别与终端设备A和终端设备C连接。而且,位于同一分布式场景中的各终端设备均可以向其他终端设备发送心跳报文和/或业务报文。Wherein, terminal device B is connected to terminal device A and terminal device C respectively. Moreover, all terminal devices located in the same distributed scenario can send heartbeat messages and/or service messages to other terminal devices.
其中,心跳报文用于探测分布式场景包括哪些终端设备,也即是检测其他终端设备是否还位于分布式场景中。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 located in the distributed scenario.
而且,业务报文用于实现各终端设备之间的跨设备业务,各终端设备可以通过业务报文针对同一业务实现数据同步。例如,每个终端设备均可以通过业务报文向其他终端设备发送业务数据,使得其他终端设备可以同步业务数据,完成跨设备业务。Moreover, the service message is used to realize the cross-device service between each terminal device, and each terminal device can realize data synchronization for the same service through the service message. For example, each terminal device can send service data to other terminal devices through service packets, so that other terminal devices can synchronize service data and complete cross-device services.
具体地,终端设备B可以通过通信模组分别向远端设备(终端设备A和终端设备C)发送心跳报文,用于探测远端设备是否还处于分布式场景中。终端设备B也可以通过通信模组接收远端设备发送的心跳报文。Specifically, terminal device B can send heartbeat messages to remote devices (terminal device A and terminal device C) respectively through the communication module to detect whether the remote device is still in the distributed scenario. The terminal device B can also receive the heartbeat message sent by the remote device through the communication module.
或者,终端设备A和终端设备B中均包括分布式图库业务。若终端设备A当前正在前台运行分布式图库业务,且终端设备A检测到对分布式图库中的某个图像触发了删除操作,则终端设备A可以对分布式图库中相应的图像进行删除。而且,终端设备A还可以向终端设备B发送业务报文,指示终端设备B根据业务报文,对终端设备B中的分布式图库进行数据同步,也即是对分布式图库中相对应的图像进行删除。Alternatively, both terminal device A and terminal device B include the distributed gallery service. If terminal device A is currently running the distributed gallery service in the foreground, and terminal device A detects that a deletion operation is triggered on an image in the distributed gallery, then terminal device A can delete the corresponding image in the distributed gallery. Moreover, terminal device A can also send a service message to terminal device B, instructing terminal device B to perform data synchronization on the distributed gallery in terminal device B according to the service message, that is, to delete the corresponding image in the distributed gallery.
类似的,终端设备B和终端设备C中均包括分布式文件管理器业务。若终端设备B当前正在前台运行分布式文件管理器业务,且终端设备B检测到对某个文件触发了存储操作,则终端设备B可以通过分布式文件管理器对该文件进行存储。而且,终端设备B还可以向终端设备C发送业务报文,指示终端设备C根据业务报文,通过终端设备C中的分布式文件管理器进行数据同步,也即是在终端设备C中也存储该文件。Similarly, both terminal equipment B and terminal equipment C include distributed file manager services. If terminal device B is currently running the distributed file manager service in the foreground, and terminal device B detects that a storage operation is triggered for a file, terminal device B can store the file through the distributed file manager. Moreover, 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 according to the service message, that is, to store the file in terminal device C.
参见图1B,图1B为本申请实施例提供的一种分布式场景中各终端设备的状态示意图,图1B中分别示出了上述各个终端设备发送心跳报文(图1B中的空心三角)的时间节点,也示出了终端设备A和终端设备C发送业务报文(图1B中的实心三角)的时间节点,还示出了终端设备B接收业务报文的时间节点。 Referring to FIG. 1B, FIG. 1B is a schematic diagram of the state of each terminal device in a distributed scenario provided by an embodiment of the present application. FIG. 1B shows the time nodes at which each of the above-mentioned terminal devices sends heartbeat messages (hollow triangles in FIG. 1B ), and also shows the time nodes at which terminal device A and terminal device C send service messages (solid triangles in FIG. 1B ), and also shows the time nodes at which terminal device B receives service messages.
若终端设备A、终端设备B和终端设备C当前并未在前台运行跨设备业务,则各终端设备均可以进入休眠状态,以降低终端设备的功耗。而各终端设备还需要周期性地向其他设备发送心跳报文,以确定其他终端设备是否还位于分布式场景中。If terminal device A, terminal device B, and terminal device C are not currently running cross-device services in the foreground, each terminal device may enter a sleep state to reduce power consumption of the terminal devices. Each terminal device also needs to periodically send a heartbeat message to other devices to determine whether other terminal devices are still located in the distributed scenario.
相应的,参见图1B,终端设备A、终端设备B和终端设备C分别在不同时刻向其他终端设备发送心跳报文,则接收心跳报文的终端设备从休眠状态被唤醒。而且,终端设备B还分别在不同的时刻,分别向终端设备A和终端设备C发送业务报文,则终端设备A和终端设备C在接收到业务报文时也被唤醒。因此,终端设备A、终端设备B和终端设备C分别在多个时刻被频繁唤醒,使得各个终端设备的功耗增加。Correspondingly, referring to FIG. 1B , terminal device A, terminal device B, and terminal device C send heartbeat messages to other terminal devices at different times, and the terminal device receiving the heartbeat message is awakened from the dormant state. Moreover, terminal device B also sends service packets to terminal device A and terminal device C respectively at different times, then terminal device A and terminal device C are also woken up when receiving the service packets. Therefore, the terminal device A, the terminal device B, and the terminal device C are frequently woken up at multiple times, so that the power consumption of each terminal device increases.
因此,本申请实施例提出一种业务协同方法,终端设备可以根据接收的远端设备发送的心跳报文,确定远端设备前台运行的业务。若终端设备前台运行的业务,与远端设备前台运行的业务不同,则终端设备可以延迟与远端设备进行数据同步(如在终端设备向远端设备发送心跳报文时,也向远端设备发送业务报文)。若终端设备前台运行的业务,与远端设备前台运行的业务相同,则终端设备可以实时与远端设备进行数据同步,实现协同作业。基于终端设备前台运行的业务和远端设备前台运行的业务,采用不同的方式进行协同作业,完成数据同步,可以减少终端设备和远端设备被唤醒的时长和次数,降低终端设备和远端设备的功耗。Therefore, the embodiment of the present application proposes a service coordination method, and the terminal device can determine the service running in the foreground of the remote device according to the received heartbeat message sent by the remote device. If the service running in the foreground of the terminal device is different from the service running in the foreground of the remote device, the terminal device can delay data synchronization with the remote device (for example, when the terminal device sends a heartbeat message to the remote device, it also sends a service message to the remote device). If the service running on the foreground of the terminal device is the same as the service running on the foreground of the remote device, the terminal device can synchronize data with the remote device in real time to realize collaborative work. Based on the business running in the foreground of the terminal device and the business running in the foreground of the remote device, different methods are used to carry out collaborative operations and complete data synchronization, which can reduce the duration and frequency of wake-up of the terminal device and the remote device, and reduce the power consumption of the terminal device and the remote device.
参见图2,图2为本申请实施例提供的一种分布式场景中各终端设备协同作业的流程示意图,该分布式场景中包括:第一终端设备和第二终端设备,其中第一终端设备与第二终端设备连接。Referring to FIG. 2 , FIG. 2 is a schematic flow diagram of collaborative operation of terminal devices in a distributed scenario provided by an embodiment of the present application. The distributed scenario includes: a first terminal device and a second terminal device, wherein the first terminal device is connected to the second terminal device.
第一终端设备可以先与第二终端设备进行组网,接入分布式场景。之后,第一终端设备可以接收第二终端设备发送的心跳报文,并根据该心跳报文携带的业务状态信息,确定第二终端设备当前正在前台运行的第一业务。The first terminal device may first establish a network with the second terminal device to access a distributed scenario. Afterwards, the first terminal device may receive the heartbeat message sent by the second terminal device, and determine the first service that the second terminal device is currently running in the foreground according to the service state information carried in the heartbeat message.
第一终端设备正在前台运行第二业务,并未在前台运行第一业务,与第二终端设备在前台运行第一业务并不相同。为了降低第一终端设备和第二终端设备的功耗,第一终端设备不再实时与第二终端设备进行协同作业,完成数据同步。而是可以在第一终端设备的任务调度器中注册延迟执行的非实时任务,也即是注册针对第一业务与第二终端设备进行数据同步、实现协同作业的非实时任务。The fact that the first terminal device is running the second service in the foreground but not running the first service in the foreground is different from the fact that the second terminal device is running the first service in the foreground. In order to reduce the power consumption of the first terminal device and the second terminal device, the first terminal device no longer cooperates with the second terminal device in real time to complete data synchronization. Instead, the delayed non-real-time task can be registered in the task scheduler of the first terminal device, that is, the non-real-time task for synchronizing data between the first service and the second terminal device to realize collaborative operation can be registered.
其中,第一终端设备的任务调度器用于控制第一终端设备按照预先设置的顺序,执行在任务调度器中注册的各个任务,而且任务调度器还可以控制第一终端设备延迟执行非实时任务。例如,在第一终端设备满足一定的条件时,第一终端设备才执行任务调度器中的某个非实时任务。Wherein, the task scheduler of the first terminal device is used to control the first terminal device to execute each task registered in the task scheduler in a preset order, and the task scheduler can also control the first terminal device to delay execution of non-real-time tasks. For example, the first terminal device executes a certain non-real-time task in the task scheduler only when the first terminal device satisfies a certain condition.
而且,非实时任务可以为在任务调度器中注册的可以延迟执行的任务,或者是在终端设备的状态满足一定条件时,终端设备才能够执行的任务。Moreover, the non-real-time task may be a task registered in the task scheduler that can be delayed for execution, or a task that the terminal device can only execute when the state of the terminal device meets a certain condition.
相应的,任务调度器可以获取第一终端设备的定时器、电源和网络的状态,并根据获取的各状态,设置针对上述非实时任务的约束条件。在定时器、电源和网络的状态均满足约束条件所指示的状态时,则第一终端设备可以通过任务调度器执行注册的非实时任务,也即是第一终端设备中的第二业务通过通信模组执行跨设备业务,使得第一终端设备的第一业务与第二终端设备的第一业务进行协同作业,完成数据同步。Correspondingly, the task scheduler may acquire the status of the timer, power supply, and network of the first terminal device, and set constraints for the aforementioned non-real-time tasks according to the acquired statuses. When the states of the timer, power supply, and network all meet the states 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 services through the communication module, so that the first service of the first terminal device and the first service of the second terminal device perform cooperative operations to complete data synchronization.
具体地,在第一终端设备和第二终端设备再次处于唤醒状态、也即是可以发送、接收心跳报文时,第一终端设备可以执行跨设备业务,使得第一终端设备与第二终端设备之间进行数据传输,从而控制第二终端设备的第一业务与第一终端设备的第一业务协同执行跨设备业务,完成第一终 端设备和第二终端设备针对第一业务的数据同步。Specifically, when the first terminal device and the second terminal device are in the wake-up state again, that is, they can send and receive heartbeat messages, the first terminal device can perform cross-device services, so that data transmission can be performed between the first terminal device and the second terminal device, thereby controlling the first service of the second terminal device to cooperate with the first service of the first terminal device to perform cross-device services, and completing the first terminal device. The terminal device and the second terminal device synchronize data for the first service.
需要说明的是,在实际应用中,分布式场景中可以包括多个组网的终端设备,为了简便说明,本申请实施例以两个终端设备为例进行介绍,本申请实施例对分布式场景中终端设备的数量不做限定。It should be noted that in practical applications, a distributed scenario may include multiple networked terminal devices. For simplicity of description, this embodiment of the application uses two terminal devices as an example. The embodiment of this application does not limit the number of terminal devices in a distributed scenario.
下述仍以分布式场景中的两个终端设备为例,介绍各个终端设备协同执行跨设备业务的方法,以达到降低终端设备的功耗的目的。The following still uses two terminal devices in a distributed scenario as an example to introduce a method for each terminal device to cooperate to execute cross-device services, so as to reduce power consumption of the terminal devices.
图3为本申请实施例提供的一种业务协同方法的示意性流程图,作为示例而非限定,该方法可以应用于上述分布式场景中的第一终端设备和第二终端设备中,参见图3,该方法包括:Fig. 3 is a schematic flowchart of a business collaboration method provided by the embodiment of the present application. As an example but not a limitation, the method can be applied to the first terminal device and the second terminal device in the above-mentioned distributed scenario. Referring to Fig. 3 , the method includes:
步骤301、对第一终端设备的心跳节点和第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点。Step 301: Adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes.
其中,第一终端设备与第二终端设备均位于分布式场景中,且第一终端设备与第二终端设备连接。心跳节点可以为各个终端设备发送心跳报文的时刻,而且各个终端设备周期性地发送心跳报文,则每两个相邻的心跳节点之间的时长即为心跳周期。Wherein, both the first terminal device and the second terminal device are located in a distributed scenario, and the first terminal device is connected to the second terminal device. The heartbeat node can be the moment when each terminal device sends a heartbeat message, and each terminal device periodically sends a heartbeat message, then the duration between every two adjacent heartbeat nodes is the heartbeat cycle.
分布式场景中的多个终端设备均可以周期性地发送心跳报文,以通过心跳报文确定当前位于分布式场景中的各个终端设备。而各个终端设备在发送和接收心跳报文时,均需要被唤醒从而处于唤醒状态,且各个终端设备发送心跳报文的时刻各不相同,会对各个终端设备造成高频次的唤醒,使得终端设备的待机电流上升,增加终端设备的功耗。Multiple terminal devices in the distributed scenario can periodically send heartbeat messages, so as to determine each terminal device currently in the distributed scenario through the heartbeat messages. When each terminal device sends and receives a heartbeat message, it needs to be woken up to be in the wake-up state, and the time for each terminal device to send a heartbeat message is different, which will cause frequent wakeups for each terminal device, which will increase the standby current of the terminal device and increase the power consumption of the terminal device.
因此,本申请实施例中,第一终端设备和第二终端设备可以先对第一终端设备的心跳节点和第二终端设备的心跳节点分别对应的时刻进行调整,使得各个终端设备均可以在同一时刻发送心跳报文,也即是,第一终端设备与第二终端设备针对某个绝对时间(如第一终端设备的开机时长或第二终端设备的开机时长),在经过相同的时长后发送心跳报文,从而减少各个终端设备处于唤醒状态的时间,降低各个终端设备的功耗。Therefore, in the embodiment of the present application, 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, so that each terminal device can send a heartbeat message at the same time, that is, the first terminal device and the second terminal device send the heartbeat message after the same duration 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 each terminal device is in the wake-up state and reducing the power consumption of each terminal device.
在一种可选实施例中,第一终端设备在与第二终端设备进行组网后,分布式场景的通信模组可以将第一终端设备作为中心节点,并将第二终端设备作为子节点。在第二终端设备接入分布式场景后,中心节点可以根据预先设置的心跳协调公式,结合中心节点的心跳周期和心跳节点,以及子节点的心跳周期和心跳节点,生成调整后的心跳周期和心跳节点,并向子节点发送调整后的心跳周期和心跳节点,从而通过中心节点完成对子节点的心跳节点的管理。In an optional embodiment, after the first terminal device forms a network with the second terminal device, the communication module in the distributed scenario may use the first terminal device as a central node and the second terminal device as a child node. After the second terminal device is connected to the distributed scene, the central node can generate an adjusted heartbeat cycle and heartbeat nodes according to the preset heartbeat coordination formula, combined with the heartbeat cycle and heartbeat nodes of the central node, and the heartbeat cycle and heartbeat nodes of the child nodes, and send the adjusted heartbeat cycle and heartbeat nodes to the child nodes, so as to complete the management of the heartbeat nodes of the child nodes through the central node.
参见图4,图4为本申请实施例提供的一种对中心节点与子节点的心跳节点分别对应的时刻进行调整的流程示意图,中心节点和子节点均包括用于统一心跳管理的心跳管理模块,并通过分布式场景中通信模组的时间管理模块对中心节点和子节点的心跳周期和心跳节点等数据进行传输。Referring to FIG. 4, FIG. 4 is a schematic flow diagram for adjusting the time corresponding to the heartbeat nodes of the central node and the sub-nodes according to the embodiment of the present application. Both the central node and the sub-nodes include a heartbeat management module for unified heartbeat management, and transmit data such as heartbeat cycles and heartbeat nodes of the central node and sub-nodes through the time management module of the communication module in a distributed scenario.
具体地,子节点在与中心节点进行组网接入分布式场景后,子节点可以通过通信模组的时间管理模块向中心节点发送子节点的心跳周期,中心节点也可以通过通信模组的时间管理模块向子节点同步第一终端设备的绝对时间,也即是向子节点同步第一终端设备的开机时长。Specifically, after the child node is networked with the central node to access the distributed scene, the child node can send the heartbeat cycle of the child node to the central node through the time management module of the communication module, and the central node can also synchronize the absolute time of the first terminal device to the child node through the time management module of the communication module, that is, to synchronize the boot time of the first terminal device to the child node.
之后,中心节点的心跳管理模块可以根据子节点的心跳周期,结合中心节点的心跳周期和心跳节点,也即是第一终端设备当前已经存在的定时器任务,通过预先设置的心跳协调公式,生成的最佳心跳周期。中心节点还可以通过通信模组向子节点发送生成的最佳心跳周期,相应的,子节点的心跳管理模块可以根据接收的最佳心跳周期,对第二终端设备的心跳节点进行调整,从而完成对第一终端设备和第二终端设备的心跳节点分别对应的时刻的调整。 Afterwards, the heartbeat management module of the central node can generate the optimal heartbeat period through the preset heartbeat coordination formula according to the heartbeat period of the sub-node, combined with the heartbeat period of the central node and the heartbeat node, that is, the timer task currently existing in the first terminal device. The central node can also send the generated optimal heartbeat cycle to the sub-node through the communication module. Correspondingly, the heartbeat management module of the sub-node can adjust the heartbeat node of the second terminal device according to the received optimal heartbeat cycle, thereby completing the adjustment of the time corresponding to the heartbeat nodes of the first terminal device and the second terminal device.
其中,中心节点在生成最佳心跳周期的过程中,可以根据分布式场景中各个终端设备的最小心跳周期生成最佳心跳周期,当然也可以根据其他方式生成最佳心跳周期,本申请实施例对此不做限定。In the process of generating the optimal heartbeat cycle, the central node may generate the optimal heartbeat cycle according to the minimum heartbeat cycle of each terminal device in the distributed scenario, and of course, may also generate the optimal heartbeat cycle in other ways, which is not limited in this embodiment of the present application.
进一步地,分布式场景中的每个终端设备在运行过程中,均可以在同一终端设备中同时运行多个业务。而每个业务在运行过程中,可以实时与其他终端设备的业务进行协同作业,也可以根据调整的心跳节点,在心跳节点对应的时刻与其他终端设备的业务进行协同作业。Furthermore, each terminal device in the distributed scenario can simultaneously run multiple services on the same terminal device during operation. During the running process, each service can cooperate with other terminal equipment services in real time, and can also cooperate with other terminal equipment services at the time corresponding to the heartbeat node according to the adjusted heartbeat node.
相应的,终端设备在根据心跳节点进行协同作业之前,可以将业务触发协同作业的时刻与终端设备的心跳节点进行统一。具体地,终端设备可以根据终端设备的绝对时间,结合业务触发协同作业的时刻和终端设备的心跳周期,通过预先设置的心跳协同公式,重置业务触发协同作业的时刻,使得终端设备运行的业务可以在心跳节点对应的时刻与其他终端设备进行协同作业,实现数据同步。Correspondingly, before the terminal device performs the collaborative operation according to the heartbeat node, the time when the service triggers the collaborative operation can be unified with the heartbeat node of the terminal device. Specifically, the terminal device can reset the time when the service triggers the collaborative operation based on the absolute time of the terminal device, combined with the time when the business triggers the collaborative operation and the heartbeat cycle of the terminal device, through the preset heartbeat coordination formula, so that the business running on the terminal device can perform collaborative operations with other terminal devices at the time corresponding to the heartbeat node to achieve data synchronization.
例如,参见图5A,示出了跨设备统一心跳管理的心跳节点示意图,如图5A所示,中心节点的开机时刻为11:02:00,子节点的开机时刻为11:00:00,中心节点和子节点的心跳周期均为5分钟(min)。在11:08:00子节点接入分布式场景、与中心节点进行组网时,中心节点的绝对时间为6min、子节点的绝对时间为8min。For example, referring to FIG. 5A, a schematic diagram of a heartbeat node for unified heartbeat management across devices is shown. As shown in FIG. 5A, the power-on time of the central node is 11:02:00, the power-on time of the child nodes is 11:00:00, and the heartbeat periods of the central node and the child nodes are both 5 minutes (min). At 11:08:00, when the child node accesses the distributed scene and forms a network with the central node, the absolute time of the central node is 6 minutes, and the absolute time of the child node is 8 minutes.
相应的,中心节点和子节点的各个原心跳节点对应的绝对时间分别为5min、10min和15min等多个时间,也即是中心节点的原心跳节点对应的时刻分别为11:07:00、11:12:00和11:17:00等多个时刻,子节点的原心跳节点对应的时刻分别为11:05:00、11:10:00和11:15:00等多个时刻。Correspondingly, the absolute time corresponding to each primary heartbeat node of the central node and the sub -node is 5min, 10min, and 15min, respectively, that is, the corresponding moments corresponding to the original heartbeat nodes of the central node are 11: 07: 00, 11: 12: 00, and 11:17:00. 00 and 11:15:00 and other times.
在子节点接入分布式场景,与中心节点进行分布式组网后,中心节点可以对子节点的绝对时间进行同步,之后根据预先设置的心跳协调公式进行计算,得到子节点的各个新心跳节点分别对应的绝对时间,从而得到子节点的各个新心跳节点分别对应的时刻。After the sub-nodes are connected to the distributed scene, after the distributed networking with the central node, the central node can synchronize the absolute time of the sub-nodes, and then calculate according to the preset heartbeat coordination formula to obtain the absolute time corresponding to each new heartbeat node of the sub-node, thereby obtaining the time corresponding to each new heartbeat node of the sub-node.
其中,心跳协调公式可以为realTrigger=[(expectTrigger+Time/2)/Time]*Time+Δ,realTrigger表示子节点的各个新心跳节点分别对应的绝对时间,expectTrigger表示子节点的各个原心跳节点分别对应的绝对时间,Time表示中心节点的心跳周期,Δ为中心节点的开机时刻与子节点的开机时刻之间的绝对时间差。Wherein, the heartbeat coordination formula can be realTrigger=[(expectTrigger+Time/2)/Time]*Time+Δ, 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.
在子节点与中心节点进行分布式组网后,中心节点可以根据子节点的原心跳节点(同步后的绝对时间为8min,时刻为11:10:00)和中心节点的心跳周期(5min),通过心跳协调公式计算得到(expectTrigger+Time/2)/Time=(8+5/2)/5=2.1,取整之后[(expectTrigger+Time/2)/Time]=2,结合Δ=2min,计算得到子节点的新心跳节点对应的绝对时间realTrigger=2*5+2=12min,从而得到子节点的新心跳节点对应的时刻为11:12:00。After the child node and the center node are distributed in the network, the center node can calculate (expectTrigger+Time/2)/Time=(8+5/2)/5=2.1 through the heartbeat coordination formula based on the original heartbeat node of the child node (the absolute time after synchronization is 8 minutes, and the time is 11:10:00) and the heartbeat cycle of the center node (5 minutes). The absolute time realTrigger=2*5+2=12min corresponding to the new heartbeat node of , so that the time corresponding to the new heartbeat node of the child node is 11:12:00.
类似的,中心节点还可以计算得到子节点的其他新心跳节点对应的时刻(如11:17:00等),在此不再赘述。Similarly, the central node can also calculate the time corresponding to other new heartbeat nodes of the child node (such as 11:17:00, etc.), which will not be repeated here.
参见图5B,示出了同一终端设备内统一心跳管理的心跳节点示意图,如图5B所示,终端设备的开机时刻为11:00:00,心跳周期为5分钟,则终端设备的各个心跳节点对应的绝对时间分别为5min、10min和15min等多个时间,也即是终端设备的心跳节点分别为11:05:00、11:10:00和11:15:00等多个时刻。终端设备运行的业务对应的定时器为11:03:00触发,也即是当前运行的业务在绝对时间为3min时触发协同作业,则终端设备可以根据心跳协调公式对该定时器的触发时刻进行调整,将最接近的心跳节点作为该业务对应定时器的触发时刻。Referring to FIG. 5B, a schematic diagram of heartbeat nodes for unified heartbeat management in the same terminal device is shown. As shown in FIG. 5B, the boot time of the terminal device is 11:00:00, and the heartbeat period is 5 minutes, and the absolute times corresponding to each heartbeat node of the terminal device are respectively 5 minutes, 10 minutes, and 15 minutes. The timer corresponding to the service run by the terminal device is triggered at 11:03:00, that is, the currently running service triggers the collaborative operation when the absolute time is 3 minutes, then the terminal device can adjust the trigger time of the timer according to the heartbeat coordination formula, and use the closest heartbeat node as the trigger time of the timer corresponding to the service.
其中,心跳协调公式为realTrigger=[(expectTrigger+5min/2)/5min]*5min,realTrigger表 示更新后的触发时刻对应的绝对时间,expectTrigger表示原触发时刻对应的绝对时间,Time表示中心节点的心跳周期。Among them, the heartbeat coordination formula is realTrigger=[(expectTrigger+5min/2)/5min]*5min, realTrigger table indicates the absolute time corresponding to the updated trigger moment, expectTrigger indicates the absolute time corresponding to the original trigger moment, and Time indicates the heartbeat cycle of the central node.
相应的,原触发时刻为11:03:00,对应的绝对时间expectTrigger为3min,则更新后的触发时刻对应的绝对时间realTrigger=[(3+5/2)/5]*5=5min,也即是11:05:00,从而可以与终端设备的心跳节点对齐。Correspondingly, the original trigger time is 11:03:00, and the corresponding absolute time expectTrigger is 3 minutes, then the absolute time corresponding to the updated trigger time realTrigger=[(3+5/2)/5]*5=5min, which is 11:05:00, so that it can be aligned with the heartbeat node of the terminal device.
需要说明的是,本申请实施例以两个终端设备为例说明跨设备统一心跳管理,在实际应用中,分布式场景中可以包括多个组网的终端设备,在分布式场景中接入新的子节点后,中心节点可以基于中心节点的心跳节点和心跳周期,对新的子节点的心跳节点和心跳周期进行调整,使得新的子节点的心跳节点和心跳周期与中心节点的心跳节点和心跳周期相一致,实现跨设备统一心跳管理。It should be noted that the embodiment of the present application uses two terminal devices as an example to illustrate cross-device unified heartbeat management. In practical applications, a distributed scenario may include multiple networked terminal devices. After a new subnode is connected to the distributed scenario, the central node may adjust the heartbeat node and heartbeat period of the new subnode based on the heartbeat node and heartbeat period of the central node, so that the heartbeat node and heartbeat period of the new subnode are consistent with the heartbeat node and heartbeat period of the central node, thereby realizing unified heartbeat management across devices.
例如,参见图6,图6为本申请实施例提供的一种分布式场景中多个终端设备的心跳节点示意图,分布式场景中可以包括终端设备A、终端设备B、终端设备C和终端设备D,在进行组网之前,各个终端设备的心跳节点各不相同。在进行组网后,可以根据多个终端设备的心跳节点,确定距离当前时刻最近的心跳节点为终端设备B的心跳节点。For example, refer to FIG. 6. FIG. 6 is a schematic diagram of heartbeat nodes of multiple terminal devices in a distributed scenario provided by an embodiment of the present application. 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 moment can be determined as the heartbeat node of terminal device B according to the heartbeat nodes of multiple terminal devices.
而且,多个终端设备也可以根据各个终端设备的电源类型选取中心节点。若终端设备A的电源为大容量的电池、终端设备B通过电源线与市电连接、终端设备C和终端设备D的电源为小容量的电池,则终端设备B可以持续保持供电状态,可以将终端设备B作为中心节点,并将其他终端设备作为子节点,再根据终端设备B的心跳节点和心跳周期,调整其他各个终端设备的心跳节点和心跳周期。Moreover, multiple terminal devices may also select a central node according to the power supply type of each terminal device. If the power supply of terminal device A is a large-capacity battery, terminal device B is connected to the mains through a power line, and the power supplies of terminal device C and terminal device D are small-capacity batteries, then terminal device B can maintain the power supply state continuously, and terminal device B can be used as the central node, and other terminal devices can be used as sub-nodes, and then according to the heartbeat node and heartbeat cycle of terminal device B, the heartbeat nodes and heartbeat cycles of other terminal devices can be adjusted.
步骤302、第二终端设备向第一终端设备发送心跳报文。Step 302, the second terminal device sends a heartbeat message to the first terminal device.
其中,心跳报文包括第二终端设备当前处于运行态的各个业务的业务标识。Wherein, the heartbeat message includes service identifiers of various services currently in the running state of the second terminal device.
在第一终端设备与第二终端设备协调完毕心跳节点后,第一终端设备可以根据心跳节点向第二终端设备发送心跳报文,第二终端设备也可以根据心跳节点向第一终端设备发送心跳报文。下述以第二终端设备向第一终端设备发送心跳报文为例说明。After the first terminal device and the second terminal device coordinate the heartbeat node, the first terminal device can send a heartbeat message to the second terminal device according to the heartbeat node, and the second terminal device can also send a heartbeat message to the first terminal device according to the heartbeat node. The following description takes the second terminal device sending a heartbeat message to the first terminal device as an example.
第二终端设备在运行过程中,若当前正在前台运行第一业务,则第二终端设备可以检测到第一业务触发的举手动作,也即是表示第一业务当前正在前台运行。相应的,第二终端设备可以根据该举手动作,确定第一业务的业务状态为运行态,而其他未触发举手动作的业务处于休眠态或暂停态。During the operation of the second terminal device, if the first service is currently running in the foreground, the second terminal device may detect the hand-raising action triggered by the first service, which means that the first service is currently running in the foreground. Correspondingly, the second terminal device may determine that the service state of the first service is in the running state according to the hand-raising action, and other services not triggered by the hand-raising action are in the dormant state or the suspended state.
其中,第一业务触发的举手动作可以为第一业务广播的信令,用于告知系统当前第一业务正在前台运行。业务状态可以包括:运行态、暂停态和休眠态,运行态表示业务当前正在前台运行,暂停态表示业务当前在后台运行,休眠态表示业务当前未运行。Wherein, the gesture of raising the hand triggered by the first service may be a signaling broadcast by the first service, which is used to inform the system that the first service is currently running in the foreground. The service status can include: running state, paused state and dormant state. The running state means that the business is currently running in the foreground, the paused state means that the business is currently running in the background, and the dormant state means that the business is not currently running.
之后,第二终端设备在生成心跳报文的过程中,还可以根据第一业务触发的举手动作,获取第一业务的业务标识,并结合第一业务的业务状态一起加入心跳报文中,使得心跳报文携带第二终端设备前台运行的第一业务的业务标识和第一业务的业务状态,以便第一终端设备可以通过心跳报文确定第二终端设备当前前台运行的第一业务。Afterwards, in the process of generating the heartbeat message, the second terminal device can also acquire the service identifier of the first service according to the hand-raising action triggered by the first service, and add the service status of the first service into the heartbeat message together, so that the heartbeat message carries the service identifier of the first service running in the foreground of the second terminal device and the service status of the first service, 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.
若第一终端设备前台运行的业务与第二终端设备前台运行的业务一致,则第一终端设备可以执行步骤303,与第二终端设备实现协同作业,在第一终端设备中同步第二终端设备的数据。若第一终端设备前台运行的业务与第二终端设备前台运行的业务不一致,则第一终端设备可以执行步骤304,根据第一终端设备的心跳周期和心跳节点与第二终端设备实现协同作业。 If 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, the first terminal device can perform step 303 to realize collaborative work with the second terminal device, and synchronize the data of the second terminal device in the first terminal device. 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 may perform step 304 to realize collaborative work with the second terminal device according to the heartbeat period and heartbeat node of the first terminal device.
例如,参见图7,图7为本申请实施例提供的一种多个终端设备进行业务协同的流程示意图,电脑的分布式图库业务处于运行态,平板电脑的分布式文件管理器业务处于休眠态。相应的,手机可以根据电脑和平板电脑分别通过通信模组的总线通道模块发送的心跳报文,通过资源调度子系统中的业务状态协同模块,确定电脑正在前台运行分布式图库业务。For example, referring to FIG. 7, FIG. 7 is a schematic flow diagram of business collaboration of multiple terminal devices provided by the embodiment of the present application. The distributed library service of the computer is in the running state, and the distributed file manager service of the tablet computer is in the dormant state. Correspondingly, the mobile phone can determine that the computer is running the distributed gallery service in the foreground according to the heartbeat messages sent by the computer and the tablet respectively through the bus channel module of the communication module, and through the business status coordination module in the resource scheduling subsystem.
若手机也在前台运行分布式图库业务,则手机的资源调度子系统可以将分布式图库业务对应的协同任务加入系统活动窗口(unfreeze window),通过资源调度子系统在通信模组中为分布式图库业务进行资源恢复(如恢复Br链路和WiFi链路),使得手机可以通过通信模组向电脑发送分布式图库业务对应的业务报文。If the mobile phone is also running the distributed gallery service in the foreground, the resource scheduling subsystem of the mobile phone can add the collaborative task corresponding to the distributed gallery service to the system activity window (unfreeze window), and perform resource recovery (such as restoring the Br link and WiFi link) for the distributed gallery service in the communication module through the resource scheduling subsystem, so that the mobile phone can send the service message corresponding to the distributed gallery service to the computer through the communication module.
若手机在前台运行分布式文件管理器业务,而平板电脑的分布式文件管理器业务未处于运行态,而是处于休眠态,则手机的资源调度子系统可以将分布式文件管理器业务对应的协同任务加入系统冷冻窗口(freeze window),并通过资源调度子系统在通信模组中释放分布式文件管理器业务对应的资源(如恢复Br链路和WiFi链路),使得手机暂时无法通过通信模组向平板电脑发送分布式文件管理器业务对应的业务报文,而是在手机的系统冷冻窗口满足约束条件解冻之后,才可以向平板电脑发送分布式文件管理器业务对应的业务报文。If the mobile phone runs the distributed file manager service in the foreground, but the distributed file manager service of the tablet computer is not in the running state but in the dormant state, then the resource scheduling subsystem of the mobile phone can add the collaborative task corresponding to the distributed file manager service to the system freeze window (freeze window), and release the resources corresponding to the distributed file manager service in the communication module through the resource scheduling subsystem (such as restoring the Br link and WiFi link), so that the mobile phone cannot temporarily send the service message corresponding to the distributed file manager service to the tablet computer through the communication module, but in the system of the mobile phone The service message corresponding to the distributed file manager service can be sent to the tablet computer only after the frozen window satisfies the constraint conditions and is thawed.
例如,如图8所示,图8为本申请实施例提供的一种心跳报文的示意图,心跳报文中除了包括:帧头、帧尾和第二终端设备的设备标识外,还可以包括业务举手位,该业务举手位中包括:举手业务的业务标识位和举手业务的业务状态位,该举手业务的业务标识位可以为第一业务的标识,举手业务的业务状态位可以为运行态。For example, as shown in FIG. 8, FIG. 8 is a schematic diagram of a heartbeat message provided by the embodiment of the present application. In addition to including: a frame header, a frame tail, and the device identifier of the second terminal device, the heartbeat message may also include a service hand-raising position.
需要说明的是,第二终端设备的第一业务在前台运行过程中,可以周期性地触发举手动作,以便第二终端设备发送的心跳报文中可以持续携带第一业务的业务标识和业务状态。其中,该触发周期可以与第二终端设备的心跳周期一致,也可以小于第二终端设备的心跳周期,本申请实施例对触发周期不做限定。It should be noted that when the first service of the second terminal device is running in the foreground, it can periodically trigger the hand-raising action, so that the heartbeat message sent by the second terminal device can continuously carry the service identifier and service status of the first service. Wherein, the trigger period may be consistent with the heartbeat period of the second terminal device, or may be shorter than the heartbeat period of the second terminal device, and the trigger period is not limited in this embodiment of the present application.
而且,若第一业务由运行态切换为暂停态,则第一业务可以触发一次举手动作,表示第一业务当前处于暂停态。相应的,第二终端设备的心跳报文也可以加入第一业务的业务标识和表示暂停态的业务状态。Moreover, if the first service is switched from the running state to the suspended state, the first service may trigger a hand-raising action, indicating that the first service is currently in the suspended state. Correspondingly, the heartbeat message of the second terminal device may also be added with the service identifier of the first service and the service state indicating the suspended state.
步骤303、若第一终端设备前台运行的业务,与第二终端设备前台运行的业务一致,则第一终端设备向第二终端设备发送业务报文。Step 303: If 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, the first terminal device sends a service message to the second terminal device.
其中,该业务报文用于发起第一终端设备与第二终端设备的数据同步,以使第二终端设备可以根据该业务报文向第一终端设备发送数据,从而实现数据同步。Wherein, the 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 realizing data synchronization.
第一终端设备在接收到第二终端设备发送的心跳报文后,可以根据该心跳报文确定第二终端设备前台运行的是第一业务。若第一终端设备当前也在前台运行第一业务,则第一终端设备可以向第二终端设备发送业务报文,以便在后续步骤中,第一终端设备可以与第二终端设备针对第一业务协同完成作业。After receiving the heartbeat message sent by the second terminal device, the first terminal device may determine according to the heartbeat message that the first service is running in the foreground of the second terminal device. If the first terminal device is currently running the first service in the foreground, the first terminal device can send a service message to the second terminal device, so that in subsequent steps, the first terminal device can cooperate with the second terminal device to complete the first service.
具体地,第一终端设备在接收第二终端设备发送的心跳报文后,可以对心跳报文中的数据进行提取,确定第二终端设备前台运行的是第一业务。而且,第一终端设备当前在前台运行的也是第一业务,第一终端设备的第一业务可以发起协同作业任务,第一终端设备则可以根据第一业务处于运行态的业务状态,将该协同作业任务加入资源调度子系统的系统活动窗口,从而第一终端设备的通信模组子系统可以对该协同作业任务进行资源恢复,可以通过通信模组向第二终端设备发送业务报文,以便在步骤305中,第二终端设备可以根据接收的业务报文进行协同作业。 Specifically, after receiving the heartbeat message sent by the second terminal device, the first terminal device may extract data in the heartbeat message to determine that the first service is running in the foreground of the second terminal device. Moreover, the first terminal device is currently running the first service in the foreground, and the first service of the first terminal device can initiate a collaborative operation task, and the first terminal device can add the collaborative operation task to the system activity window of the resource scheduling subsystem according to the service status of the first service in the running state, so that the communication module subsystem of the first terminal device can perform resource recovery for the collaborative operation task, and can send a service message to the second terminal device through the communication module, so that in step 305, the second terminal device can perform collaborative work according to the received service message.
另外,在实际应用中,若第一终端设备当前也在前台运行第一业务,则说明第一终端设备针对第一业务也存在需要与第二终端设备进行同步的数据。相应的,第一终端设备向第二终端设备发送的心跳报文中,也可以包括第一业务的业务标识和表示运行态的业务状态。类似的,第二终端设备也可以采用与第一终端设备类似的方式,第二终端设备的第一业务也可以发起与第一终端设备进行协同作业,完成数据同步。In addition, in practical applications, if the first terminal device is currently running the first service in the foreground, it means that the first terminal device also has data that needs to be synchronized with the second terminal device for the first service. Correspondingly, the heartbeat message sent by the first terminal device to the second terminal device may also include the service identifier of the first service and the service status indicating the running state. Similarly, the second terminal device can also use a method similar to that of the first terminal device, and the first service of the second terminal device can also initiate a collaborative operation with the first terminal device to complete data synchronization.
步骤304、若第一终端设备前台运行的业务,与第二终端设备前台运行的业务不一致,则第一终端设备根据心跳节点向第二终端设备发送业务报文。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.
若第一终端设备当前前台运行的是第二业务,而根据心跳报文确定第二终端设备当前前台运行的是第一业务,则第一终端设备可以延迟向第二终端设备发送针对第二业务进行协同作业的业务报文。If the first terminal device is currently running the second service in the foreground, and it is determined according to the heartbeat message that the second terminal device is currently running the first service in the foreground, the first terminal device may delay sending a service message for the second service to the second terminal device for collaborative operation.
具体地,第一终端设备在接收第二终端设备发送的心跳报文后,可以对心跳报文中的数据进行提取,确定第二终端设备前台运行的是第一业务,而第一终端设备当前在前台运行的是第二业务,第一终端设备前台运行的业务与第二终端设备前台运行的业务不同。Specifically, after receiving the heartbeat message sent by the second terminal device, the first terminal device may extract the data in the heartbeat message, and 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, and the service running in the foreground of the first terminal device is different from the service running in the foreground of the second terminal device.
相应的,第一终端设备可以将第一业务标记为运行态,并对第一业务进行豁免管控,再通过第一终端设备的资源调度子系统,将第一业务发起的协同作业任务加入系统冷冻窗口中,以便在下一个心跳节点时,第一终端设备可以与第二终端设备针对第一业务进行协同作业,完成数据同步。Correspondingly, the first terminal device can mark the first service as running, and exempt the first service from management and control, and then through the resource scheduling subsystem of the first terminal device, add the collaborative operation task initiated by the first service into the system freezing window, so that at the next heartbeat node, the first terminal device and the second terminal device can perform collaborative work on the first service and complete data synchronization.
经过一个心跳周期到达下一个心跳节点时,第一终端设备可以向第二终端设备发送心跳报文,第一终端设备的系统冷冻窗口中的各个任务也可以进入系统活动窗口,从而可以向第二终端设备发送业务报文,以便在步骤305中,第二终端设备可以与第一终端设备针对第一业务完成协同作业任务,实现数据同步。When arriving at the next heartbeat node after one heartbeat cycle, the first terminal device can send a heartbeat message to the second terminal device, and each task in the system freezing window of the first terminal device can also enter the system active window, thereby sending a service message to the second terminal device, so that in step 305, the second terminal device can complete the cooperative task with the first terminal device for the first business, and realize data synchronization.
步骤305、第二终端设备根据业务报文,与第一终端设备协同执行跨设备业务,同步第一终端设备与第二终端设备之间的数据。In step 305, the second terminal device cooperates with the first terminal device to perform cross-device services according to the service message, and synchronizes data between the first terminal device and the second terminal device.
与步骤303或步骤304相对应的,第二终端设备可以接收第一终端设备实时发送或延迟发送的业务报文,并根据接收的业务报文,与第一终端设备针对第一业务或第二业务进行协同作业,实现第一终端设备与第二终端设备之间的数据同步。Corresponding to step 303 or step 304, the second terminal device can receive the service message sent in real time or delayed by the first terminal device, and according to the received service message, cooperate with the first terminal device for the first service or the second service to realize data synchronization between the first terminal device and the second terminal device.
在一种可选实施例中,与步骤303相对应的,若第一终端设备和第二终端设备当前前台运行的均是第一业务,则第二终端设备在步骤302向第一终端设备发送心跳报文后,即可实时接收到第一终端设备针对第一业务发送的业务报文,从而可以根据接收的业务报文,向第一终端设备发送业务数据,从而在第一终端设备中同步与第一业务相对应的数据,完成第一终端设备与第二终端设备的协同作业。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, 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, so that 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.
在另一种可选实施例中,与步骤304相对应的,若第一终端设备当前前台运行的是第二业务,则第二终端设备在步骤302向第一终端设备发送心跳报文后,可以在经过一个心跳周期、到达下一个心跳节点时,第一终端设备在向第二终端设备发送心跳报文的同时,还可以向第二终端设备发送针对第二业务的业务报文。也即是,第二终端设备需要等待一个心跳周期后,才可以接收到第一终端设备发送的针对第二业务的业务报文。第二终端设备也需要等待一个心跳周期后,才可以与第一终端设备针对第二业务进行协同作业,实现数据同步。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, after a heartbeat cycle and reaching the next heartbeat node, the first terminal device may also send a service message for the second service to the second terminal device while sending a heartbeat message to the second terminal device. That is, the second terminal device needs to wait for one heartbeat cycle before it can receive the service packet for the second service sent by the first terminal device. The second terminal device also needs to wait for one heartbeat period before it can cooperate with the first terminal device for the second service to realize data synchronization.
相应的,第二终端设备也可以根据接收的心跳报文,向第一终端设备发送针对第一业务的业务报文,从而在第一终端设备中同步与第一业务相对应的数据,完成第一终端设备与第二终端设 备的协同作业。Correspondingly, the second terminal device can also send a service message for the first service to the first terminal device according to the received heartbeat message, so that the data corresponding to the first service is synchronized in the first terminal device, and the first terminal device and the second terminal device are set up. Prepared collaborative work.
需要说明的是,本申请实施例中是以非实时业务为例说明的,也即是第一终端设备延迟向第二终端设备发送的业务报文仅针对非实时业务。而在实际应用中,终端设备可以运行非实时业务,也可以运行实时业务,本申请实施例终端设备运行业务的种类不做限定。It should be noted that, in the embodiment of the present application, a non-real-time service is taken as an example, that is, the service message that the first terminal device delays sending to the second terminal device is only for the non-real-time service. However, in practical applications, the terminal device may run non-real-time services or real-time services, and the types of services run by the terminal device in the embodiment of the present application are not limited.
例如,终端设备的非实时业务可以包括:非前台触发图片全量或增量同步、缩略图自动预加载或缓存、非前台触发数据变更通知、以及非前台触发数据交互业务同步等。而且,终端设备的部分业务还可以根据不同的条件,划分为实时业务或非实时业务,如表1所示,分别示出了不同业务在不同条件下,被划分为实时业务或非实时业务。For example, non-real-time services of terminal devices may include: non-foreground triggered full or incremental image synchronization, automatic thumbnail preloading or caching, non-foreground triggered data change notification, and non-foreground triggered data interaction service synchronization, etc. Moreover, some services of the terminal equipment can also be classified as real-time services or non-real-time services according to different conditions. As shown in Table 1, it shows that different services are classified as real-time services or non-real-time services under different conditions.
表1
Table 1
相应的,参见图9,图9为本申请实施例提供的另一种各终端设备的状态示意图,各个终端设备(终端设备A、终端设备B、终端设备C和终端设备D)在调整心跳节点和心跳周期后,可以在同一时刻发送心跳报文(图中空心三角),并在发送心跳报文的时刻,同时发送非实时业务对应的业务报文(图中条纹三角)。而且,终端设备B和终端设备D也可以在非心跳节点发送实时业务对应的业务报文(图中实心三角)。Correspondingly, referring to FIG. 9, FIG. 9 is another schematic diagram of the state of each terminal device provided by the embodiment of the present application. Each terminal device (terminal device A, terminal device B, terminal device C, and terminal device D) can send a heartbeat message at the same time after adjusting the heartbeat node and the heartbeat cycle (the hollow triangle in the figure), and at the time of sending the heartbeat message, simultaneously send the service message corresponding to the non-real-time service (the striped triangle in the figure). Moreover, terminal device B and terminal device D may also send service packets corresponding to real-time services at non-heartbeat nodes (solid triangles in the figure).
参见图10,图10为本申请实施例提供的一种终端设备的状态变化示意图,终端设备在跨设备业务未协调统一的情况下,终端设备被频繁唤醒,终端设备的待机电流也频繁上升。在协调统一跨设备业务后,终端设备周期性地处于唤醒状态,被唤醒的次数明显下降。而且,终端设备的待机电流也出现了明显的下降。 Referring to FIG. 10 , FIG. 10 is a schematic diagram of a state change of a terminal device provided by an embodiment of the present application. When the cross-device services of the terminal device are not coordinated and unified, the terminal device is frequently woken up, and the standby current of the terminal device also frequently rises. After the coordination and unification of cross-device services, the terminal device is periodically in the wake-up state, and the number of wake-up times is significantly reduced. Moreover, the standby current of terminal equipment has also dropped significantly.
进一步地,现有技术中多个终端设备在进行组网时,分布式场景中增加1个终端设备,各个终端设备的电流上升到15.5毫安(mA),功耗增加比例达到18.32%;增加2个终端设备,各个终端设备的电流上升到17.4mA,功耗增加比例达到32.82%;增加3个终端设备,各个终端设备的电流上升到19.3mA,功耗增加比例达到47.33%;增加4个终端设备,各个终端设备的电流上升到20.1mA,功耗增加比例达到53.44%。Further, in the prior art, when multiple terminal devices are networking, if one terminal device is added in a distributed scenario, the current of each terminal device rises to 15.5 mA, and the power consumption increase ratio reaches 18.32%; when two terminal devices are added, the current of each terminal device rises to 17.4 mA, and the power consumption increase ratio reaches 32.82%; when three terminal devices are added, the current of each terminal device rises to 19.3 mA, and the power consumption increase ratio reaches 47.33%; The current rises to 20.1mA, and the power consumption increases by 53.44%.
而采用本申请实施例提供的业务协同方法后,分布式场景中增加终端设备后各个终端设备的功耗明显下降。例如,当分布式场景中增加1个终端设备时,功耗增加比例在10%左右;当分布式场景中增加2个或2个以上的终端设备时,功耗增加比例仅在25%至30%之间。However, after adopting the service collaboration method provided in the embodiment of the present application, the power consumption of each terminal device is significantly reduced after adding terminal devices in a distributed scenario. 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%.
下述以第一终端设备和第二终端设备针对分布式图库进行协同作业为例,介绍说明第一终端设备和第二终端设备在进行协同作业时,第一终端设备和第二终端设备的软件架构的工作流程。参见图11,图11为本申请实施例提供的一种多终端设备进行协同作业的软件流程示意图。The following takes the cooperative operation of the first terminal device and the second terminal device for the distributed gallery as an example, and describes the workflow of the software architecture of the first terminal device and the second terminal device when the first terminal device and the second terminal device perform collaborative operations. Referring to FIG. 11 , FIG. 11 is a schematic flowchart of a software for multi-terminal devices performing collaborative operations provided by an embodiment of the present application.
其中,第一终端设备与第二终端设备通过通信模组,基于组网协议进行组网,共同接入分布式场景。而且,第一终端设备可以通过通信模组发送心跳报文,确定第二终端设备是否仍然位于分布式场景中。类似的,第二终端设备也可以通过通信模组发送心跳报文,确定第一终端设备是否仍然位于分布式场景中。Wherein, the first terminal device and the second terminal device form a network based on a networking protocol through a communication module, and jointly access the distributed scene. Moreover, the first terminal device may send a heartbeat message through the communication module to determine whether the second terminal device is still located in the distributed scenario. Similarly, the second terminal device may also send a heartbeat message through the communication module to determine whether the first terminal device is still located in the distributed scenario.
第二终端设备在前台运行分布式图库,若检测到触发的增加图片的操作,则第二终端设备可以存储增加的图片。而且,第二终端设备在心跳节点对应的时刻,可以通过第二终端设备中分布式低功耗框架的生命周期模块,确定分布式图库当前处于运行态,也即是当前正在前台运行分布式图库,则第二终端设备可以向第一终端设备发送携带分布式图库的业务标识和业务状态。The second terminal device runs the distributed gallery in the foreground, and if a triggered operation of adding a picture is detected, the second terminal device may store the added picture. Moreover, at the moment corresponding to the heartbeat node, the second terminal device can determine that the distributed library is currently running through the lifecycle module of the distributed low-power framework in the second terminal device, that is, the distributed library is currently running in the foreground, then the second terminal device can send the service identifier and service status carrying the distributed library to the first terminal device.
相对应的,第一终端设备可以接收第二终端设备发送的心跳报文,并根据心跳报文确定第二终端设备当前正在前台运行分布式图库,则第一终端设备可以通过分布式低功耗框架的低功耗管理模块对分布式图库进行豁免管控,以便在下个心跳节点,第一终端设备的分布式图库可以向第二终端设备发起协同作业。Correspondingly, the first terminal device can receive the heartbeat message sent by the second terminal device, and determine according to the heartbeat message that the second terminal device is currently running the distributed library in the foreground, then the first terminal device can exempt the distributed library through the low-power management module of the distributed low-power framework, so that at the next heartbeat node, the distributed library of the first terminal device can initiate a collaborative operation to the second terminal device.
在经过一个心跳周期后,第一终端设备的分布式图库,可以通过分布式低功耗框架的任务调度模块和协同执行模块,向第二终端设备发起协同任务。第二终端设备则可以通过通信模组与第一终端设备进行数据交互,在第一终端设备中存储第二终端设备的分布式图库所存储的图像,从而实现业务协作,完成数据同步。After a heartbeat cycle, the distributed library of the first terminal device can initiate a collaborative task to the second terminal device through the task scheduling module and the collaborative execution module of the distributed low-power framework. The second terminal device can perform data interaction with the first terminal device through the communication module, and store images stored in the distributed gallery of the second terminal device in the first terminal device, so as to realize business collaboration and complete data synchronization.
综上所述,本申请实施例提供的业务协同方法,在分布式场景中,终端设备可以根据接收的心跳报文获取其他终端设备的各个业务的业务状态。若其他终端设备前台运行的业务与终端设备当前前台运行的业务相同,则终端设备可以实时与其他终端设备进行协同作业,完成数据同步。若其他终端设备前台运行的业务与终端设备当前前台运行的业务不同,则终端设备可以延迟与其他终端设备进行协同作业,利用其他终端设备的唤醒时间段与其他终端设备完成数据同步,可以减少各个终端设备被唤醒的次数,从而可以降低其他终端设备的功耗。To sum up, in the service collaboration method provided by the embodiment of the present application, in a distributed scenario, a terminal device can obtain the service status of each service of other terminal devices according to the received heartbeat message. If the service running in the foreground of other terminal devices is the same as the service running in the foreground of the terminal device, the terminal device can cooperate 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 the collaborative operation with other terminal devices, and use the wake-up time period of other terminal devices to complete data synchronization with other terminal devices, which can reduce the number of times each terminal device is woken up, thereby reducing the power consumption of other terminal devices.
而且,分布式场景中的各个终端设备通过协调心跳节点和心跳周期,可以统一各个终端设备被唤醒的时间段,也即是统一各个终端设备发送和接收心跳报文的时间,从而可以减少各个终端设备被唤醒的次数。Moreover, by coordinating heartbeat nodes and heartbeat cycles, each terminal device in a distributed scenario can unify the wake-up time period for each terminal device, that is, unify the time for each terminal device to send and receive heartbeat messages, thereby reducing the number of wake-up times for each terminal device.
另外,各个终端设备可以基于调整后的心跳节点和心跳周期,在心跳节点对应的时刻,同时发送心跳报文和业务报文,共同利用各终端设备的唤醒时间段,从而可以降低各个终端设备的功耗。 In addition, based on the adjusted heartbeat node and heartbeat period, each terminal device can simultaneously send heartbeat messages and service messages at the time corresponding to the heartbeat node, and jointly use the wake-up time period of each terminal device, thereby reducing the power consumption of each terminal device.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
对应于上文实施例所述的业务协同方法,图12为本申请实施例提供的一种业务协同装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the business collaboration method described in the above embodiments, FIG. 12 is a structural block diagram of a service collaboration device provided by the embodiment of the present application. For convenience of description, only the parts related to the embodiment of the present application are shown.
参照图12,该装置包括:Referring to Figure 12, the device includes:
调整模块1201,用于对第一终端设备的心跳节点和第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;An adjustment module 1201, configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
接收模块1202,用于接收该第二终端设备发送的心跳报文,该心跳报文包括业务标识,该业务标识用于指示该第二终端设备前台运行的第一业务;A receiving module 1202, configured to receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
同步模块1203,用于根据该业务标识和该第一终端设备前台运行的业务,结合该调整后的心跳节点,与该第二终端设备进行数据同步。The synchronization module 1203 is configured to perform 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.
可选的,该同步模块1203,具体用于根据该业务标识,确定该第一终端设备前台运行的业务与该第二终端设备前台运行的业务是否一致;若该第一终端设备前台运行的第二业务与该第二终端设备前台运行的第一业务不一致,则在下一个该调整后的心跳节点所对应的时刻,向该第二终端设备发送业务报文,该业务报文用于在该第一终端设备与该第二终端设备之间,对该第二业务进行数据同步。Optionally, the synchronization module 1203 is specifically configured to 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 according to the service identifier; 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 next time corresponding to the adjusted heartbeat node, send a service message to the second terminal device, and the service message is used for data synchronization of the second service between the first terminal device and the second terminal device.
可选的,该同步模块1203,还具体用于针对该第一终端设备前台运行的第二业务,注册非实时协同作业任务;在到达下一个该调整后的心跳节点所对应的时刻时,触发该非实时协同作业任务,向该第二终端设备发送该业务报文。Optionally, the synchronization module 1203 is also specifically configured to register a non-real-time collaborative task for the second service running in the foreground of the first terminal device; when the next time corresponding to the adjusted heartbeat node is reached, trigger the non-real-time collaborative task and send the service message to the second terminal device.
可选的,该同步模块1203,还具体用于根据该业务标识,确定该第一终端设备前台运行的业务与该第二终端设备前台运行的业务是否一致;若该第一终端设备前台运行的第一业务与该第二终端设备前台运行的第一业务一致,则向该第二终端设备发送该业务报文,该业务报文用于在该第一终端设备与该第二终端设备之间,对该第一业务进行数据同步。Optionally, the synchronization module 1203 is also specifically configured to 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 according to the service identifier; 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, and the service message is used for data synchronization of the first service between the first terminal device and the second terminal device.
可选的,该装置还包括:Optionally, the device also includes:
提取模块1204,用于对该心跳报文的业务标识位进行提取,得到该第一业务对应的该业务标识。The extracting module 1204 is configured to extract the service identification bits of the heartbeat message to obtain the service identification corresponding to the first service.
可选的,该调整模块1201,具体用于接收该第二终端设备发送的心跳节点和心跳周期;根据预先设置的心跳协调公式,结合该第二终端设备发送的心跳节点和心跳周期,以及该第一终端设备的心跳节点和心跳周期进行计算,得到该调整后的心跳节点。Optionally, the adjustment module 1201 is specifically configured to receive the heartbeat node and the heartbeat period sent by the second terminal device; according to the preset heartbeat coordination formula, combine the heartbeat node and the heartbeat period sent by the second terminal device, and the heartbeat node and the heartbeat period of the first terminal device to perform calculations to obtain the adjusted heartbeat node.
图13为本申请实施例提供的另一种业务协同装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。FIG. 13 is a structural block diagram of another service collaboration device provided by the embodiment of the present application. For convenience of description, only the parts related to the embodiment of the present application are shown.
参照图13,该装置包括:Referring to Figure 13, the device includes:
调整模块1301,用于对第一终端设备的心跳节点和第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;An adjustment module 1301, configured to adjust the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain adjusted heartbeat nodes;
发送模块1302,用于在该调整后的心跳节点所对应的时刻,向该第一终端设备发送心跳报文,该心跳报文包括业务标识,该业务标识用于指示该第二终端设备前台运行的第一业务; A sending module 1302, configured to send a heartbeat message to the first terminal device at a time corresponding to the adjusted heartbeat node, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
同步模块1303,用于根据该第一终端设备发送的业务报文,与该第一终端设备进行数据同步。The synchronization module 1303 is configured to perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
可选的,该发送模块1302,具体用于确定该第二终端设备前台运行的业务所对应的业务标识;根据该业务标识生成该心跳报文;向该第一终端设备发送该心跳报文。Optionally, the sending module 1302 is specifically configured 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.
可选的,该发送模块1302,还具体用于根据该第一业务触发的举手动作,确定该第一业务在该第二终端设备前台运行;获取该第一业务对应的业务标识。Optionally, the sending module 1302 is further specifically configured to determine that the first service is running in the foreground of the second terminal device according to the hand-raising action triggered by the first service; and obtain a service identifier corresponding to the first service.
可选的,该同步模块1303,具体用于接收该第一终端设备发送的业务报文,该业务报文用于在该第一终端设备与该第二终端设备之间,对该第二业务进行数据同步;根据该业务报文,与该第一终端设备针对该第二业务进行数据同步。Optionally, the synchronization module 1303 is specifically configured to receive a service message sent by the first terminal device, and the service message is used to perform data synchronization on the second service between the first terminal device and the second terminal device; perform data synchronization with the first terminal device on the second service according to the service message.
可选的,该调整模块1301,具体用于向该第一终端设备发送该第二终端设备的心跳节点和心跳周期;接收该第一终端设备发送的绝对时间,并与该第一终端设备同步该绝对时间,该绝对时间表示开机时长;接收该第一终端设备发送的计算得到的最佳心跳周期;根据该最佳心跳周期和同步后的绝对时间,得到该调整后的心跳节点。Optionally, the adjustment module 1301 is specifically configured to send the heartbeat node and the 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, where the absolute time represents the boot time; receive the calculated optimal heartbeat cycle sent by the first terminal device; and obtain the adjusted heartbeat node according to the optimal heartbeat cycle and the synchronized absolute time.
综上所述,本申请实施例提供的业务协同装置,在分布式场景中,终端设备可以根据接收的心跳报文获取其他终端设备的各个业务的业务状态。若其他终端设备前台运行的业务与终端设备当前前台运行的业务相同,则终端设备可以实时与其他终端设备进行协同作业,完成数据同步。若其他终端设备前台运行的业务与终端设备当前前台运行的业务不同,则终端设备可以延迟与其他终端设备进行协同作业,利用其他终端设备的唤醒时间段与其他终端设备完成数据同步,可以减少各个终端设备被唤醒的次数,从而可以降低其他终端设备的功耗。To sum up, with the service collaboration device provided by the embodiment of the present application, in a distributed scenario, a terminal device can obtain the service status of each service of other terminal devices according to the received heartbeat message. If the service running in the foreground of other terminal devices is the same as the service running in the foreground of the terminal device, the terminal device can cooperate 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 the collaborative operation with other terminal devices, and use the wake-up time period of other terminal devices to complete data synchronization with other terminal devices, which can reduce the number of times each terminal device is woken up, thereby reducing the power consumption of other terminal devices.
下面介绍本申请实施例涉及的终端设备。请参阅图14,图14为本申请实施例提供的一种终端设备的结构示意图。The terminal device involved in this embodiment of the present application is introduced below. Please refer to FIG. 14 , which is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
终端设备可以包括处理器1410,外部存储器接口1420,内部存储器1421,通用串行总线(universal serial bus,USB)接口1430,充电管理模块1440,电源管理模块1441,电池1442,天线1,天线2,移动通信模块1450,无线通信模块1460,音频模块1470,扬声器1470A,受话器1470B,麦克风1470C,耳机接口1470D,传感器模块1480,按键1490,马达1491,指示器1492,摄像头1493,显示屏1494,以及用户标识模块(subscriber identification module,SIM)卡接口1495等。其中传感器模块1480可以包括压力传感器1480A,陀螺仪传感器1480B,气压传感器1480C,磁传感器1480D,加速度传感器1480E,距离传感器1480F,接近光传感器1480G,指纹传感器1480H,温度传感器1480J,触摸传感器1480K,环境光传感器1480L,骨传导传感器1480M等。The terminal device may include a processor 1410, an external memory interface 1420, an internal memory 1421, a universal serial bus (universal serial bus, USB) interface 1430, a charging management module 1440, a power management module 1441, a battery 1442, an antenna 1, an 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, Earphone interface 1470D, sensor module 1480, button 1490, motor 1491, indicator 1492, camera 1493, display screen 1494, and subscriber identification module (subscriber identification module, SIM) card interface 1495, etc. The sensor module 1480 may include a pressure sensor 1480A, a gyroscope sensor 1480B, an air pressure sensor 1480C, a magnetic sensor 1480D, an acceleration sensor 1480E, a distance sensor 1480F, a proximity light sensor 1480G, a fingerprint sensor 1480H, a temperature sensor 1480J, a touch sensor 1480K, an ambient light sensor 1480L, a bone conduction sensor 1480M, and the like.
可以理解的是,本发明实施例示意的结构并不构成对终端设备的具体限定。在本申请另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure shown in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器1410可以包括一个或多个处理单元,例如:处理器1410可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 1410 may include one or more processing units, for example: the processor 1410 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural network processor). ural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是终端设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信 号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the terminal device. The controller can be based on the instruction opcode and timing information No., generate operation control signals, and complete the control of fetching instructions and executing instructions.
处理器1410中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器1410中的存储器为高速缓冲存储器。该存储器可以保存处理器1410刚用过或循环使用的指令或数据。如果处理器1410需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器1410的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 1410 for storing instructions and data. In some embodiments, the memory in processor 1410 is a cache memory. The memory may hold instructions or data that the processor 1410 has just used or recycled. If the processor 1410 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 1410 is reduced, thus improving the efficiency of the system.
在一些实施例中,处理器1410可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 1410 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI) ), a general-purpose input/output (general-purpose input/output, GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器1410可以包含多组I2C总线。处理器1410可以通过不同的I2C总线接口分别耦合触摸传感器1480K,充电器,闪光灯,摄像头1493等。例如:处理器1410可以通过I2C接口耦合触摸传感器1480K,使处理器1410与触摸传感器1480K通过I2C总线接口通信,实现终端设备的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL). In some embodiments, processor 1410 may include multiple sets of I2C buses. The processor 1410 may be respectively coupled to the touch sensor 1480K, the charger, the flashlight, the camera 1493 and the like through different I2C bus interfaces. For example, the processor 1410 may be coupled to the touch sensor 1480K through the I2C interface, so that the processor 1410 and the touch sensor 1480K communicate through the I2C bus interface to realize the touch function of the terminal device.
I2S接口可以用于音频通信。在一些实施例中,处理器1410可以包含多组I2S总线。处理器1410可以通过I2S总线与音频模块1470耦合,实现处理器1410与音频模块1470之间的通信。在一些实施例中,音频模块1470可以通过I2S接口向无线通信模块1460传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, processor 1410 may include multiple sets of I2S buses. The processor 1410 may be coupled to the audio module 1470 through an I2S bus to implement 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 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块1470与无线通信模块1460可以通过PCM总线接口耦合。在一些实施例中,音频模块1470也可以通过PCM接口向无线通信模块1460传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal. In some embodiments, the audio module 1470 and the wireless communication module 1460 can be coupled through a PCM bus interface. In some embodiments, the audio module 1470 can also transmit audio signals to the wireless communication module 1460 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器1410与无线通信模块1460。例如:处理器1410通过UART接口与无线通信模块1460中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块1470可以通过UART接口向无线通信模块1460传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 1410 and the wireless communication module 1460 . For example: the processor 1410 communicates with the Bluetooth module in the wireless communication module 1460 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 1470 can transmit audio signals to the wireless communication module 1460 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
MIPI接口可以被用于连接处理器1410与显示屏1494,摄像头1493等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器1410和摄像头1493通过CSI接口通信,实现终端设备的拍摄功能。处理器1410和显示屏1494通过DSI接口通信,实现终端设备的显示功能。The MIPI interface can be used to connect the processor 1410 with the display screen 1494, the camera 1493 and other peripheral devices. MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc. In some embodiments, the processor 1410 communicates with the camera 1493 through a CSI interface to implement a shooting function of the terminal device. The processor 1410 communicates with the display screen 1494 through the DSI interface to realize the display function of the terminal device.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器1410与摄像头1493,显示屏1494,无线通信模块1460,音频模块1470,传感器模块1480等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 1410 with the camera 1493 , the display screen 1494 , the wireless communication module 1460 , the audio module 1470 , the sensor module 1480 and so on. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口1430是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口1430可以用于连接充电器为终端设备充电,也可以用于终端设备 与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端设备,例如AR设备等。The USB interface 1430 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 1430 can be used to connect the charger to charge the terminal equipment, and can also be used for the terminal equipment Transfer data to and from peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other terminal devices, such as AR devices.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备的结构限定。在本申请另一些实施例中,终端设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块1440用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块1440可以通过USB接口1430接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块1440可以通过终端设备的无线充电线圈接收无线充电输入。充电管理模块1440为电池1442充电的同时,还可以通过电源管理模块1441为终端设备供电。The charging management module 1440 is used for receiving charging input from the charger. Wherein, the charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 1440 can receive charging input from a wired charger through the USB interface 1430 . In some wireless charging embodiments, the charging management module 1440 may receive wireless charging input through a wireless charging coil of the terminal device. While the charging management module 1440 is charging the battery 1442 , it can also provide power for the terminal device through the power management module 1441 .
电源管理模块1441用于连接电池1442,充电管理模块1440与处理器1410。电源管理模块1441接收电池1442和/或充电管理模块1440的输入,为处理器1410,内部存储器1421,外部存储器,显示屏1494,摄像头1493,和无线通信模块1460等供电。电源管理模块1441还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块1441也可以设置于处理器1410中。在另一些实施例中,电源管理模块1441和充电管理模块1440也可以设置于同一个器件中。The power management module 1441 is used for connecting the battery 1442 , the charging management module 1440 and the processor 1410 . The power management module 1441 receives the input of the battery 1442 and/or the charging management module 1440, and supplies power for the processor 1410, the internal memory 1421, the external memory, the display screen 1494, the camera 1493, and the wireless communication module 1460, etc. The power management module 1441 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 1441 can also be set in the processor 1410 . In some other embodiments, the power management module 1441 and the charging management module 1440 may also be set in the same device.
终端设备的无线通信功能可以通过天线1,天线2,移动通信模块1450,无线通信模块1460,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device can be realized by the antenna 1, the antenna 2, the mobile communication module 1450, the wireless communication module 1460, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。终端设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an end device can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块1450可以提供应用在终端设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块1450可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块1450可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块1450还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块1450的至少部分功能模块可以被设置于处理器1410中。在一些实施例中,移动通信模块1450的至少部分功能模块可以与处理器1410的至少部分模块被设置在同一个器件中。The mobile communication module 1450 can provide wireless communication solutions including 2G/3G/4G/5G applied on terminal equipment. The mobile communication module 1450 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 1450 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 1450 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 1450 may be set in the processor 1410 . In some embodiments, at least part of the functional modules of the mobile communication module 1450 and at least part of the modules of the processor 1410 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器1470A,受话器1470B等)输出声音信号,或通过显示屏1494显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器1410,与移动通信模块1450或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 1470A, receiver 1470B, etc.), or displays images or videos through display screen 1494 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent of the processor 1410, and be set in the same device as the mobile communication module 1450 or other functional modules.
无线通信模块1460可以提供应用在终端设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的 解决方案。无线通信模块1460可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块1460经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器1410。无线通信模块1460还可以从处理器1410接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 1460 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), short-range wireless communication technology (near field com communication, NFC), infrared technology (infrared, IR) and other wireless communication solution. The wireless communication module 1460 may be one or more devices integrating at least one communication processing module. The wireless communication module 1460 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 1410 . The wireless communication module 1460 can also receive the signal to be sent from the processor 1410 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,终端设备的天线1和移动通信模块1450耦合,天线2和无线通信模块1460耦合,使得终端设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the terminal device is coupled to the mobile communication module 1450, and the antenna 2 is coupled to the wireless communication module 1460, so that the terminal device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division multiple access) vision code division multiple access, TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation) ation systems, SBAS).
终端设备通过GPU,显示屏1494,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏1494和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器1410可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device realizes the display function through the GPU, the display screen 1494, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 1494 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 1410 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏1494用于显示图像,视频等。显示屏1494包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备可以包括1个或N个显示屏1494,N为大于1的正整数。The display screen 1494 is used to display images, videos and the like. Display 1494 includes a display panel. The display panel can be liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting Diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the terminal device may include 1 or N display screens 1494, where N is a positive integer greater than 1.
终端设备可以通过ISP,摄像头1493,视频编解码器,GPU,显示屏1494以及应用处理器等实现拍摄功能。The terminal device can realize the shooting function through the ISP, the camera 1493, the video codec, the GPU, the display screen 1494, and the application processor.
ISP用于处理摄像头1493反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头1493中。The ISP is used to process the data fed back by the camera 1493 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 1493.
摄像头1493用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端设备可以包括1个或N个摄像头1493,N为大于1的正整数。Camera 1493 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may 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, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the terminal device may include 1 or N cameras 1493, where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal equipment selects the frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。终端设备可以支持一种或多种视频编解码器。这样,终端设备可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture  experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. An end device can support one or more video codecs. In this way, the terminal device can play or record video in various encoding formats, such as: moving picture expert group (moving picture experts group, MPEG)1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of terminal equipment can be realized through NPU, such as: image recognition, face recognition, speech recognition, text understanding, etc.
外部存储器接口1420可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备的存储能力。外部存储卡通过外部存储器接口1420与处理器1410通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 1420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 1410 through the external memory interface 1420 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器1421可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器1410通过运行存储在内部存储器1421的指令,从而执行终端设备的各种功能应用以及数据处理。内部存储器1421可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器1421可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 1421 may be used to store computer-executable program codes including instructions. The processor 1410 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 1421 . The internal memory 1421 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the terminal device. In addition, the internal memory 1421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
终端设备可以通过音频模块1470,扬声器1470A,受话器1470B,麦克风1470C,耳机接口1470D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The terminal device may implement an audio function through an audio module 1470, a speaker 1470A, a receiver 1470B, a microphone 1470C, an earphone interface 1470D, and an application processor. Such as music playback, recording, etc.
音频模块1470用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块1470还可以用于对音频信号编码和解码。在一些实施例中,音频模块1470可以设置于处理器1410中,或将音频模块1470的部分功能模块设置于处理器1410中。The audio module 1470 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 1470 may also be used to encode and decode audio signals. In some embodiments, the audio module 1470 may be set in the processor 1410 , or some functional modules of the audio module 1470 may be set in the processor 1410 .
扬声器1470A,也称“喇叭”,用于将音频电信号转换为声音信号。终端设备可以通过扬声器1470A收听音乐,或收听免提通话。Loudspeaker 1470A, also called "horn", is used to convert audio electrical signals into sound signals. The terminal device can listen to music through speaker 1470A, or listen to hands-free calls.
受话器1470B,也称“听筒”,用于将音频电信号转换成声音信号。当终端设备接听电话或语音信息时,可以通过将受话器1470B靠近人耳接听语音。Receiver 1470B, also called "earpiece", is used to convert audio electrical signals into audio signals. When the terminal device answers a phone call or voice information, it can listen to the voice by bringing the receiver 1470B close to the human ear.
麦克风1470C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风1470C发声,将声音信号输入到麦克风1470C。终端设备可以设置至少一个麦克风1470C。在另一些实施例中,终端设备可以设置两个麦克风1470C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端设备还可以设置三个,四个或更多麦克风1470C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 1470C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 1470C to make a sound, and input the sound signal to the microphone 1470C. The terminal device may be provided with at least one microphone 1470C. In other embodiments, the terminal device may be provided with two microphones 1470C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the terminal device can also be equipped with three, four or more microphones 1470C to realize sound signal collection, noise reduction, identify sound sources, and realize directional recording functions, etc.
耳机接口1470D用于连接有线耳机。耳机接口1470D可以是USB接口1430,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 1470D is used to connect wired earphones. The earphone interface 1470D may be a USB interface 1430, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器1480A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器1480A可以设置于显示屏1494。压力传感器1480A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器1480A,电极之间的电容改变。终端设备根据电容的变化确定压力的强度。当有触摸操作作用于显示屏1494,终端设备根据压力传感器1480A检测所述触摸操作强度。终端设备也可以根据压力传感器1480A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有 触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 1480A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 1480A may be located 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 be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 1480A, the capacitance between the electrodes changes. The end device determines the intensity of the pressure from the change in capacitance. When a touch operation acts on the display screen 1494, the terminal device detects the intensity of the touch operation according to the pressure sensor 1480A. The terminal device may also calculate the touched position according to the detection signal of the pressure sensor 1480A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when there is When the touch operation whose touch operation intensity is less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
陀螺仪传感器1480B可以用于确定终端设备的运动姿态。在一些实施例中,可以通过陀螺仪传感器1480B确定终端设备围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器1480B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器1480B检测终端设备抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端设备的抖动,实现防抖。陀螺仪传感器1480B还可以用于导航,体感游戏场景。The gyroscope sensor 1480B may be used to determine the motion posture of the terminal device. In some embodiments, the angular velocity of the terminal device around three axes (ie, x, y and z axes) can be determined by the gyro sensor 1480B. The gyro sensor 1480B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 1480B detects the shake angle of the terminal device, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the terminal device through reverse movement to achieve anti-shake. The gyro sensor 1480B can also be used for navigation and somatosensory game scenes.
气压传感器1480C用于测量气压。在一些实施例中,终端设备通过气压传感器1480C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 1480C is used to measure air pressure. In some embodiments, the terminal device calculates the altitude based on the air pressure value measured by the air pressure sensor 1480C to assist positioning and navigation.
磁传感器1480D包括霍尔传感器。终端设备可以利用磁传感器1480D检测翻盖皮套的开合。在一些实施例中,当终端设备是翻盖机时,终端设备可以根据磁传感器1480D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 1480D includes a Hall sensor. The terminal device can use the magnetic sensor 1480D to detect the opening and closing of the flip leather case. In some embodiments, when the terminal device is a clamshell machine, the terminal device can detect the opening and closing of the clamshell according to the magnetic sensor 1480D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器1480E可检测终端设备在各个方向上(一般为三轴)加速度的大小。当终端设备静止时可检测出重力的大小及方向。还可以用于识别终端设备的姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 1480E can detect the acceleration of the terminal device in various directions (generally three axes). When the terminal device is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device, and it can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器1480F,用于测量距离。终端设备可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端设备可以利用距离传感器1480F测距以实现快速对焦。Distance sensor 1480F, used to measure distance. The end device can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device may use the distance sensor 1480F for distance measurement to achieve fast focusing.
接近光传感器1480G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备通过发光二极管向外发射红外光。终端设备使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备附近有物体。当检测到不充分的反射光时,终端设备可以确定终端设备附近没有物体。终端设备可以利用接近光传感器1480G检测用户手持终端设备贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器1480G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 1480G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The terminal device emits infrared light through the light-emitting diode. End devices use photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device. When insufficient reflected light is detected, the terminal device may determine that there is no object near the terminal device. The terminal device can use the proximity light sensor 1480G to detect that the user holds the terminal device close to the ear to make a call, so as to automatically turn off the screen to save power. The proximity light sensor 1480G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
环境光传感器1480L用于感知环境光亮度。终端设备可以根据感知的环境光亮度自适应调节显示屏1494亮度。环境光传感器1480L也可用于拍照时自动调节白平衡。环境光传感器1480L还可以与接近光传感器1480G配合,检测终端设备是否在口袋里,以防误触。The ambient light sensor 1480L is used for sensing ambient light brightness. The terminal device can adaptively adjust the brightness of the display screen 1494 according to the perceived ambient light brightness. The ambient light sensor 1480L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 1480L can also cooperate with the proximity light sensor 1480G to detect whether the terminal device is in the pocket to prevent accidental touch.
指纹传感器1480H用于采集指纹。终端设备可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 1480H is used to collect fingerprints. The terminal device can use the collected fingerprint characteristics to unlock the fingerprint, access the application lock, take a photo with the fingerprint, answer the incoming call with the fingerprint, etc.
温度传感器1480J用于检测温度。在一些实施例中,终端设备利用温度传感器1480J检测的温度,执行温度处理策略。例如,当温度传感器1480J上报的温度超过阈值,终端设备执行降低位于温度传感器1480J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,终端设备对电池1442加热,以避免低温导致终端设备异常关机。在其他一些实施例中,当温度低于又一阈值时,终端设备对电池1442的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 1480J is used to detect temperature. In some embodiments, the terminal device uses the temperature detected by the temperature sensor 1480J to implement a temperature processing strategy. For example, when the temperature reported by the temperature sensor 1480J exceeds the threshold, the terminal device may reduce the performance of a processor located near the temperature sensor 1480J, so as to reduce power consumption and implement thermal protection. In some other embodiments, when the temperature is lower than another threshold, the terminal device heats the battery 1442 to avoid abnormal shutdown of the terminal device due to low temperature. In some other embodiments, when the temperature is lower than another threshold, the terminal device boosts the output voltage of the battery 1442 to avoid abnormal shutdown caused by low temperature.
触摸传感器1480K,也称“触控面板”。触摸传感器1480K可以设置于显示屏1494,由触摸传感器1480K与显示屏1494组成触摸屏,也称“触控屏”。触摸传感器1480K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏1494提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器 1480K也可以设置于终端设备的表面,与显示屏1494所处的位置不同。Touch sensor 1480K, also known as "touch panel". The touch sensor 1480K can be arranged on the display screen 1494, and the touch sensor 1480K and the display screen 1494 form a touch screen, also called “touch screen”. The touch sensor 1480K is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations can be provided through the display screen 1494 . In other embodiments, the touch sensor 1480K may also be arranged on the surface of the terminal device, which is different from the position where the display screen 1494 is located.
骨传导传感器1480M可以获取振动信号。在一些实施例中,骨传导传感器1480M可以获取人体声部振动骨块的振动信号。骨传导传感器1480M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器1480M也可以设置于耳机中,结合成骨传导耳机。音频模块1470可以基于所述骨传导传感器1480M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器1480M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 1480M can acquire vibration signals. In some embodiments, the bone conduction sensor 1480M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 1480M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 1480M can also be disposed in the earphone, combined into a bone conduction earphone. The audio module 1470 can analyze the voice signal based on the vibration signal of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 1480M, so as to realize the voice function. The application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 1480M, so as to realize the heart rate detection function.
按键1490包括开机键,音量键等。按键1490可以是机械按键。也可以是触摸式按键。终端设备可以接收按键输入,产生与终端设备的用户设置以及功能控制有关的键信号输入。The keys 1490 include a power key, a volume key, and the like. Key 1490 may be a mechanical key. It can also be a touch button. The terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
马达1491可以产生振动提示。马达1491可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏1494不同区域的触摸操作,马达1491也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 1491 can generate a vibrating reminder. The motor 1491 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects. The motor 1491 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 1494 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器1492可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 1492 can be an indicator light, which can be used to indicate the charging status, the change of the battery capacity, and can also be used to indicate messages, missed calls, notifications, etc.
SIM卡接口1495用于连接SIM卡。SIM卡可以通过插入SIM卡接口1495,或从SIM卡接口1495拔出,实现和终端设备的接触和分离。终端设备可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口1495可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口1495可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口1495也可以兼容不同类型的SIM卡。SIM卡接口1495也可以兼容外部存储卡。终端设备通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端设备采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端设备中,不能和终端设备分离。SIM card interface 1495 is used for connecting SIM card. The SIM card can be inserted into the SIM card interface 1495 or pulled out from the SIM card interface 1495 to achieve contact and separation with the terminal device. The terminal device can support 1 or N SIM card interfaces, and N is a positive integer greater than 1. SIM card interface 1495 can support Nano SIM card, Micro SIM card, SIM card, etc. The same SIM card interface 1495 can insert multiple cards at the same time. The types of the multiple cards may be the same or different. 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 realize functions such as calling and data communication. In some embodiments, the terminal device adopts eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the terminal device and cannot be separated from the terminal device.
终端设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明终端设备的软件结构。The software system of the terminal device may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with layered architecture is taken as an example to illustrate the software structure of the terminal device.
图15为本申请实施例的终端设备的软件结构框图。FIG. 15 is a block diagram of a software structure of a terminal device according to an embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.
应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.
如图15所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 15, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图15所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 15, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。 A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供终端设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The telephony manager is used to provide the communication function of the terminal equipment. For example, the management of call status (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
下面结合捕获拍照场景,示例性说明终端设备软件以及硬件的工作流程。In the following, the working process of the software and hardware of the terminal device will be described as an example in combination with capturing and photographing scenes.
当触摸传感器1480K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头1493捕获静态图像或视频。When the touch sensor 1480K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, and other information). Raw input events are stored at the kernel level. The application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch-click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer, starts the camera application, and then starts the camera driver by calling the kernel layer, and captures still images or videos through the camera 1493.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存 在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically stored separately. Here, two or more units may also be integrated into one unit, and the above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the aforementioned method embodiments, and details will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the above-described system embodiments are only illustrative. For example, the division of modules or units is only a logical function division. 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 implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the methods of the above-mentioned embodiments in the present application can be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to a terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Such as U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 Finally, it should be noted that: the above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (14)

  1. 一种业务协同方法,其特征在于,应用于分布式系统的第一终端设备,所述分布式系统由所述第一终端设备和第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述方法包括:A business collaboration method, characterized in that it is applied to a first terminal device of a distributed system, the distributed system is composed of the first terminal device and a second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
    对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;Adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain the adjusted heartbeat node;
    接收所述第二终端设备发送的心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;Receive a heartbeat message sent by the second terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
    根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步。Perform data synchronization with the second terminal device in combination with the adjusted heartbeat node according to the service identifier and the service running in the foreground of the first terminal device.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步,包括:The method according to claim 1, wherein the data synchronization with the second terminal device is performed according to the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node, comprising:
    根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;According to 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, at the next time corresponding to the adjusted heartbeat node, send a service message to the second terminal device, and the service message is used to perform data synchronization on the second service between the first terminal device and the second terminal device.
  3. 根据权利要求2所述的方法,其特征在于,所述在下一个所述调整后的心跳节点所对应的时刻,向所述第二终端设备发送业务报文,包括:The method according to claim 2, wherein the 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, registering a non-real-time collaborative task;
    在到达下一个所述调整后的心跳节点所对应的时刻时,触发所述非实时协同作业任务,向所述第二终端设备发送所述业务报文。When the time corresponding to the next adjusted heartbeat node is reached, the non-real-time collaborative task is triggered, and the service message is sent to the second terminal device.
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步,包括:The method according to claim 1, wherein the data synchronization with the second terminal device is performed according to the service identifier and the service running in the foreground of the first terminal device in combination with the adjusted heartbeat node, comprising:
    根据所述业务标识,确定所述第一终端设备前台运行的业务与所述第二终端设备前台运行的业务是否一致;According to 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 consistent with the first service running in the foreground of the second terminal device, sending the service message to the second terminal device, where the service message is used to perform data synchronization on the first service between the first terminal device and the second terminal device.
  5. 根据权利要求1-4任意一项所述的方法,其特征在于,在所述根据所述业务标识和所述第一终端设备前台运行的业务,结合所述调整后的心跳节点,与所述第二终端设备进行数据同步之前,所述方法还包括:The method according to any one of claims 1-4, wherein before 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 method further includes:
    对所述心跳报文的业务标识位进行提取,得到所述第一业务对应的所述业务标识。Extracting the service identification bit of the heartbeat message to obtain the service identification corresponding to the first service.
  6. 根据权利要求1-5任意一项所述的方法,其特征在于,所述对所述第一终端设备的心跳节点 和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点,包括:The method according to any one of claims 1-5, wherein the heartbeat node for the first terminal device The time corresponding to the heartbeat node of the second terminal device is adjusted to obtain the adjusted heartbeat node, including:
    接收所述第二终端设备发送的心跳节点和心跳周期;receiving the heartbeat node and the heartbeat period sent by the second terminal device;
    根据预先设置的心跳协调公式,结合所述第二终端设备发送的心跳节点和心跳周期,以及所述第一终端设备的心跳节点和心跳周期进行计算,得到所述调整后的心跳节点。According to the preset heartbeat coordination formula, the heartbeat node and the heartbeat period sent by the second terminal device are combined with the heartbeat node and the heartbeat period of the first terminal device for calculation to obtain the adjusted heartbeat node.
  7. 一种业务协同方法,其特征在于,应用于分布式系统的第二终端设备,所述分布式系统由第一终端设备和所述第二终端设备组成,所述第一终端设备和所述第二终端设备连接,所述方法包括:A business collaboration method, characterized in that it is applied to a second terminal device of a distributed system, the distributed system is composed of a first terminal device and the second terminal device, the first terminal device is connected to the second terminal device, and the method includes:
    对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点;Adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device respectively, to obtain the adjusted heartbeat node;
    在所述调整后的心跳节点所对应的时刻,向所述第一终端设备发送心跳报文,所述心跳报文包括业务标识,所述业务标识用于指示所述第二终端设备前台运行的第一业务;At the moment corresponding to the adjusted heartbeat node, send a heartbeat message to the first terminal device, where the heartbeat message includes a service identifier, and the service identifier is used to indicate the first service running in the foreground of the second terminal device;
    根据所述第一终端设备发送的业务报文,与所述第一终端设备进行数据同步。Perform data synchronization with the first terminal device according to the service message sent by the first terminal device.
  8. 根据权利要求7所述的方法,其特征在于,所述向所述第一终端设备发送心跳报文,包括:The method according to claim 7, wherein the sending a heartbeat message to the first terminal device comprises:
    确定所述第二终端设备前台运行的业务所对应的业务标识;determining the service identifier corresponding to the service running in the foreground of the second terminal device;
    根据所述业务标识生成所述心跳报文;generating the heartbeat message according to the service identifier;
    向所述第一终端设备发送所述心跳报文。Send the heartbeat message to the first terminal device.
  9. 根据权利要求8所述的方法,其特征在于,所述确定所述第二终端设备前台运行的业务所对应的业务标识,包括:The method according to claim 8, wherein the determining the service identifier corresponding to the service running in the foreground of the second terminal device comprises:
    根据所述第一业务触发的举手动作,确定所述第一业务在所述第二终端设备前台运行;According to the hand-raising action triggered by the first service, determine that the first service is running in the foreground of the second terminal device;
    获取所述第一业务对应的业务标识。Obtain the service identifier corresponding to the first service.
  10. 根据权利要求7-9任意一项所述的方法,其特征在于,所述根据所述第一终端设备发送的业务报文,与所述第一终端设备进行数据同步,包括:The method according to any one of claims 7-9, wherein the performing data synchronization with the first terminal device according to the service message sent by the first terminal device includes:
    接收所述第一终端设备发送的业务报文,所述业务报文用于在所述第一终端设备与所述第二终端设备之间,对第二业务进行数据同步;receiving a service message sent by the first terminal device, where the service message is used to perform data synchronization on a second service between the first terminal device and the second terminal device;
    根据所述业务报文,与所述第一终端设备针对所述第二业务进行数据同步。Perform data synchronization with the first terminal device for the second service according to the service message.
  11. 根据权利要求7-10任意一项所述的方法,其特征在于,所述对所述第一终端设备的心跳节点和所述第二终端设备的心跳节点分别对应的时刻进行调整,得到调整后的心跳节点,包括:The method according to any one of claims 7-10, wherein the adjusting the time corresponding to the heartbeat node of the first terminal device and the heartbeat node of the second terminal device to obtain the adjusted heartbeat node includes:
    向所述第一终端设备发送所述第二终端设备的心跳节点和心跳周期;sending the heartbeat node and the heartbeat cycle of the second terminal device to the first terminal device;
    接收所述第一终端设备发送的绝对时间,并与所述第一终端设备同步所述绝对时间,所述绝对时间表示开机时长;receiving the absolute time sent by the first terminal device, and synchronizing the absolute time with the first terminal device, where the absolute time represents the boot time;
    接收所述第一终端设备发送的计算得到的最佳心跳周期;receiving the calculated optimal heartbeat period sent by the first terminal device;
    根据所述最佳心跳周期和同步后的绝对时间,得到所述调整后的心跳节点。The adjusted heartbeat node is obtained according to the optimal heartbeat period and the synchronized absolute time.
  12. 一种电子设备,其特征在于,包括:处理器,所述处理器用于运行存储器中存储的计算机 程序,以使得所述电子设备实现如权利要求1至6或权利要求7至11中任意一项所述的业务协同方法。An electronic device, characterized in that it includes: a processor, the processor is used to run the computer stored in the memory A program, so that the electronic device implements the business collaboration method according to any one of claims 1-6 or 7-11.
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至6或权利要求7至11中任意一项所述的业务协同方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the business collaboration method according to any one of claims 1 to 6 or claims 7 to 11 is implemented.
  14. 一种芯片系统,其特征在于,所述芯片系统包括存储器和处理器,所述处理器执行所述存储器中存储的计算机程序,以实现如权利要求1至6或权利要求7至11中任意一项所述的业务协同方法。 A chip system, characterized in that the chip system includes a memory and a processor, and the processor executes the computer program stored in the memory, so as to realize the service collaboration method according to any one of claims 1 to 6 or claims 7 to 11.
PCT/CN2023/072365 2022-01-22 2023-01-16 Service collaboration method, electronic device, readable storage medium, and chip system WO2023138533A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210075719.6 2022-01-22
CN202210075719.6A CN116528337A (en) 2022-01-22 2022-01-22 Business collaboration method, electronic device, readable storage medium, and chip system

Publications (1)

Publication Number Publication Date
WO2023138533A1 true WO2023138533A1 (en) 2023-07-27

Family

ID=87347842

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/072365 WO2023138533A1 (en) 2022-01-22 2023-01-16 Service collaboration method, electronic device, readable storage medium, and chip system

Country Status (2)

Country Link
CN (1) CN116528337A (en)
WO (1) WO2023138533A1 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
US20130031565A1 (en) * 2011-07-28 2013-01-31 Sap Ag Managing consistent interfaces for a product design version hierarchy business object across heterogeneous systems
CN104243527A (en) * 2013-06-20 2014-12-24 华为技术有限公司 Data synchronization method and device and distributed system
CN105991720A (en) * 2015-02-13 2016-10-05 阿里巴巴集团控股有限公司 Configuration change method and device
CN106157129A (en) * 2015-04-17 2016-11-23 阿里巴巴集团控股有限公司 One realizes distributed system across time domain coherence method and device
CN109408224A (en) * 2018-09-17 2019-03-01 华为技术有限公司 Method of data synchronization, distributed system and application node
CN109861922A (en) * 2019-02-21 2019-06-07 北京百度网讯科技有限公司 Method and apparatus for controlling flow
CN112417052A (en) * 2020-12-03 2021-02-26 腾讯科技(深圳)有限公司 Data synchronization method, device, equipment and storage medium in block chain network
CN112532753A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Data synchronization method, device, medium and electronic equipment of block chain system
US11159455B1 (en) * 2018-12-28 2021-10-26 Innovium, Inc. Reducing power consumption in an electronic device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
US20130031565A1 (en) * 2011-07-28 2013-01-31 Sap Ag Managing consistent interfaces for a product design version hierarchy business object across heterogeneous systems
CN104243527A (en) * 2013-06-20 2014-12-24 华为技术有限公司 Data synchronization method and device and distributed system
CN105991720A (en) * 2015-02-13 2016-10-05 阿里巴巴集团控股有限公司 Configuration change method and device
CN106157129A (en) * 2015-04-17 2016-11-23 阿里巴巴集团控股有限公司 One realizes distributed system across time domain coherence method and device
CN109408224A (en) * 2018-09-17 2019-03-01 华为技术有限公司 Method of data synchronization, distributed system and application node
US11159455B1 (en) * 2018-12-28 2021-10-26 Innovium, Inc. Reducing power consumption in an electronic device
CN109861922A (en) * 2019-02-21 2019-06-07 北京百度网讯科技有限公司 Method and apparatus for controlling flow
CN112417052A (en) * 2020-12-03 2021-02-26 腾讯科技(深圳)有限公司 Data synchronization method, device, equipment and storage medium in block chain network
CN112532753A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Data synchronization method, device, medium and electronic equipment of block chain system

Also Published As

Publication number Publication date
CN116528337A (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN110191442B (en) Bluetooth connection method, equipment and system
WO2020259452A1 (en) Full-screen display method for mobile terminal, and apparatus
WO2022257977A1 (en) Screen projection method for electronic device, and electronic device
WO2020143380A1 (en) Data transmission method and electronic device
WO2021185141A1 (en) Wi-fi aware link establishment method and system, electronic device, and storage medium
WO2020077512A1 (en) Voice communication method, electronic device, and system
US20230189366A1 (en) Bluetooth Communication Method, Terminal Device, and Computer-Readable Storage Medium
CN112492193B (en) Method and equipment for processing callback stream
WO2021043046A1 (en) Resource management and control method and device
WO2021104104A1 (en) Energy-efficient display processing method, and apparatus
WO2020056684A1 (en) Method and device employing multiple tws earpieces connected in relay mode to realize automatic interpretation
CN112181616B (en) Task processing method and related device
WO2023005282A9 (en) Message pushing method and apparatus
EP4033341A1 (en) Always on display method and mobile device
WO2022262492A1 (en) Data downloading method and apparatus, and terminal device
WO2020134868A1 (en) Connection establishment method, and terminal apparatus
WO2022252972A1 (en) Window display method and electronic device
EP4280596A1 (en) Video call method and related device
US20240098354A1 (en) Connection establishment method and electronic device
WO2023138533A1 (en) Service collaboration method, electronic device, readable storage medium, and chip system
CN115022807A (en) Express delivery information reminding method and electronic equipment
CN114827098A (en) Method and device for close shooting, electronic equipment and readable storage medium
WO2023160205A1 (en) Method for controlling process, and electronic device and readable storage medium
WO2024067037A1 (en) Service calling method and system, and electronic device
WO2023020420A1 (en) Volume display method, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23742848

Country of ref document: EP

Kind code of ref document: A1