Connection method and device
By establishing a near-field connection between the watch and a device and using routing headers and protocol headers to achieve accurate forwarding of notifications, the problem of synchronizing messages between the watch and multiple devices is solved, improving the flexibility and efficiency of cross-device communication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2026-04-24
AI Technical Summary
When a user adds a new device, existing technology struggles to synchronize messages between the watch and multiple devices, especially when the watch cannot simultaneously support Bluetooth and eSIM capabilities, making it impossible to establish communication connections with multiple mobile phones at the same time.
By establishing a near-field connection between the watch and one device, and a far-field connection between the watch and another device, the accurate forwarding and processing of notifications is achieved using routing headers and protocol headers, ensuring that messages can be synchronized to the watch from multiple devices.
It enables message synchronization between the watch and multiple devices, simplifies the cross-device transmission process, and improves the flexibility and efficiency of communication.
Smart Images

Figure CN121924628A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a connection method and apparatus. Background Technology
[0002] With the increasing variety and number of electronic devices, users have a higher demand for cross-device content transfer. Currently, two devices can establish a communication connection via Bluetooth or other methods to transfer content across devices.
[0003] For example, if a user owns both a watch and a mobile phone (A), the watch can establish a communication connection with mobile phone A. Mobile phone A can then transmit call messages, step counts, meeting messages, and other information to the watch, enabling message synchronization between the two devices. However, when a user adds a new device (such as mobile phone B), how to synchronize messages from mobile phone B to the watch remains a problem to be solved. Summary of the Invention
[0004] This application provides a connection method and apparatus, applied in the field of terminal technology. This method enables communication between a watch and multiple devices, overcoming the limitations of typical watch-to-device communication. For example, the multiple devices may include mobile phone A and mobile phone B. Mobile phone A and the watch can establish a near-field connection, and mobile phone A and mobile phone B can establish a far-field connection. This allows mobile phone A to send messages to the watch, and mobile phone B to forward messages to the watch via mobile phone A, enabling the watch to receive messages from both devices and simplifying cross-device transmission between multiple devices.
[0005] In a first aspect, embodiments of this application propose a connection method applied to a connection system, the connection system including: a first device, a second device, and a third device. The method includes: when the first device establishes a first communication connection with the second device and a second communication connection with the third device: when the third device sends a first notification to the first device, in response to receiving the first notification, the first device sends a first notification to the second device, and the first notification is sent by either the third device or the first device while carrying a first routing header, the first routing header indicating that the destination device is the second device and indicating that the origin device is the third device; when the third device sends a second notification to the first device, in response to receiving the second notification, the first device processes the second notification, the second notification not including the first routing header.
[0006] The first device can be mobile phone A, the second device can be a watch, and the third device can be mobile phone B.
[0007] In this way, when the first device, the second device, and the third device establish a connection, the first device can determine whether to forward the notification or process it locally based on the routing header carried in the received notification, so that the notification can be accurately sent to the appropriate device.
[0008] Optionally, before the third device sends the first notification to the first device, the method further includes: the third device creating a first routing table, the first routing table including: information that the destination device is the second device, information that the next-hop device is the first device, the connection type between the third device and the first device, and the address of the first device; the third device creating a first protocol header based on the first routing table, the third device sending the first notification to the first device carrying the first protocol header, the first protocol header including: the connection type between the third device and the first device, and the address of the third device.
[0009] Understandably, in order to ensure that data can be correctly sent to the destination device via the next-hop device, the device can create a routing table 1. The information recorded in the routing table can be used by the device to generate a protocol header, so that the first notification can be sent to the first device via the third device.
[0010] Optionally, before the first device sends the first notification to the second device, the method further includes: the first device creating a second protocol header, wherein the first device sends the first notification to the second device along with the second protocol header, the second protocol header including: the connection type between the first device and the second device, and the address of the first device.
[0011] Thus, since the first notification needs to be relayed through the first device before being sent to the second device, the first device can generate a second protocol header to send the first notification to the second device.
[0012] Optionally, the first routing header may also include a preset field, which is used to parse the destination device and the origin device from the routing header 1. In this way, electronic devices can ensure security when parsing the routing header by setting the preset field.
[0013] Optionally, before the first device sends the first notification to the second device, the method further includes: the first device setting the first notification in a receive queue and allocating a first thread; the first device sending the first notification to the second device includes: the first device sending the first notification to the second device through the first thread. In this way, the first device can reduce blocking on the main thread by allocating threads, allowing the main thread to perform other processing steps.
[0014] Optionally, after the first device sends a first notification to the second device, the method further includes: in response to receiving the first notification, the second device processes the first notification and generates a third notification corresponding to the first notification; the second device sends the third notification to the first device; in response to receiving the third notification, the first device sends the third notification to the third device, carrying a second routing header when the second device or the third device sends the third notification, the second routing header indicating that the destination device is the third device and the originating device is the second device. In this way, the second device can also, through the routing header settings, send the third notification to the third device via the first device, thereby achieving the forwarding of the third notification.
[0015] Optionally, in response to receiving the first notification, the method further includes: the second device deleting the first routing header; the second device creating a second routing table, the second routing table including: information that the destination device is the third device, information that the next-hop device is the first device, the connection type between the second device and the first device, and the address of the first device; the second device creating a third protocol header based on the second routing table, wherein the second device sends the third notification to the first device along with the third protocol header, the third protocol header including: the connection type between the second device and the first device, and the address of the first device. In this way, the second device can delete the first routing header and create the third protocol header required for sending the third notification before generating a new routing header, thereby enabling the third notification to be sent to the first device.
[0016] Optionally, before the first device sends the third notification to the third device, the method further includes: the first device creating a fourth protocol header, wherein the first device sends the third notification to the third device while carrying the fourth protocol header, the fourth protocol header including: the connection type between the first device and the third device, and the address of the first device.
[0017] Optionally, after the first device establishes a first communication connection with the second device, the method further includes: the second device setting the first device as its master device; after the first device establishes a second communication connection with the third device, the method further includes: the first device sending a first message to the second device through the first communication connection, wherein the first message is a message indicating that the third device has been detected; and in response to the first message, the second device setting the third device as its slave device. Thus, in scenarios where multiple devices communicate, the devices can determine the data forwarding method through the settings of the master and slave devices, improving the limitations of communication between multiple devices.
[0018] Optionally, after the second device sets the third device as a slave device of the second device, the method further includes: the second device sending a second message to the first device based on the first communication connection, the second message being a message indicating that the third device is set as a slave device of the second device; and the first device sending a first notification to the second device, including: upon receiving the second message, the first device sending a first notification to the second device. In this way, when the second device sets the third device as a slave device, the second device can promptly synchronize the message indicating that the third device is set as a slave device to the first device, enabling the first device to detect that the third device is online.
[0019] Optionally, the method further includes: when the first device detects that the second device is offline, the first device disconnects the second device, deletes the record related to the first routing table, and sends a message indicating that the second device is offline to the third device based on the second communication connection; in response to receiving the message indicating that the second device is offline, the third device disconnects the second device and deletes the record related to the first routing table. In this way, regardless of whether any of the first, second, or third devices is offline, other devices can detect the offline status and perform the steps of disconnecting the device and deleting the routing record information, thereby saving power consumption in subsequent service processing.
[0020] Optionally, scenarios where the second device is offline include: the second device being restored to factory settings, and / or the second device disconnecting from the first device's first communication connection.
[0021] Optionally, the method further includes: when the third device detects that the first device is offline, the third device disconnects both the first device and the second device and deletes the records related to the first routing table.
[0022] Optionally, the method further includes: when the first device detects that the third device is offline, the first device disconnects the third device, deletes the record related to the first routing table, and sends a message to the second device that the third device is offline based on the first communication connection; in response to receiving the message that the third device is offline, the second device disconnects the third device.
[0023] Optionally, the first communication connection is a near-field connection, and the second communication connection is either a near-field connection or a far-field connection. The near-field connection includes a Bluetooth connection or a wireless LAN connection, and the far-field connection includes a connection based on a cloud-side device.
[0024] Optionally, the second device is a watch.
[0025] Secondly, embodiments of this application provide a connection method applied to a first device. The method includes: when the first device establishes a first communication connection with a second device and a second communication connection with a third device: when the first device receives a first notification from the third device, in response to receiving the first notification, the first device sends a first notification to the second device, and the first device carries a first routing header while receiving or sending the first notification, the first routing header indicating that the destination device is the second device and indicating that the origin device is the third device; when the first device receives a second notification from the third device, in response to receiving the second notification, the first device processes the second notification, the second notification not including the first routing header.
[0026] In this way, when the first device, the second device, and the third device establish a connection, the first device can determine whether to forward the notification or process it locally based on the routing header carried in the received notification, so that the notification can be accurately sent to the appropriate device.
[0027] Thirdly, embodiments of this application provide a connection device, which can be an electronic device, or a chip or chip system within an electronic device. The connection device may include a display unit and a processing unit. When the connection device is an electronic device, the display unit may be a display screen. The display unit is used to perform display steps to enable the electronic device to implement a connection method described in the first aspect or any possible implementation of the first aspect. When the connection device is an electronic device, the processing unit may be a processor. The connection device may further include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a connection method described in the first aspect or any possible implementation of the first aspect. When the connection device is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a connection method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.), or a storage unit located outside the chip within the electronic device (e.g., a read-only memory, random access memory, etc.).
[0028] Thirdly, embodiments of this application provide an electronic device, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0029] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the first aspect or any possible implementation thereof.
[0030] Fifthly, embodiments of this application provide a computer program product including a computer program. When the computer program product includes computer program code, when the computer program code is run on an electronic device, the electronic device performs the method described in the first aspect or any possible implementation of the first aspect.
[0031] Sixthly, this application provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0032] In one possible implementation, the chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip system, such as a register or cache, or it can be a storage unit of the chip system itself (e.g., read-only memory, random access memory, etc.).
[0033] It should be understood that the second to sixth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0034] Figure 1 A scenario diagram provided for an embodiment of this application;
[0035] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0036] Figure 3A A schematic diagram of the software structure of a mobile phone provided in an embodiment of this application;
[0037] Figure 3B A schematic diagram of the software structure of a watch provided in an embodiment of this application;
[0038] Figure 4A A schematic diagram illustrating the principle of a single-meter dual-machine system provided in this application embodiment;
[0039] Figure 4B This application provides a schematic diagram of module interaction for establishing a connection between two machines using a single table, as illustrated in an embodiment of the present application.
[0040] Figure 5 A schematic diagram of the interface of a watch provided in an embodiment of this application;
[0041] Figure 6 This application provides a schematic diagram of module interaction for routing configuration in an embodiment of the present application.
[0042] Figure 7 This application provides a schematic diagram of the module interaction for sending notification 1 from mobile phone B to watch, as shown in an embodiment of the present application.
[0043] Figure 8 This application provides a schematic diagram of a module interaction for sending notification 2 from mobile phone B to mobile phone A, as shown in an embodiment of the present application.
[0044] Figure 9 This application provides a schematic diagram of module interaction for an offline device.
[0045] Figure 10 A schematic diagram illustrating a connection method provided in an embodiment of this application;
[0046] Figure 11 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0047] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0048] 1. Trust loop
[0049] A trust ring is a technical solution based on an identity authentication system that enables trusted interconnection of multiple devices across systems, allowing services or messages to flow and be shared among multiple devices. In scenarios where device connections are established based on a trust ring, electronic devices can authenticate themselves by logging into the same device account.
[0050] For example, Device 1 can send an account authentication request to Device 2 via broadcast or other means. The account authentication request can include Device 1's device account 1. Upon receiving Device 1's device account 1, Device 2 can log in to Device 1 and return a message indicating successful account synchronization to Device 1. At this point, Device 1 and Device 2 can complete device authentication. In this scenario, Device 1 can display the interface corresponding to the trust ring, which can display Device 2's icon.
[0051] After successful device authentication, Device 1 and Device 2 can be in the same trust ring. When Device 1, which is logged into the device account, approaches Device 2 again, Device 1 and Device 2 can automatically establish a network connection based on the trust ring and realize communication under the trust ring.
[0052] It is understood that the embodiments of this application do not specifically limit the scenario for establishing a communication connection between two devices. For example, multiple devices logged into the same device account can establish a communication connection through near-field or far-field communication. After the connection is successfully established, the multiple devices logged into the same device account can be in the same trust ring. Any electronic device in the trust ring can display all electronic devices in the trust ring.
[0053] 2. One form, two machines
[0054] A watch can be understood as a single wristwatch, while two mobile phones can be understood as two separate mobile phones. In a watch-two-phone scenario, the wristwatch can connect to two mobile phones (phone A and phone B) simultaneously. The wristwatch can receive messages from both phones and can also send messages to each phone.
[0055] In this embodiment, the watch in the dual-device system can be replaced with other wearable devices, and the dual devices can also include other electronic devices besides mobile phones, such as tablets or laptops. This application does not limit this.
[0056] It is understood that the connection method provided in this application embodiment can also be applied to a scenario where a watch is connected to multiple mobile phones. The specific implementation process is similar to that of a watch with two devices, and will not be described in detail below.
[0057] 3. Device account
[0058] A device account can be an identifier that records user identity information, which may include: username, user avatar, user permissions to access network resources and files, etc.
[0059] The relationship between a device account and an electronic device is not one-to-one. For example, a user can log in to the same device account on multiple electronic devices, or a user can switch between different device accounts on one electronic device.
[0060] By registering and logging into a device account, electronic devices can use a variety of functions linked to that account. For example, an electronic device logged into its account can perform functions such as device search, cloud storage, and application downloads, and multiple electronic devices logged into the same account can synchronize data between devices.
[0061] 4. Other terms
[0062] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0063] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0064] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0065] 5. Electronic equipment
[0066] The electronic devices in this application embodiment may include handheld devices with communication functions, vehicle-mounted devices, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptops, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, etc., and this application embodiment is not limited to these.
[0067] By way of example and not limitation, in this embodiment, the electronic device may also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that are intelligently designed and developed using wearable technology, such as glasses, gloves, watches, clothing, and shoes.
[0068] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.
[0069] The following is combined Figure 1 The corresponding embodiments illustrate the use case of one meter with two machines, but these examples do not constitute a limitation on the embodiments of this application.
[0070] Understandably, due to the limitations of the watch's communication capabilities, it may not be able to simultaneously support Bluetooth and embedded subscriber identity module (ESIM) capabilities. Therefore, the watch and two mobile phones can be connected via... Figure 1 A- Figure 1 The three scenarios described in C describe the establishment of communication connections.
[0071] Bluetooth enables near-field connectivity between the watch and the device, while ESIM enables far-field connectivity. ESIM can be understood as the communication capabilities supported by ESIM, such as internet access.
[0072] like Figure 1 As shown in Figure A, when the watch's Bluetooth capability is enabled, the watch can establish a near-field connection with phone A, and the watch can receive messages sent by phone A. However, when phone B is present in the scene, the watch cannot establish a Bluetooth connection with phone B, and therefore cannot receive messages sent by phone B.
[0073] In this scenario, the watch does not support dual-channel Bluetooth, so the watch cannot receive messages from multiple mobile phones (such as phone A and phone B) at the same time.
[0074] In view of this, embodiments of this application provide a connection method. When the watch's Bluetooth capability is enabled, the watch can establish a near-field connection with mobile phone A, and mobile phone A can establish a far-field connection or a long-range connection with mobile phone B. This allows the watch to receive not only messages sent by mobile phone A, but also messages forwarded by mobile phone B via mobile phone A. See [link to relevant documentation]. Figure 1 B and Figure 1 The description in C.
[0075] like Figure 1As shown in Figure B, the watch and phone A can establish a near-field connection via Bluetooth Basic Rate (BR), Bluetooth Low Energy (BLE), or Wireless Local Area Networks (WLAN), while phone B and phone A can establish a far-field connection through the device cloud. In this case, phone A can simultaneously enable Bluetooth and eSIM capabilities. Due to limitations in the watch's communication capabilities, phone B can communicate indirectly with the watch through phone A. For example, phone A can forward data between phone B and the watch.
[0076] In this scenario, the watch and phone A can be devices located within the same area, while phone B can be located remotely. For example, a user could bring the watch and phone A to the office, while phone B remains at home.
[0077] like Figure 1 As shown in Figure C, the watch and phone A can establish a near-field connection via BR or BLE, and phone B and phone A can also establish a near-field connection via BR, BLE, or WLAN. In this case, phone A supports dual-channel Bluetooth, meaning phone A can connect to both the watch and phone B via Bluetooth. Due to limitations in the watch's communication capabilities, phone B can communicate indirectly with the watch through phone A.
[0078] In this scenario, the watch, phone A, and phone B can all be devices located within the same area. For example, the user might bring the watch, phone A, and phone B to the office.
[0079] based on Figure 1 B- Figure 1 In the device connection method described in C, when identity authentication is completed between the watch, mobile phone A, and mobile phone B, the watch, mobile phone A, and mobile phone B can be understood as being within the same trust ring.
[0080] It should be noted that, Figure 1 B- Figure 1 The near-field connection methods (such as Bluetooth connection) and far-field connection methods (such as device cloud connection) mentioned in C are only illustrative and do not constitute a limitation on the embodiments of this application.
[0081] It is understood that the connection method provided in the embodiments of this application may not be limited to... Figure 1 The scenario described herein. For example, when mobile phone A establishes a connection with a watch, mobile phone A can establish a connection with multiple devices (such as mobile phone B). Any of the multiple devices can send data to the watch through mobile phone A, or the watch can also send data to any of the multiple devices through mobile phone A. This application does not limit this aspect in its embodiments.
[0082] To better understand the embodiments of this application, the structure of the electronic device according to the embodiments of this application is described below. For example, Figure 2 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0083] Electronic devices may include the watches, mobile phones A or B described in the embodiments of this application. The hardware structures contained in each device may be the same or different, and this embodiment of the application does not limit this.
[0084] The electronic device may include a processor 110, internal memory 121, universal serial bus (USB) interface 130, antenna 2, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, SIM 191, and display screen 194, etc.
[0085] The sensor module 180 may include sensors such as a touch sensor. The touch sensor may be located on the display screen 194, and the touch sensor and the display screen 194 together form a touchscreen. The touch sensor is used to receive user trigger operations on the touchscreen.
[0086] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0087] The processor 110 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. The processor 110 may also include a memory for storing instructions and data. For example, the processor 110 may store instructions and data related to a connection method provided in an embodiment of this application.
[0088] USB interface 130 is an interface that conforms to the USB standard specification, specifically it can be a Mini USB interface, Micro USB interface, USB Type C interface, etc.
[0089] The wireless communication module 160 can provide solutions for wireless communication applications in electronic devices, such as WLAN (e.g., wireless fidelity, Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR).
[0090] In such Figure 1 In the scenario shown in Figure A, the wireless communication module 160 in the watch can establish far-field connections with mobile phone A and mobile phone B, respectively. In such a scenario... Figure 1 In the scenario shown in B, the wireless communication module 160 in the watch can achieve a near-field connection with mobile phone A. In such a scenario... Figure 1 In the scenario shown in C, the wireless communication module 160 in the watch can achieve a near-field connection with mobile phone A, and the wireless communication module 160 in mobile phone A can achieve a near-field connection with mobile phone B.
[0091] The SIM291 can be embedded in electronic devices. Electronic devices can have a SIM card interface, and the SIM card can be inserted into or removed from the SIM card interface to achieve contact and separation with the electronic device. The SIM card can be understood as a physical card.
[0092] Optionally, when the electronic device is a watch, the SIM291 can also be replaced with an ESIM.
[0093] Electronic devices utilize GPUs, displays (194), and application processors to achieve display functions. The GPU is a microprocessor for image processing, connecting the displays (194) and the application processor.
[0094] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. For example, the display screen 194 in a watch can enable... Figure 5 A- Figure 5 Interface display in C.
[0095] The software systems of electronic devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which will not be elaborated here.
[0096] When the electronic device is a mobile phone Figure 3A This is a schematic diagram of the software structure of a mobile phone provided in an embodiment of this application.
[0097] The software architecture of the mobile phone can be the same as that of mobile phone A, or it can be the same as that of mobile phone B. The software architecture of mobile phone A and mobile phone B can be the same or different, and this application embodiment does not limit this.
[0098] like Figure 3A As shown, the layered architecture of a mobile phone divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into multiple layers, from top to bottom: the application (APP) layer, the application framework (FWK) layer, and the driver layer, etc. This application embodiment does not impose any limitations on this.
[0099] The application layer may include a series of application packages. The application layer may include one or more of the following: sports and health, YOYO suggestions, service display framework, control center, super notification, and collaborative unlock, etc., but this application embodiment does not limit the scope of these applications.
[0100] Sports and health applications may include a sports and health software development kit (SDK). The sports and health SDK enables data interaction between the sports and health application and the agent service module; it can also be understood as a client for the agent service module.
[0101] Applications such as the service display framework, super notification, and collaborative unlock can be understood as target applications that support the trust ring business. These target applications can enable data transmission in a dual-machine scenario with a single table.
[0102] The control center can manage devices within the trust ring. For example, users can open the control center to view devices within the trust ring and perform functions such as adding or deleting devices within the trust ring.
[0103] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer.
[0104] The application framework layer includes some predefined interfaces, such as one or more of the following: proxy service module, device connection module, Bluetooth module, or business module.
[0105] The proxy service module can be used to forward received data, such as forwarding received data to other devices via Bluetooth.
[0106] In the dual-device scenario provided in this application embodiment, due to limitations in the watch's communication capabilities, the watch may not simultaneously support Bluetooth and eSIM capabilities. If the watch supports Bluetooth, the proxy service module in the mobile phone can send data related to sports and health applications, trust loop services, and YOYO recommendations to the watch via the Bluetooth channel. This simplifies the data transmission process in the dual-device scenario while expanding the application scenarios of the solution.
[0107] The proxy service module may include a Bluetooth connection module. The Bluetooth connection module can be used for Bluetooth-related services within the proxy service, such as proxying and forwarding Bluetooth data. The proxy service module may also include other functional modules, but this embodiment does not limit this.
[0108] The device connection module may include: a device management module, an access networking module, and a data transmission module.
[0109] The device management module can be used to manage the online or offline status of devices. It can also send online or offline messages to business modules, allowing these modules to be aware of the device status.
[0110] In the dual-device scenario provided in this application embodiment, the device connection module in the mobile phone can be used to handle data transmission in either far-field or near-field scenarios. When the mobile phone's device connection module includes an access network module and a data transmission module, when the mobile phone detects the need to send a notification to another device, the data transmission module in the mobile phone can call the `opensession()` method to create a session and send the notification in the session to the other device through the access network module. This other device can be in a near-field connection or a far-field connection with the mobile phone.
[0111] For example, when mobile phone A and watch are in a near-field connection, the data transmission module in mobile phone A can call the opensession() method to create a session and send the notifications in the session to the watch's access network module through the access network module in mobile phone A.
[0112] Alternatively, when phone A and watch are in a far-field connection, the data transmission module in the phone can also call the opensession() method to create a session and send the notifications in the session to the device cloud through the access network module in phone A. The device cloud can then send the notifications to the watch's access network module.
[0113] Meanwhile, a device management module can be set up in the device connection module of the mobile phone. The device management module in the mobile phone can uniformly manage the online or offline status of the device, or the connection type of the mobile phone with other devices (such as near field connection or far field connection).
[0114] In this way, mobile phones can simplify the service access cost in near-field or far-field scenarios by setting the device connection module. Regardless of whether the data is in a near-field or far-field scenario, the device connection module can create a session by calling the opensession() method and realize the transmission of data in the session.
[0115] The access networking module can also create routing information and enable data interaction with other devices based on that routing information. The access networking module may include a connection module.
[0116] The data transmission module can be used to enable data interaction with other devices. The data transmission module may include a session module, which can be used to call interfaces to create sessions.
[0117] The Bluetooth module can be used to enable Bluetooth communication with other devices.
[0118] The business module can be used to sense the online or offline status of any device and determine whether a certain business can be executed based on the online or offline status of the device.
[0119] In possible implementations, FWK may also include a display compositor, window manager, content provider, resource manager, view system, or notification manager, etc. Figure 3A (Not shown in the image).
[0120] The driver layer is the layer between hardware and software. It is used to drive the hardware, enabling it to function. For example, the driver layer may include one or more of the following: sensor driver, display driver, or Bluetooth driver, etc.
[0121] Sensor drivers are used to drive sensor hardware to perform functions such as data acquisition; display drivers are used to drive displays to perform functions such as interface display; Bluetooth drivers are used to drive Bluetooth devices to perform functions such as Bluetooth transmission.
[0122] It is understood that the embodiments of this application do not specifically limit the software layers involved in the software architecture, the modules contained in the software layers, and the functions of the modules.
[0123] When the electronic device is a watch Figure 3B This is a schematic diagram of the software structure of a watch provided in an embodiment of this application.
[0124] Figure 3BIt can be understood as a lightweight operating system (or simply liteOS).
[0125] It is understandable that the software modules in a watch can be presented in a layered manner, such as... Figure 3B The structure shown, or the software modules in the watch, may not necessarily present a layered architecture; this application does not limit this.
[0126] like Figure 3B As shown, the watch's layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android mobile system is divided into multiple layers, from top to bottom: the application (APP) layer, the application framework (FWK) layer, and the driver layer, etc. This application embodiment does not impose such limitations.
[0127] The application layer may include a series of application packages. The application layer may include one or more of the following: sports and health, collaborative unlocking, and control center applications, etc., but this application embodiment does not limit this.
[0128] Applications such as collaborative unlocking can be understood as applications that support trust ring services.
[0129] The control center can be used to manage connected devices, such as a watch that can display connected devices and near-field devices obtained from mobile phone A.
[0130] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer.
[0131] The application framework layer includes predefined interfaces, such as one or more of the following: Bluetooth module, device management module, service module, and account management module. The access networking module may include a connectivity module, and the data transmission module may include a session module.
[0132] The account management module can be used to manage device accounts logged in to the watch. For example, the account management module can synchronize device accounts based on account synchronization requests.
[0133] The functionality of other modules in the application framework layer can be combined with... Figure 3A The functions of the mobile phone module are similar, so they will not be described in detail here.
[0134] In possible implementations, FWK may also include a display compositor, window manager, content provider, resource manager, view system, or notification manager, etc. Figure 3B (Not shown in the image).
[0135] The driver layer is the layer between hardware and software. It drives the hardware to function. For example, the driver layer may include one or more of the following: display driver, sensor driver, and Bluetooth driver, etc. The function of each module can be found in [link to relevant documentation]. Figure 3A The description in the text.
[0136] It is understood that the embodiments of this application do not specifically limit the software layers involved in the software architecture, the modules contained in the software layers, and the functions of the modules.
[0137] Combination Figures 3A-3B The description of the software architecture in this application is followed by a detailed explanation of the technical solution and how it solves the aforementioned technical problems, using specific embodiments. These specific embodiments can be implemented independently or in combination with each other. Similar or identical concepts or processes may not be described again in some embodiments.
[0138] The following is combined Figure 1 The scenario shown in C illustrates the process of establishing a connection between the watch, phone A, and phone B, setting phone A as the master phone and phone B as the slave phone. (See also...) Figure 4A as well as Figure 4B The description in the text.
[0139] Understandable, Figure 1 In scenario B, the process of establishing a connection between the watch, phone A, and phone B can be compared with... Figures 4A-4B Similar to the description in the text, it will not be repeated hereafter.
[0140] like Figure 1 In the scenario shown in C, once a communication connection is established between the watch and phone A, the watch can set phone A as the primary phone and synchronize messages from phone A as the primary phone to a device cloud. The process of establishing a communication connection between the watch and phone A will not be detailed here.
[0141] like Figure 4A As shown, the specific process may include the following steps:
[0142] ① Phone A can detect that phone B is online in a near-field scenario. For example, phone A can establish a connection with phone B and detect that phone B is online on phone A, and phone A can view phone B's information in the device list.
[0143] Optionally, phone A can also detect the online status of phone B via device cloud. After phone A detects phone B,
[0144] Mobile phone A can execute the description in ②.
[0145] ②Mobile phone A can send a list of devices, including mobile phone B, to the watch.
[0146] ③ In response to user actions on the watch, the watch can set phone B as a slave to the phone.
[0147] ④ The watch can set phone B to send messages from phone B to the device cloud via phone A. For example, the watch can set phone B to send messages from phone B to phone A, and phone A can set phone B to send messages from phone B to the device cloud.
[0148] ⑤ The device cloud can set up phone B to synchronize messages from phone B.
[0149] The following detailed explanation, using the corresponding embodiment of 4B, describes the process of establishing a communication connection, setting the master phone, and setting the slave phone between mobile phone A, mobile phone B, and the watch.
[0150] Figure 4B This is a schematic diagram illustrating the module interaction for establishing a connection between two machines using a single table, as provided in an embodiment of this application. Figure 4B In a corresponding embodiment, the connection process may involve mobile phone A, mobile phone B, a device cloud, and a watch. Mobile phone A may include an access networking module and a device management module; mobile phone B may include an access networking module and a device management module; and the watch may include an access networking module, a device management module, and a control center.
[0151] like Figure 4B As shown, the connection process may include the following steps:
[0152] The S400 and watch access networking modules establish a communication connection with the access networking module of mobile phone A.
[0153] S401. When the watch's access network module detects that mobile phone A has established a communication connection with the watch, the watch's access network module sends a message that mobile phone A is online to the watch's device management module.
[0154] The message indicating that phone A has gone online may include: the device ID of phone A. The device ID can also be: a unique device identifier (UDID), which will not be discussed further below.
[0155] After S401, the watch's device management module can set the device status of mobile phone A to online and continue to send the online message of mobile phone A to the watch's business module, so that all the business in the watch can be aware of the existence of mobile phone A.
[0156] S402, The device management module of the watch sets mobile phone A as identifier 1, updates the watch's preset configuration information, and obtains preset configuration information 1.
[0157] Identifier 1 can be the identifier of the main mobile phone (or host).
[0158] The default configuration information may include: the device ID of the master phone and / or the device ID of the slave phone.
[0159] In the preset configuration information 1, the device ID of the main mobile phone is the device ID of mobile phone A.
[0160] Understandably, after the watch's device management module receives the message that mobile phone A has come online, the watch's device management module can determine that mobile phone A is the first device to establish a connection with the watch, and then the watch's device management module can execute S402.
[0161] S403, The device management module of the watch sends preset configuration information 1 to the device management module of mobile phone A.
[0162] S404, The device management module of mobile phone A sends preset configuration information 1 to the device cloud.
[0163] S405, Device Cloud Storage Preset Configuration Information 1.
[0164] It is understandable that if the watch has eSIM capability, it can directly send messages to the device cloud; or, if the watch does not have eSIM capability, it can send messages to mobile phone A, which will then forward the messages to the device cloud, as described in S403-S405. This application does not limit the method by which the watch has eSIM capability in this embodiment.
[0165] S406. The access network module of mobile phone A can send a device discovery request to the access network module of mobile phone B.
[0166] Device discovery requests can be used to query electronic devices in near-field scenarios. Device discovery requests may include: the MAC address of mobile phone A, the identifier of mobile phone A (such as the device ID of mobile phone A), the device type of mobile phone A (such as mobile phone), etc.
[0167] For example, the access network module of mobile phone A can periodically send device discovery requests to electronic devices in the near field. Electronic devices in the near field of mobile phone A (such as mobile phone B) can receive the device discovery request and then execute the steps shown in S407.
[0168] It is understandable that the access network module of mobile phone A can send a device discovery request to the access network module of mobile phone B via the Bluetooth modules of mobile phone A and mobile phone B. To simplify the process of data interaction, the modules involved will not be described further.
[0169] S407. The access networking module of mobile phone B returns the scan results to the access networking module of mobile phone A.
[0170] The scan results may include: the MAC address of mobile phone B, the identifier of mobile phone B (such as the device ID of mobile phone B), the device type of mobile phone B (such as mobile phone), etc.
[0171] Accordingly, after the access network module of mobile phone A receives the scan results, mobile phone A can display the detected mobile phone B on its display. Furthermore, after S407, mobile phone B can also display the detected mobile phone A on its display.
[0172] After S407, mobile phone A and mobile phone B can establish a communication connection. For example, mobile phone A and mobile phone B can perform steps such as device binding and account authentication. After the connection between mobile phone A and mobile phone B is established, mobile phone A can detect changes in online devices (such as detecting that mobile phone B is online), thereby obtaining a device list and sending the device list with mobile phone B to the watch.
[0173] S408, The access network module of mobile phone A obtains the device list of mobile phone A.
[0174] The device list may include: electronic devices that establish a connection with mobile phone A in a near-field scenario, or it can be understood as a list of devices that are online in mobile phone A in a near-field scenario, such as mobile phone B, etc.
[0175] S409, the access networking module of mobile phone A sends the device list of mobile phone A to the control center of the watch.
[0176] For example, the access networking module of mobile phone A can send the device list of mobile phone A to the control center of the watch through the access networking module of the watch and the device management module of the watch.
[0177] The S410 watch's control center displays a list of devices from phone A on its screen.
[0178] For example, a watch can display such as Figure 5 The interface shown in A, Figure 5A can display: the identifier of the connected device, such as identifier 501 of mobile phone A, and the identifier of at least one available device, such as identifier 502 of mobile phone B.
[0179] When the watch sets phone A as the master phone based on S402, the master phone identifier 503 (such as the word "master") can be displayed around the identifier 501, while the slave phone identifier is not displayed around the identifier 502 for the time being.
[0180] S411. In response to the user setting mobile phone B as a slave phone, the watch's control center sends a message to the watch's device management module that mobile phone B is set as a slave phone.
[0181] The message from phone B can include: the device ID of phone B.
[0182] For example, in response to user requests Figure 5 Clicking on identifier 502 in A will cause the watch to display the following... Figure 5 The interface shown in B. Figure 5 Phone B may display a pop-up window 504, which prompts the user whether to set phone B as a slave device. Pop-up window 504 may include a cancel button and a confirm button 505.
[0183] In response to user requests Figure 5 Clicking the confirmation button 505 in B allows the watch's control center to send a message to the watch's device management module indicating that phone B is set to be a slave phone, and the watch can display something like this. Figure 5 The interface shown in C. The operation to set phone B as a slave phone can be as follows: The user can then... Figure 5 Clicking the confirmation button 505 in B.
[0184] Figure 5 C can display the identifiers of connected devices, such as identifier 501 for phone A and identifier for phone B. When the watch sets phone B as a slave phone based on S411 and S412, identifier 502 can temporarily display the slave phone's identifier 506 (e.g., "secondary phone").
[0185] S412, the device management module of the watch sets mobile phone B as identifier 2, updates the watch's preset configuration information, and obtains preset configuration information 2.
[0186] Identifier 2 can be an identifier from the mobile phone (or secondary phone).
[0187] In the preset configuration information 2, the device ID of the master phone is the device ID of phone A, and the device ID of the slave phone is the device ID of phone B.
[0188] Optionally, after S412, the watch's device management module can set the device ID from the mobile phone in a whitelist. This whitelist can then include the device ID of mobile phone B. Furthermore, the whitelist can be synchronized to the device cloud along the paths shown in S413-S415, and also synchronized to mobile phone B along the paths shown in S413 and S416-S417, where mobile phone B stores the whitelist.
[0189] Understandably, since phone B can be the second device detected by the watch, the watch's device management module can set phone B to a different identifier than phone A, namely identifier 2.
[0190] Optionally, when the watch detects devices other than phone B (such as phone C and phone D), in response to the user's operation of setting phone C and phone D as slave phones, the watch can also sequentially execute the steps of setting phone C as identifier 2 and then setting phone D as identifier 2, according to the order in which the devices were detected. In this case, phone C is the watch's second slave phone, and phone D can be the watch's third slave phone.
[0191] S413, The device management module of the watch sends preset configuration information 2 to the device management module of mobile phone A.
[0192] After S413, the device management module of mobile phone A can execute the steps shown in S414 and S416.
[0193] S414, The device management module of mobile phone A sends preset configuration information 2 to the device cloud.
[0194] S415, Device cloud storage preset configuration information 2.
[0195] S416. The device management module of mobile phone A sends a message from the watch to mobile phone B to the access networking module of mobile phone A.
[0196] S417. The access network module of mobile phone A sends a message that the watch is online to the access network module of mobile phone B.
[0197] Following S417, the access network module of mobile phone B executes the steps shown in S418. It can be understood that the access network module of mobile phone B receives the message that the watch is online, but at this time, mobile phone B and the watch have not yet established a communication connection. Therefore, mobile phone B cannot temporarily change the watch's device status to online. Subsequently, mobile phone B and the watch can establish a connection based on S418-S421, and then mobile phone B can notify the device management module to change the watch's online status.
[0198] It should be noted that after S417, data can be forwarded between mobile phone B and the watch via mobile phone A. The data forwarding processes in S418-S421 described below are all implemented through mobile phone A, and will not be repeated hereafter for the sake of simplicity in the accompanying diagrams and descriptions.
[0199] Specifically, S417 may include the steps shown in S601-S603.
[0200] S418, the access networking module of mobile phone B sends a device connection request to the access networking module of the watch.
[0201] The device connection request can be used to establish a communication connection between mobile phone B and the watch. The device connection request may include: the MAC address of mobile phone B, and the device capabilities supported by mobile phone B (or simply device capability 4), such as whether it supports the ability to use Protocol 1 (such as hichain) authentication, and / or whether it supports the ability to use trust rings, etc.
[0202] Accordingly, the watch's access network module can negotiate device capabilities based on device capability 4 and the device capabilities supported by the watch (or simply device capability 2), and return the negotiated device capability 3 to mobile phone B through the device authentication success message sent in S419.
[0203] Specifically, S418 can include: S604-S610.
[0204] S419. The watch's access network module sends a message to the mobile phone B's access network module that the device has successfully connected.
[0205] The message indicating a successful device connection may include: the watch's MAC address, and device capability 2, etc.
[0206] Specifically, S419 can include: S611-S615.
[0207] The S420 and mobile phone B's access networking module send a device authentication request to the watch's access networking module.
[0208] Device authentication requests can be used to request the watch to store authentication keys. For example, a device authentication request may include: the device ID of phone B and an authentication key (such as a HiChain key). Accordingly, the watch can store the authentication key.
[0209] S421, The watch's access network module sends a message indicating successful device authentication to the access network module of mobile phone B.
[0210] The message indicating successful device authentication may include the watch's device ID and authentication key.
[0211] It is understandable that S418-S421 can be understood as part of the process of establishing a communication connection between mobile phone B and the watch. The process of establishing and testing the connection channel between mobile phone B and the watch can be found in [reference needed]. Figure 6 The description in the text will not be repeated here.
[0212] S422, The access networking module of mobile phone B sends a message that the watch is online to the device management module of mobile phone B.
[0213] After S422, the device management module of mobile phone B can set the watch's device status to online. Furthermore, the device management module of mobile phone B can send a message indicating that the watch is online to the business modules of mobile phone B, enabling all services within mobile phone B to be aware of the watch's presence.
[0214] S423, The watch's access network module sends a message to the watch's device management module that mobile phone B has come online.
[0215] After S423, the watch's device management module can set the device status of phone B to online. Furthermore, the watch's device management module can send a message indicating that phone B is online to the watch's service modules, enabling all services within the watch to be aware of phone B's presence.
[0216] Due to the limited communication capabilities of smartwatches, this application embodiment can be combined with the dual-device scenario described in Figure 4. When the smartwatch establishes a communication connection with mobile phone A based on Bluetooth capability, mobile phone B can send data to the smartwatch via mobile phone A, or the smartwatch can also send data to mobile phone B via mobile phone A, thereby achieving the effect of communication between the smartwatch and multiple devices.
[0217] During the process of establishing a communication connection between mobile phone B and the watch, both mobile phone B and the watch can be configured with routing settings to enable data exchange between them. The following section will illustrate this process. Figure 6 The corresponding implementation example illustrates the routing configuration process for mobile phone B and the watch respectively.
[0218] Figure 6 This is a schematic diagram illustrating the module interaction of a routing configuration provided in an embodiment of this application. Figure 6 In a corresponding embodiment, the routing configuration process involves mobile phone B, mobile phone A, and a watch. Mobile phone B may include a device management module, an access networking module, and a connection module. Mobile phone A may include a connection module, and the watch may include a connection module and a device management module.
[0219] like Figure 6 As shown, the route configuration process may include the following steps:
[0220] S601, the connection module of mobile phone A sends a message that the watch is online to the connection module of mobile phone B.
[0221] The notification message for the watch's launch may include a whitelist, which can be used to store device IDs from mobile phones. For example, if a user sets mobile phone B as a slave device, the whitelist may include the device ID of mobile phone B.
[0222] After S601, the connection module of mobile phone B can perform the steps shown in S602 and S603.
[0223] S602, the connection module of mobile phone B returns a response message to the connection module of mobile phone A.
[0224] S603, the connection module of mobile phone B sends a message that the watch is online to the access networking module of mobile phone B.
[0225] The steps shown in S601-S603 above can correspond to S417 in Figure 4.
[0226] S604. If mobile phone B supports networking capabilities and its device ID is included in the whitelist, the access networking module of mobile phone B creates routing table 1.
[0227] The routing table can be used to store: the device ID of the destination device, the device ID of the next-hop device, the connection type between the origin address and the next-hop device, and the address of the next-hop device. The next-hop device can also be called an intermediate device or a proxy device. In the case of mobile phone A as the next-hop device, the origin device can send messages to the destination device via the next-hop device.
[0228] For example, routing table 1 may include: the device ID of the watch, the device ID of mobile phone A, the connection type between mobile phone A and mobile phone B, and the address of mobile phone A, etc.
[0229] Specifically, when the connection type between mobile phone A and mobile phone B is a BR connection or a BLE connection, the address of mobile phone B is its MAC address; or, when the connection type between mobile phone A and mobile phone B is a WLAN connection, the address of mobile phone B is its IP address.
[0230] S605, the access networking module of mobile phone B generates message 1 based on the device information of mobile phone B.
[0231] The device information for phone B may include: phone B's device ID. Message 1 can also be understood as a message used to test whether the connection between phone B and the watch has been successfully established.
[0232] For example, mobile phone B can send message 1 to the watch, and after receiving message 1, the watch can send message 2 related to message 1 back to mobile phone B. Mobile phone B and the watch can exchange their device IDs through messages 1 and 2, realizing the first data interaction after establishing a communication connection. In this embodiment, the content of message 1 is not limited. The content of message 2 can be found in the description in S614, and will not be repeated here.
[0233] S606, Mobile Phone B's access network module creates route header 1.
[0234] The routing header can include path information of data sent from the originating device to the destination device; the routing header can also be called routing information. For example, the routing header can include path information of data sent from mobile phone B to the watch, or path information of data sent from the watch to mobile phone B, etc.
[0235] If mobile phone B determines that it is the originating device, the routing header 1 can include path information for sending data from mobile phone B to the watch. For example, the routing header 1 can include: the device identifier of the destination device (such as the device ID of the watch) and the device identifier of the originating device (such as the device ID of mobile phone B).
[0236] Optionally, the routing header 1 may also include a preset field. This preset field can be used to parse the destination and origin devices in the routing header 1. For example, the preset field can be any field composed of letters and data. For instance, after receiving the preset field in the routing header 1, mobile phone A or a watch can parse it from the routing header 1. N bytes in the routing header 1 can be used to indicate the device identifier of the destination device, and M bytes can be used to indicate the device identifier of the origin device. M and N can be the same or different. Thus, by setting a preset field in the routing header 1, the security of the routing header transmission can be improved.
[0237] It is understandable that, even if the default fields are not included in the routing header 1, the device identifiers of the destination device and the origin device can also be set in the routing header 1 in plaintext. This allows the device receiving the routing header 1 to determine the contents of the routing header 1 without having to parse it through specific fields, thereby improving the speed of parsing the routing header.
[0238] S607, the access networking module of mobile phone B generates protocol header 1 based on routing table 1.
[0239] The protocol header may include information related to the originating device. For example, protocol header 1 may include: the connection type between mobile phone A and mobile phone B, and the address of mobile phone B. The connection type between mobile phone A and mobile phone B can be obtained from routing table 1.
[0240] Optionally, prior to S608, the connection module of mobile phone B can determine whether mobile phone A and mobile phone B have previously established a connection. If the connection module of mobile phone B determines that mobile phone A and mobile phone B have previously established a connection, mobile phone B can execute the steps shown in S608; or, if the connection module of mobile phone B determines that mobile phone A and mobile phone B have not previously established a connection, mobile phone B can send a connection establishment message to the connection module of mobile phone A to re-establish a connection with mobile phone A. The connection establishment request may include: Protocol Header 1 and Routing Header 1.
[0241] S608, the access networking module of mobile phone B sends protocol header 1, routing header 1 and message 1 to the connection module of mobile phone A.
[0242] For example, the access networking module of mobile phone B can send protocol header 1, routing header 1 and message 1 to the connection module of mobile phone A through the connection module of mobile phone B.
[0243] After the access network module of mobile phone B sends Protocol Header 1, Routing Header 1, and Message 1, the access network module of mobile phone B can record routing record information related to Routing Header 1 and Protocol Header 1, such as sending time, Routing Header 1, and Protocol Header 1. Accordingly, the connection module of the mobile phone can send Protocol Header 1, Routing Header 1, and Message 1 to the access network module of mobile phone A. After the access network module of mobile phone A receives Protocol Header 1, Routing Header 1, and Message 1, the access network module of mobile phone A can also record routing record information related to Routing Header 1 and Protocol Header 1, such as receiving time, Routing Header 1, and Protocol Header 1.
[0244] S609, the connection module of mobile phone A determines that mobile phone A is not the endpoint device based on the router header 1.
[0245] It is understandable that the connection module of mobile phone A can parse routing header 1. In routing header 1, the destination device can be a watch. Therefore, the connection module of mobile phone A can determine that mobile phone A is not the destination device. That is, the connection module of mobile phone A can continue to send message 1 to the destination device (i.e., the watch), and then mobile phone A can execute S610.
[0246] It is understandable that if the connection module of mobile phone A receives and parses the routing header 1, mobile phone A can determine that message 1 is data that needs to be forwarded. If the connection module of mobile phone A does not receive and parse the routing header 1, mobile phone A can determine that message 1 should be processed.
[0247] Optionally, if the routing header 1 includes a preset field, the connection module of mobile phone A can parse the routing header 1 based on the preset field, and mobile phone A can determine that message 1 can be data that needs to be forwarded; or, if the routing header 1 does not include a preset field, the connection module of mobile phone A can parse the routing header 1 based on the preset field, and mobile phone A can determine to process message 1.
[0248] In some embodiments, when the routing header 1 includes a preset field, mobile phone A can determine whether to process message 1 simply by judging the preset field, without parsing the device information in the routing header 1. For example, if mobile phone A detects that the routing header 1 includes a preset field, mobile phone A can determine that message 1 is data that needs to be forwarded; or, if mobile phone A detects that the routing header 1 does not include a preset field, mobile phone A can determine that message 1 is data that needs to be processed locally. In this way, mobile phone A can reduce the power consumption waste caused by parsing the routing header 1 and improve the efficiency of message transmission.
[0249] It is understood that the capabilities of the preset fields are not specifically limited in the embodiments of this application.
[0250] S610, the connection module of mobile phone A generates protocol header 2.
[0251] For example, header 2 may include: the connection type between mobile phone A and the watch, and the address of mobile phone A. The connection type between mobile phone A and the watch can be stored when the communication connection is established between mobile phone A and the watch.
[0252] S611, the connection module of mobile phone A sends protocol header 2, routing header 1 and message 1 to the connection module of watch.
[0253] Specifically, after the access network module of mobile phone A sends protocol header 2, routing header 1, and message 1, the connection module of mobile phone A can record routing information related to routing header 1 and protocol header 2, such as sending time, routing header 1, and protocol header 2. Similarly, after the access network module of the watch receives protocol header 2, routing header 1, and message 1, the watch's access network module can also record routing information related to routing header 1 and protocol header 2, such as receiving time, routing header 1, and protocol header 2.
[0254] S612, Remove router header 1 from the watch's connection module.
[0255] When the watch's connection module receives protocol header 2, routing header 1, and message 1, the watch's connection module can parse routing header 1. If the destination device can be the watch in routing header 1, then the watch's connection module can determine that the watch is the destination device, that is, the watch's connection module can execute S612.
[0256] Understandably, if the watch's connection module receives and parses the routing header 1, the watch can determine to process message 1.
[0257] Optionally, if the routing header 1 includes a preset field, the watch's connection module can parse the routing header 1 based on the preset field. If the watch is found to be the destination device after parsing the routing header 1, the watch can determine to process message 1. At this time, message 1 can be understood as data forwarded to the watch via mobile phone A, and then the watch executes the steps shown in S612.
[0258] Alternatively, if the default field is not included in the routing header 1, the watch's connection module can determine that message 1 is a message sent by the main mobile phone (i.e., mobile phone A), and the watch can determine to process message 1. In this case, the watch does not need to perform subsequent steps such as S612.
[0259] In some embodiments, when the routing header 1 includes a preset field, the watch can determine whether to process message 1 simply by judging the preset field, without parsing the device information in the routing header 1. For example, if the watch detects that the routing header 1 includes a preset field, it can determine that a response to message 1 is required; or, if the watch detects that the routing header 1 does not include a preset field, it can determine that message 1 is a normal message, and no response is needed. This reduces the power consumption wasted on parsing the routing header 1 and improves message transmission efficiency.
[0260] S613, The watch's connection module creates routing table 2.
[0261] The routing table 2 may include: the device ID of mobile phone B, the device ID of mobile phone A, the connection type between mobile phone A and the watch, and the address of mobile phone A, etc.
[0262] Specifically, when the connection type between mobile phone A and the watch is BR or BLE, the watch's address is its MAC address; or, when the connection type between mobile phone A and the watch is WLAN, the watch's address is its IP address.
[0263] S614, The watch's connection module generates message 2 based on the watch's device information.
[0264] The watch's device information may include the watch's device ID. Message 2 can also be understood as a message used to test whether the connection between the watch and mobile phone B has been successfully established.
[0265] S615, the watch's connection module creates routing header 2, and generates protocol header 3 based on routing table 2.
[0266] The routing header 2 may include: the device identifier of the destination device (such as the device ID of mobile phone B) and the device identifier of the origin device (such as the device ID of a smartwatch).
[0267] Optionally, the routing header 2 may also include a preset field. The contents of the preset field and the effect of the preset field can be found in the description in S606, and will not be repeated here.
[0268] For example, header 3 may include: the connection type between mobile phone A and the watch, and the address of the watch. The connection type between mobile phone A and the watch is obtained from routing table 2.
[0269] S616, the watch's connection module sends protocol header 3, routing header 2, and message 2 to the connection module of mobile phone A.
[0270] Optionally, after the watch's access network module sends protocol header 3, routing header 2, and message 2, the watch's connection module can record routing information related to routing header 2 and protocol header 3, such as sending time, routing header 2, and protocol header 3. Alternatively, after mobile phone A's access network module receives protocol header 3, routing header 2, and message 2, mobile phone A's access network module can also record routing information related to routing header 2 and protocol header 3, such as receiving time, routing header 2, and protocol header 3.
[0271] S617, The connection module of mobile phone A determines that mobile phone A is not the endpoint device based on the router header 2.
[0272] It is understandable that the connection module of mobile phone A can parse routing header 2. In routing header 2, the destination device can be mobile phone B. Therefore, the connection module of mobile phone A can determine that mobile phone A is not the destination device. That is, the connection module of mobile phone A can continue to send packet 2 to the destination device (i.e., mobile phone B), and then mobile phone A can execute S618.
[0273] It is understandable that if the connection module of mobile phone A receives and parses the routing header 2, mobile phone A can determine that message 2 is data that needs to be forwarded. If the connection module of mobile phone A does not receive and parse the routing header 2, mobile phone A can determine that message 2 should be processed.
[0274] Optionally, if the routing header 2 includes a preset field, the connection module of mobile phone A can parse the routing header 2 based on the preset field, and mobile phone A can determine that message 2 can be data that needs to be forwarded; or, if the routing header 2 does not include a preset field, the connection module of mobile phone A can parse the routing header 2 based on the preset field, and mobile phone A can determine to process message 2.
[0275] In some embodiments, when the routing header 2 includes a preset field, mobile phone A can determine whether to process message 2 simply by judging the preset field, without parsing the device information in the routing header 2. For example, if mobile phone A detects that the routing header 2 includes a preset field, mobile phone A can determine that message 2 is data that needs to be forwarded; or, if mobile phone A detects that the routing header 2 does not include a preset field, mobile phone A can determine that message 2 is data that needs to be processed locally. In this way, mobile phone A can reduce the power consumption waste caused by parsing the routing header 2 and improve the efficiency of message transmission.
[0276] S618, the connection module of mobile phone A generates protocol header 4.
[0277] For example, header 4 may include: the connection type between mobile phone A and mobile phone B, and the address of mobile phone A. The connection type between mobile phone A and mobile phone B can be stored when mobile phone A and mobile phone B establish a communication connection.
[0278] S619, the connection module of mobile phone A sends protocol header 4, routing header 2 and message 2 to the access networking module of mobile phone B.
[0279] For example, the connection module of mobile phone A can send protocol header 4, routing header 2 and message 2 to the access networking module of mobile phone B through the connection module of mobile phone B.
[0280] After the access network module of mobile phone A sends protocol header 4, routing header 2, and message 2, the connection module of mobile phone A can record routing information related to routing header 2 and protocol header 4, such as the sending time, routing header 2, and protocol header 4. Correspondingly, after the access network module of mobile phone B receives protocol header 4, routing header 2, and message 2, the access network module of the watch can also record routing information related to routing header 2 and protocol header 4, such as the receiving time, routing header 2, and protocol header 4.
[0281] It is understandable that the S605-S619 can perform test procedures between mobile phone B, mobile phone A, and the watch.
[0282] Optionally, after S619, a device authentication process can be performed between mobile phone B and the watch. This process can include: mobile phone B and the watch exchanging authentication key materials, and both mobile phone B and the watch generating authentication keys based on these materials. If an error occurs during the device authentication process between mobile phone B and the watch, mobile phone B can re-initiate the authentication process after a period of time. If mobile phone B determines that the number of re-initiations is greater than or equal to 3, it can record the error and report it to the system.
[0283] Optionally, if an error occurs during the device authentication process between mobile phone B and the watch, mobile phone B can switch to other connection methods and re-initiate the device authentication process with the watch.
[0284] The steps shown in S604-S619 above can correspond to S417-S418 in the figure.
[0285] S620, the watch's access network module removes router header 2.
[0286] S621, The access networking module of mobile phone B sends a message that the watch is online to the device management module of mobile phone B.
[0287] Accordingly, after receiving the watch's online status message, the device management module of phone B can update the watch's device status to online. Furthermore, the device management module of phone B can send the watch's online status message to the relevant business modules, ensuring that all business modules are aware of the watch's online status. Subsequently, phone B's business modules can perform specific business operations through the watch. For example, when the business module is a calling application, phone B's calling application can send received calls to the watch after sensing that the watch is online.
[0288] Optionally, the access network module of mobile phone B can set the watch as identifier 3, where identifier 3 can be an identifier for heterogeneous devices. For example, in... Figure 1 B or Figure 1 In the scenario shown in C, when a message sent from phone B to the watch needs to be forwarded through another device (such as phone A), phone B can set the watch to flag 3.
[0289] S621 can correspond to S422 in Figure 4.
[0290] S622, The watch's access network module sends a message to the watch's device management module that mobile phone B has come online.
[0291] Accordingly, after the watch's device management module receives the message that phone B has come online, it can update phone B's device status to online. Furthermore, the watch's device management module can send the phone B online message to relevant business modules, ensuring that all business modules are aware that the watch is online.
[0292] S622 can correspond to S423 in Figure 4.
[0293] Optionally, the watch's access network module can set mobile phone B as identifier 3. The meaning of identifier 3 can be found in the description in S622, and will not be repeated here.
[0294] based on Figure 6As described, when mobile phone B and watch establish a connection through mobile phone A, mobile phone B needs to create a routing header 1 to send data to the watch via mobile phone A, and the watch needs to create a routing header 2 to send data to mobile phone B via mobile phone A, so that mobile phone B and watch can achieve accurate data interaction through routing header 1 and routing header 2.
[0295] Based on Figure 4, a communication connection is established between mobile phone A, mobile phone B, and the watch, and based on... Figure 6 With routing configuration completed in the communication connection, when mobile phone B receives notification 1, mobile phone B can... Figure 6 The pathway shown sends notification 1 to the watch, meaning notification 1 in phone B can be sent to the watch via phone A.
[0296] Following S621 and S622 (or S422 and S423), the following is combined with Figure 7 The corresponding embodiment illustrates the process of mobile phone B sending notification 1 to the watch when it receives notification 1.
[0297] Figure 7 This is a schematic diagram illustrating the module interaction of a mobile phone B sending a notification 1 to a watch, as provided in an embodiment of this application. Figure 7 In the corresponding embodiments, mobile phone B may include a service module, a session module, an access network module, and a connection module; mobile phone A may include a connection module; and the watch may include a connection module, a session module, and a service module.
[0298] like Figure 7 As shown, the process of mobile phone B sending notification 1 to watch may include the following steps:
[0299] S701. When the service module of mobile phone B detects notification 1, the service module of mobile phone B sends a message that notification 1 has been detected to the session module of mobile phone B.
[0300] Notification 1 can be understood as a message related to the watch, which may include the watch's device ID.
[0301] For example, notification 1 could be a health data notification or an SMS notification. If notification 1 is a health data notification, the business module could be the fitness and health application on phone A; or, if notification 1 is an SMS notification, the business module could be the SMS application on phone A.
[0302] S702, the service module of mobile phone B sends a routing header query request to the access networking module of mobile phone B.
[0303] A routing information query request can be used to request the routing headers required to send data from phone B to the watch. The routing header query request may include the watch's device ID.
[0304] For example, the service module of mobile phone B can query routing information from the access network module of mobile phone B by calling the searchrouting() method. The searchrouting() method can include the device ID of the watch.
[0305] Adaptably, the access networking module of mobile phone B can query the routing header 1 based on the device ID of the watch.
[0306] S703, The access networking module of mobile phone B returns route header 1 to the session module of mobile phone B.
[0307] Following S703, mobile phone B, mobile phone A, and the watch can execute the test procedure. The test procedure can be found in steps S605-S619; the specific process will not be repeated here. The test procedure can be used to test the connectivity between mobile phone B and mobile phone A, as well as the connectivity between mobile phone A and the watch.
[0308] S704, Mobile B's session module returns a message indicating that the connection has been successfully established.
[0309] S705, the session module of mobile phone B creates session 1.
[0310] For example, the session module of mobile phone B can create session 1 by calling opensession().
[0311] S706, Mobile B's session module sends a message indicating successful session establishment to Mobile B's access network module.
[0312] The message indicating a successful session establishment may include: the identifier of Session 1, and Notification 1.
[0313] The S707 and mobile phone B's access networking module generate message 3 based on notification 1.
[0314] Message 3 can be understood as a message generated after encapsulating notification 1.
[0315] S708, the access networking module of mobile phone B sends protocol header 1, routing header 1 and message 3 to the connection module of mobile phone A.
[0316] Protocol header 1 can be generated by the access networking module of mobile phone B in S607, and routing header 1 can be generated by the access networking module of mobile phone B in S606.
[0317] For example, the access network module of mobile phone B can send protocol header 1, routing header 1, and message 3 to the connection module of mobile phone A via the connection module of mobile phone B. When mobile phone B's access network module receives or sends protocol header 1, routing header 1, and message 3, it can record routing record information related to routing header 1 and protocol header 1. Similarly, when mobile phone A's access network module receives protocol header 1, routing header 1, and message 3, it can record routing record information related to routing header 1 and protocol header 1.
[0318] S709, the connection module of mobile phone A determines that mobile phone A is not the endpoint device based on router header 1.
[0319] For example, the method by which the connection module of mobile phone A determines that mobile phone A is not the endpoint device can be found in the description in S609, and will not be repeated here.
[0320] After S709 and before S710, the connection module of mobile phone A can set message 3 into the receive queue, and then the connection module of mobile phone A can allocate thread 1. The receive queue can be used to temporarily store data received by the connection module of mobile phone A, such as message 3, and thread 1 can be used to run the steps shown in S710.
[0321] In this way, when mobile phone A determines that it needs to send data, mobile phone A can create thread 1. The newly created thread 1 can be used to implement the step of sending message 3 in S710, so that the main thread can perform other processing steps to reduce the blocking of the main thread.
[0322] S710, the connection module of mobile phone A sends protocol header 2, routing header 1 and message 3 to the connection module of watch.
[0323] Protocol packet 2 can be generated in S610 by the connection module of mobile phone A.
[0324] When the access network module of mobile phone A sends protocol header 2, routing header 1, and message 3, it can record routing information related to routing header 1 and protocol header 2. Similarly, when the access network module of the watch receives protocol header 2, routing header 1, and message 3, it can record routing information related to routing header 1 and protocol header 2.
[0325] S711, the watch's connection module deletes routing header 1 and parses notification 1 from message 3.
[0326] For instructions on deleting the contents of routing header 1 from the watch's connection module, please refer to the description in S612.
[0327] S712, The watch's connection module sends notification 1 to the watch's business module.
[0328] For example, the watch's connection module can send a notification to the watch's business module via the watch's session module.
[0329] Based on the descriptions in S710-S712, when the watch's connection module receives protocol header 2, routing header 1, and message 3, the watch's connection module can parse routing header 1. If the destination device in routing header 1 can be the watch, then the watch's connection module can determine that the watch is the destination device, meaning the watch's connection module can execute S711.
[0330] Understandably, if the watch's connection module receives and parses the routing header 1, the watch can determine to process message 3, such as by executing S712.
[0331] Optionally, if the routing header 1 includes a preset field, the watch's connection module can parse the routing header 1 based on the preset field. If the watch is found to be the destination device after parsing the routing header 1, the watch can determine to process message 3. At this time, message 3 can be understood as data forwarded to the watch via mobile phone A, and then the watch executes the steps shown in S712.
[0332] Alternatively, if the default field is not included in the routing header 1, the watch's connection module can determine that message 3 is a message sent by the main mobile phone (i.e., mobile phone A), and the watch can determine to process message 3. In this case, the watch does not need to perform subsequent steps such as S715.
[0333] In some embodiments, when the routing header 1 includes a preset field, the watch can determine whether to process message 3 simply by judging the preset field, without parsing the device information in the routing header 1. For example, if the watch detects that the routing header 1 includes a preset field, it can determine that a response to message 3 is required; or, if the watch detects that the routing header 1 does not include a preset field, it can determine that message 3 is a normal message, and no response is required. This reduces the power consumption wasted on parsing the routing header 1 and improves message transmission efficiency.
[0334] S713, Watch business module processing notification 1.
[0335] For example, when Notification 1 is an SMS notification, the watch's business module can display Notification 1 in the notification bar or display it as a pop-up window; or, when Notification 1 is a health data notification, the watch's business module can update the health data in the sports and health application.
[0336] S714, The watch's business module sends a response message to the watch's connection module.
[0337] For example, the watch's business module can send response messages to the watch's connection module via the watch's session module.
[0338] S715, the watch's connection module generates message 4 based on the response message.
[0339] Message 4 can be a message generated after encapsulating the response message.
[0340] S716, the watch's connection module sends protocol header 3, routing header 2, and message 4 to the connection module of mobile phone A.
[0341] Protocol header 3 can be generated in S615 by the watch's connection module, and routing header 2 can be generated in S612 by the watch's connection module.
[0342] S717, the connection module of mobile phone A determines that mobile phone A is not the end device based on the router header 2.
[0343] The process by which the connection module of mobile phone A determines that mobile phone A is not the endpoint device based on the routing header 2 can be found in the description in S617.
[0344] Optionally, after S717 and before S718, the connection module of mobile phone A can set message 4 into the receive queue, and then the connection module of mobile phone A can allocate thread 2. Thread 2 can be used to run the steps shown in S718.
[0345] S718, the connection module of mobile phone A sends protocol header 4, routing header 2 and message 4 to the access networking module of mobile phone B.
[0346] Protocol header 4 can be generated in S618 by the connection module of mobile phone A.
[0347] For example, the connection module of mobile phone A can send protocol header 4, routing header 2 and message 4 to the access networking module of mobile phone B through the connection module of mobile phone B.
[0348] When the access network module of mobile phone A sends protocol header 4, routing header 2, and message 4, it can record routing record information related to routing header 2 and protocol header 4. Correspondingly, when the access network module of mobile phone B receives protocol header 4, routing header 2, and message 4, it can also record routing record information related to routing header 2 and protocol header 4.
[0349] S719 and mobile phone B's access network module delete routing header 2 and parse the response message from message 4.
[0350] The process of deleting route header 2 from the access network module of mobile phone B can be found in the description in S620.
[0351] S720, the access networking module of mobile phone B sends a response message to the session module of mobile phone B.
[0352] S721, Deleting Session 1 in the Session Module of Mobile Phone B.
[0353] S722, The session module of mobile phone B sends a response message to the service module of mobile phone B.
[0354] S723, the business module of mobile phone B processes response messages.
[0355] based on Figure 7 As described in the text, when phone B receives a notification, phone B can create a session and, through... Figure 6 The generated routing header ensures that notifications in the session are accurately forwarded to the watch via mobile phone A.
[0356] Optionally, if mobile phone B only establishes a connection with mobile phone A, when mobile phone B detects notification 2, mobile phone B can send message 5 containing notification 2 to mobile phone A, and then mobile phone A can process message 5. In this case, mobile phone A does not receive the routing header.
[0357] The following is combined with Figure 8 In a corresponding embodiment, an example is given of the execution process when mobile phone B detects notification 2, provided that mobile phone B has only established a connection with mobile phone A.
[0358] Figure 8 This is a schematic diagram illustrating the module interaction of mobile phone B sending notification 2 to mobile phone A, as provided in an embodiment of this application. Figure 8 In the corresponding embodiment, mobile phone B may include a service module, a session module, an access network module, and a connection module, while mobile phone A may include a connection module.
[0359] like Figure 8 As shown, the process of mobile phone B sending notification 2 to mobile phone A may include the following steps:
[0360] S801. When the service module of mobile phone B detects notification 2, the service module of mobile phone B sends a message that notification 2 has been detected to the session module of mobile phone B.
[0361] Notification 2 can be understood as a message related to the watch. Notification 2 may include: the device ID of phone A.
[0362] S802, Mobile Phone B's session module creates session 2.
[0363] S803, the session module of mobile phone B sends a message indicating that the session has been successfully established to the access network module of mobile phone B.
[0364] S804, the access networking module of mobile phone B generates message 5 based on notification 2.
[0365] Message 5 can be understood as a message generated after encapsulating notification 2.
[0366] S805, the access networking module of mobile phone B sends protocol header 1 and message 5 to the connection module of mobile phone A.
[0367] The protocol header 1 may include: the connection type between mobile phone A and mobile phone B, and the address of mobile phone B, etc. The content of the protocol header 1 can be obtained when mobile phone B establishes a communication connection with mobile phone A, i.e., obtained based on S406-S407.
[0368] S806, the connection module of mobile phone A did not detect the routing header, and processed message 5.
[0369] Combination Figure 7 as well as Figure 8 As described, mobile phone A can determine whether to forward a packet or process it locally based on the routing header. For example, when mobile phone A receives both a packet and a routing header, it can forward the packet to the destination device based on the information in the routing header; or, when mobile phone A receives a packet but does not receive the routing header, it can process the packet locally. In this way, mobile phone A can determine whether to forward or process the packet based on the received message to ensure that the packet is transmitted to the appropriate destination.
[0370] When phone A, phone B, and the watch have established a communication connection, if any device goes offline (or is deactivated), the other devices in the dual-device watch system can detect that device's offline status. For details, please refer to [link to relevant documentation]. Figure 9 Corresponding implementation examples.
[0371] Figure 9 This is a schematic diagram illustrating module interaction when a device is offline, as provided in an embodiment of this application. Figure 9 In a corresponding embodiment, mobile phone B may include a device management module, an access network module, and a connection module; mobile phone A may include a device management module, an access network module, and a connection module; and the watch may include a device management module, an access network module, and a connection module.
[0372] exist Figure 9 In the corresponding embodiments, the device offline situation can include the following three:
[0373] Scenario 1: When mobile phone A (or the master phone) detects that the watch is offline, mobile phone A takes the watch offline and can notify mobile phone B (or the slave phone) of the watch's offline status, and mobile phone B takes the watch offline.
[0374] Scenario 2: When phone B detects that phone A is offline, phone B can take both phone A and the watch offline.
[0375] Scenario 3: When phone A detects that phone B is offline, phone A can log phone B offline and notify the watch of the offline status, and the watch will then log phone B offline.
[0376] Specifically, in Case 1, the device offline process can be found in the descriptions in S901-S907.
[0377] S901. When the access network module of mobile phone A detects that the watch is offline, the access network module of mobile phone A obtains the device list of mobile phone A, which includes mobile phone B.
[0378] The device list may include: electronic devices that establish a communication connection with mobile phone A, such as mobile phone B.
[0379] The device list for phone A can be obtained from the device cloud, for example, phone A can obtain the device list by sending a query request to the device cloud.
[0380] Offline scenarios for a smartwatch can include one or more of the following: the smartwatch is reset to factory settings, or the smartwatch is moved away from phone A. After a factory reset, the smartwatch can be deregistered in the device cloud, and the device cloud can send an updated device list to phone A or phone B. Phone A will then detect that the smartwatch is offline.
[0381] Understandably, to maintain the communication connection between phone A and the watch, phone A can periodically send test requests to the watch. These test requests can be used to check whether the communication connection between phone A and the watch is maintained. If phone A does not receive a response message for the test request within a certain period of time, phone A can determine that the watch is offline.
[0382] After S901, the access networking module of mobile phone A can execute the steps shown in S902 and S905.
[0383] S902, The access networking module of mobile phone A sends a message to the device management module of mobile phone A that the watch is offline.
[0384] S903, the device management module of mobile phone A takes the watch offline.
[0385] S904, the access network module of mobile phone A obtains the routing header 2 of the starting device is the watch and the routing header 1 of the ending device is the watch, and deletes the routing record information related to the routing header 1 and the routing record information related to the routing header 2.
[0386] In the access network module of mobile phone A, the routing record information related to routing header 1 can be the data generated when mobile phone A sends or receives data based on routing header 1. The routing record information related to routing header 1 can be found in the descriptions in S708 and S710.
[0387] In the access network module of mobile phone A, the routing record information related to routing header 2 can be the data generated when mobile phone A sends or receives data based on routing header 2. The routing record information related to routing header 2 can be found in the descriptions in S715 and S718.
[0388] S905, the access networking module of mobile phone A sends a message to the device management module of mobile phone B that the watch is offline.
[0389] For example, the access network module of mobile phone A can send a watch offline message to the device management module of mobile phone B via the connection module of mobile phone A, the connection module of mobile phone B, and the access network module of mobile phone B. After receiving the watch offline message, the access network module of mobile phone B can execute the steps shown in S906.
[0390] After S905, the device management module of mobile phone B can send a message indicating that the watch is offline to the relevant business modules, so that all business modules can detect that the watch is offline. The business modules will then no longer perform specific business through the watch.
[0391] S906, the access network module of mobile phone B obtains the routing header 1 of the destination device being the watch, and deletes the routing record information related to the routing header 1.
[0392] Understandably, when the watch goes offline, phone B can determine that it is impossible to send messages to the watch via phone A. Therefore, it can query the router header 1, which is the destination device, and delete the routing record information related to router header 1.
[0393] In the access network module of mobile phone B, the routing record information related to routing header 1 can be the data generated when the access network module of mobile phone B sends or receives data based on routing header 1. The routing record information related to routing header 1 can be found in the description in S706.
[0394] Optionally, the access network module of mobile phone B can also delete route header 1 and routing table 1. Understandably, the device can delete routing-related data, which will not be elaborated further.
[0395] S907, the device management module of mobile phone B takes the watch offline.
[0396] Optionally, the watch can also detect when phone A is offline, and then the watch can disconnect both phone A and phone B and delete records related to router header 2.
[0397] In case 2, the device offline process can be found in the descriptions in S911-S917.
[0398] S911. When the access network module of mobile phone B detects that mobile phone A is offline, the access network module of mobile phone B sends a message that mobile phone A is offline to the device management module of mobile phone B.
[0399] The scenarios in which phone A goes offline can include one or more of the following: phone A is reset to factory settings, or phone A is far away from phone B. The process by which phone B detects that phone A is offline is similar to the process by which phone B detects that the watch is offline in the S901, and will not be described in detail here.
[0400] After S911, the device management module of mobile phone B can send a message indicating that mobile phone A is offline to the relevant business modules, so that all business modules can detect that mobile phone A is offline. The business modules will then no longer execute specific business through mobile phone A.
[0401] When phone A goes offline, phone B can determine that it cannot forward data to other devices through phone A. Therefore, the network access configuration of phone B can be determined based on S913 and S914, with the other device being the watch. Then, the watch is taken offline based on S915.
[0402] S912, the device management module of mobile phone B takes mobile phone A offline.
[0403] S913, the access network module of mobile phone B queries the routing header 1 where the next-hop device is mobile phone A.
[0404] S914, the access networking module of mobile phone B determines the destination device as the watch based on the routing header 1.
[0405] S915, the access networking module of mobile phone B sends a message to the device management module of mobile phone B that the watch is offline.
[0406] S916, the device management module of mobile phone B takes the watch offline.
[0407] After S916, the device management module of mobile phone B can send a message indicating that the watch is offline to the relevant business modules, so that all business modules can detect that the watch is offline. The business modules will then no longer perform specific business through the watch.
[0408] S917, the access networking module of mobile phone B deletes the routing record information related to the routing header 1.
[0409] In the access networking module of mobile phone B, the routing record information related to routing header 1 can be found in the description in S906.
[0410] In case 3, the device offline process can be found in the descriptions in S911-S926.
[0411] S921. When the access network module of mobile phone A detects that mobile phone B is offline, the access network module of mobile phone A sends a message that mobile phone B is offline to the device management module of mobile phone A.
[0412] The access network module of mobile phone A queries the routing header 1 of mobile phone B as the destination device.
[0413] The scenarios in which phone B goes offline can include one or more of the following: phone B is restored to factory settings, or phone B is far away from phone A. The process by which phone A detects that phone B is offline is similar to the process by which phone B detects that the watch is offline in the S901, and will not be described in detail here.
[0414] Understandably, to maintain the communication connection between phone A and phone B, phone A can periodically send test requests to phone B. These test requests can be used to check whether the communication connection between phone A and phone B is maintained. If phone A does not receive a response message corresponding to the test request within a certain period, phone A can determine that phone B is offline.
[0415] After S921, the device management module of mobile phone A can send a message indicating that mobile phone B is offline to the relevant business modules, so that all business modules can detect that mobile phone B is offline. The business modules will then no longer execute specific business through mobile phone B.
[0416] When phone B goes offline, phone A can determine that it cannot send the message to the watch. It can then query the routing header 2 where the destination device is phone B and delete the routing record information related to the routing header 2, as described in S923-S924.
[0417] S922, The device management module of mobile phone A takes mobile phone B offline.
[0418] S923, The access network module of mobile phone A obtains the routing header 2 of the starting device is mobile phone B and the routing header 1 of the ending device is mobile phone B, and deletes the routing record information related to the routing header 1 and the routing record information related to the routing header 2.
[0419] The contents of the routing record information related to routing header 1 and routing record information related to routing header 2 can be found in the description in S904, and will not be repeated here.
[0420] S924. The access network module of mobile phone A determines that mobile phone B is related to the watch based on router header 1 or router header 2.
[0421] In the access networking module of mobile phone A, the routing record information related to routing header 1 can be found in the description in S906.
[0422] Optionally, the access network module of mobile phone A can also determine that mobile phone B is a slave phone of the watch based on the watch's attribute information. If mobile phone B goes offline, messages in mobile phone B may not be able to continue to be sent to the watch, and thus the steps shown in S925 will be executed.
[0423] S925, the access network module of mobile phone A sends a message to the access network module of the watch that mobile phone B is offline.
[0424] S926, The watch's access network module deletes the routing record information related to routing header 2.
[0425] In the watch's access network module, the routing record information related to routing header 2 can be the data generated when the watch sends or receives data based on routing header 2. The routing record information related to routing header 2 can be found in the description in S718.
[0426] S927, The watch's access network module sends a message to the watch's device management module that mobile phone B is offline.
[0427] After S927, the watch's device management module can send a message indicating that phone B is offline to the relevant business modules, allowing all business modules to detect that phone B is offline. The business modules will then no longer execute specific business operations through phone B.
[0428] S928, the watch's device management module takes mobile phone B offline.
[0429] based on Figure 9 As described in the text, regardless of which device in the dual-machine system goes offline, the other devices in the dual-machine system can detect the device's offline status and then perform the steps of taking the device offline and deleting the routing record information to save power consumption in subsequent business processing.
[0430] The following is combined with Figure 10 The corresponding embodiments illustrate the connection method. For example... Figure 10 As shown, the connection method may include the following steps:
[0431] S1001, The first device establishes a first communication connection with the second device.
[0432] S1002, The first device establishes a second communication connection with the third device.
[0433] S1003. When the third device sends a first notification to the first device, in response to receiving the first notification, the first device sends a first notification to the second device, and carries a first routing header at the same time as the third device or the first device sends the first notification. The first routing header indicates that the destination device is the second device and indicates that the origin device is the third device.
[0434] The first notification can be Figure 7 Notification 1 as described in the document.
[0435] S1004. When the third device sends a second notification to the first device, in response to receiving the second notification, S1005 the first device processes the second notification, which does not include the first routing header.
[0436] The second notification can be Figure 8 Notification 3 as described in the document.
[0437] It should be noted that the embodiments of this application do not specifically limit the order of the steps.
[0438] It should be noted that the interface provided in this application embodiment is only an example and does not constitute a limitation on the embodiments of this application.
[0439] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0440] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0441] The processing method of the embodiments of this application has been described above. The apparatus for performing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined and referenced with each other, and the related apparatus provided in the embodiments of this application can perform the steps in the above list sorting method.
[0442] Figure 11 This is a schematic diagram of the hardware structure of another electronic device provided in an embodiment of this application.
[0443] Electronic devices may include: mobile phone A, mobile phone B, and watches. The hardware structures of each device may be the same or different.
[0444] The electronic device includes a processor 1101, a communication line 1104, and at least one communication interface. Figure 11 (The example is illustrated using communication interface 1103).
[0445] The processor 1101 may be a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
[0446] Communication line 1104 may include circuitry for transmitting information between the aforementioned components.
[0447] Communication interface 1103 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
[0448] Possibly, the electronic device may also include a memory 1102.
[0449] The memory 1102 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via communication line 1104. The memory may also be integrated with the processor.
[0450] The memory 1102 stores computer execution instructions for implementing the scheme of this application, and the processor 1101 controls the execution. The processor 1101 executes the computer execution instructions stored in the memory 1102 to implement the method provided in the embodiments of this application.
[0451] It is possible that the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.
[0452] In a specific implementation, as one example, the processor 1101 may include one or more CPUs, for example... Figure 11 CPU0 and CPU1 in the CPU.
[0453] In a specific implementation, as one example, an electronic device may include multiple processors, for example... Figure 11 Processors 1101 and 1105 are mentioned. Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0454] The display method provided in this application can be applied to electronic devices with communication functions. Electronic devices include terminal devices, and the specific device form of the terminal device can be referred to the above-described related descriptions, which will not be repeated here.
[0455] This application provides a terminal device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the terminal device to perform the above-described method.
[0456] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0457] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0458] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0459] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0460] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0461] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A connection method, characterized in that, Applied to a connection system, the connection system including: a first device, a second device, and a third device, the method includes: When the first device establishes a first communication connection with the second device and the first device establishes a second communication connection with the third device: When the third device sends a first notification to the first device, in response to receiving the first notification, the first device sends the first notification to the second device, and at the same time as the third device or the first device sends the first notification, a first routing header is carried, in which the destination device is the second device and the origin device is the third device; When the third device sends a second notification to the first device, in response to receiving the second notification, the first device processes the second notification, which does not include the first routing header.
2. The method according to claim 1, characterized in that, Before the third device sends the first notification to the first device, the method further includes: The third device creates a first routing table, which includes: information that the destination device is the second device, information that the next-hop device is the first device, the connection type between the third device and the first device, and the address of the first device; The third device creates a first protocol header based on the first routing table. When the third device sends the first notification to the first device, it also carries the first protocol header. The first protocol header includes: the connection type between the third device and the first device, and the address of the third device.
3. The method according to claim 2, characterized in that, Before the first device sends the first notification to the second device, the method further includes: The first device creates a second protocol header, wherein the first device sends the first notification to the second device along with the second protocol header, the second protocol header including: the connection type between the first device and the second device, and the address of the first device.
4. The method according to any one of claims 1-3, characterized in that, The first routing header also includes a preset field, which is used to parse the destination device and the origin device in the routing header 1 from the routing header 1.
5. The method according to any one of claims 1-4, characterized in that, Before the first device sends the first notification to the second device, the method further includes: the first device setting the first notification into a receiving queue and allocating a first thread; Sending the first notification from the first device to the second device includes: the first device sending the first notification to the second device through the first thread.
6. The method according to any one of claims 1-4, characterized in that, After the first device sends the first notification to the second device, the method further includes: In response to receiving the first notification, the second device processes the first notification and generates a third notification corresponding to the first notification; The second device sends a third notification to the first device; In response to receiving the third notification, the first device sends the third notification to the third device, and at the same time as the second device or the third device sends the third notification, it carries a second routing header, in which the destination device is the third device and the starting point is the second device.
7. The method according to claim 6, characterized in that, After receiving the first notification, the method further includes: The second device deletes the first routing header; The second device creates a second routing table, which includes: information that the destination device is the third device, information that the next-hop device is the first device, the connection type between the second device and the first device, and the address of the first device; The second device creates a third protocol header based on the second routing table. The third protocol header is carried by the second device when sending the third notification to the first device. The third protocol header includes: the connection type between the second device and the first device, and the address of the first device.
8. The method according to claim 7, characterized in that, Before the first device sends the third notification to the third device, the method further includes: The first device creates a fourth protocol header, wherein the first device sends the third notification to the third device while carrying the fourth protocol header, the fourth protocol header including: the connection type between the first device and the third device, and the address of the first device.
9. The method according to any one of claims 1-8, characterized in that, After the first device and the second device establish a first communication connection, the method further includes: the second device setting the first device as the master device of the second device; After the first device establishes a second communication connection with the third device, the method further includes: the first device sending a first message to the second device through the first communication connection, the first message being a message indicating that the third device has been detected; in response to the first message, the second device setting the third device as a slave device of the second device.
10. The method according to claim 9, characterized in that, After the second device sets the third device as a slave device of the second device, the method further includes: the second device sending a second message to the first device based on the first communication connection, the second message being a message that the third device is set as a slave device of the second device; Sending the first notification from the first device to the second device includes: when the first device receives the second message, the first device sends the first notification to the second device.
11. The method according to any one of claims 1-10, characterized in that, The method further includes: When the first device detects that the second device is offline, the first device takes the second device offline, deletes the record related to the first routing table, and sends a message to the third device that the second device is offline based on the second communication connection; In response to receiving a message that the second device is offline, the third device takes the second device offline and deletes the record associated with the first routing table.
12. The method according to claim 10, characterized in that, The scenarios in which the second device is offline include: the second device being restored to factory settings, and / or the second device disconnecting from the first device in the first communication connection.
13. The method according to any one of claims 1-12, characterized in that, The method further includes: When the third device detects that the first device is offline, the third device takes both the first device and the second device offline and deletes the records related to the first routing table.
14. The method according to any one of claims 1-13, characterized in that, The method further includes: When the first device detects that the third device is offline, the first device takes the third device offline, deletes the record related to the first routing table, and sends a message to the second device that the third device is offline based on the first communication connection; In response to receiving the message that the third device is offline, the second device takes the third device offline.
15. The method according to any one of claims 1-14, characterized in that, The first communication connection is a near-field connection, and the second communication connection is either the near-field connection or a far-field connection. The near-field connection includes a Bluetooth connection or a wireless LAN connection, and the far-field connection includes a connection based on a cloud-side device.
16. The method according to any one of claims 1-15, characterized in that, The second device is a watch.
17. A connection method, characterized in that, Applied to a first device, the method includes: When the first device establishes a first communication connection with the second device and the first device establishes a second communication connection with the third device: When the first device receives a first notification from the third device, in response to receiving the first notification, the first device sends the first notification to the second device. At the same time as the first device receives or sends the first notification, it carries a first routing header, in which the destination device is the second device and the origin device is the third device. When the first device receives a second notification from the third device, in response to receiving the second notification, the first device processes the second notification, which does not include the first routing header.
18. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in claim 17.
19. A communication system, characterized in that, The communication system includes: a first device, a second device, and a third device, wherein the first device performs the method as described in any one of claims 1-16, the second device performs the method as described in any one of claims 1-16, and the first device performs the method as described in any one of claims 1-16.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 17.
21. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 17.
22. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 17.