DEVICE NETWORKING METHOD, ELECTRONIC DEVICE, AND STORAGE MEDIUM

JP7645402B2Active Publication Date: 2025-03-13HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2023566626
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-11-09
Filing Date
2022-04-02
Publication Date
2025-03-13
Estimated Expiration
2042-04-02

Smart Images

  • Figure 0007645402000001
    Figure 0007645402000001
  • Figure 0007645402000002
    Figure 0007645402000002
  • Figure 0007645402000003
    Figure 0007645402000003
Patent Text Reader

Abstract

A device networking method, an electronic device, and a storage medium are provided, which relate to the field of communication technology and can solve the problem that the delay of communication between a first electronic device and a second electronic device is relatively high. The method is applied to a communication system. The communication system includes a plurality of electronic devices. The method includes: a first electronic device establishes a first communication connection with a second electronic device, the first communication connection includes the first electronic device and the second electronic device being connected in a first communication manner and a second communication manner; the first electronic device receives a packet transmitted by the second electronic device in the first communication manner in a first period; the first electronic device determines based on the packet that the first communication connection with the second electronic device is valid in a second period; and the first electronic device performs a service communication with the second electronic device in the second communication manner in a second period.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to Chinese Patent Application No. 202110464411.6, entitled "SOFTWARE BUS METHOD FOR INTERWORKING WITH VARIOUS MOBILE TERMINALS," filed with the China National Intellectual Property Office on April 28, 2021, and Chinese Patent Application No. 202111322529.1, entitled "DEVICE NETWORKING METHOD, ELECTRONIC DEVICE, AND STORAGE MEDIUM," filed with the China National Intellectual Property Office on November 9, 2021, both of which are incorporated by reference in their entireties herein.

[0002] The present application relates to the field of communication technologies, and in particular to a device networking method, an electronic device, and a storage medium. [Background technology]

[0003] With the development of smart devices, a user or a home usually has multiple electronic devices that can communicate with each other. Different electronic devices usually have their own device characteristics. For example, a mobile phone is more portable, a TV screen has a better display effect, and a speaker has a better sound quality effect. In order to fully utilize the device characteristics of different electronic devices, the multiple electronic devices may be networked, so that the multiple electronic devices are linked together for cooperative work.

[0004] A networking process of a star topology structure is used as an example. When multiple electronic devices are networked, a pre-configured electronic device (e.g., a TV, a router, or a mobile phone) can be determined as a central device. Furthermore, each electronic device other than the central device can be used as a peripheral device to establish a communication connection (e.g., Bluetooth connection or Wi-Fi connection) with the central device to form a local area network of a star topology structure. In this way, the central device can be configured to manage and control each peripheral device on the local area network as a central node to complete corresponding work tasks.

[0005] However, every time before a peripheral device performs service communication with another peripheral device, discovery and authentication are required first to establish a communication connection, and then the service communication is performed, in which case the communication delay between peripheral devices is relatively high, which further affects the user experience. Summary of the Invention

[0006] SUMMARY OF THE PRESENT APPLICATIONS The embodiments of the present application provide a device networking method, an electronic device, and a storage medium for solving the problem of relatively high latency in communication between a first electronic device and a second electronic device.

[0007] In order to achieve the above objectives, the embodiments of this application utilize the following technical solutions:

[0008] According to a first aspect, a device networking method is provided, which is applied to a communication system. The communication system includes a plurality of electronic devices. The method includes: a first electronic device establishes a first communication connection with a second electronic device, the first communication connection includes the first electronic device and the second electronic device being connected in a first communication manner and a second communication manner; the first electronic device receives a packet transmitted by the second electronic device in the first communication manner in a first period; the first electronic device determines based on the packet that the first communication connection with the second electronic device is valid in a second period; and the first electronic device performs a service communication with the second electronic device in the second communication manner in the second period.

[0009] According to the first aspect, when establishing a first communication connection with a second electronic device, the first electronic device receives a packet transmitted by the second electronic device in a first communication manner in a first period. The first electronic device may determine, based on the packet, that the first communication connection with the second electronic device is valid in a second period. Specifically, the first electronic device may determine, based on the packet, that the first electronic device maintains (i.e., keeps alive) a connection with the second electronic device in a second period, whereby the first electronic device performs service communication with the second electronic device in a second communication manner in the second period. Because the first electronic device determines, based on the packet, that the first electronic device and the second electronic device keep alive in the second period, the first electronic device may directly perform service communication with the second electronic device in the second period without determining keep alive before every service communication, thereby improving communication delay. In addition, since the first electronic device establishes a first communication connection with the second electronic device in the first communication manner and the second communication manner, the first electronic device may receive packets sent by the second electronic device, and the first electronic device may perform service communication with the second electronic device in a different communication manner, thereby improving communication reliability.

[0010] In a possible design of the first aspect, before the first electronic device receives a packet transmitted by the second electronic device in the first communication method during the first time period, the method further includes the first electronic device broadcasting or unicasting a request packet during the first time period, in the first communication method and the second communication method, the request packet indicating that the first electronic device requests to maintain the first communication connection with the second electronic device.

[0011] In this design, the first electronic device broadcasts or unicasts a request packet in the first communication method and the second communication method during a first period of time, so that the second electronic device can respond with a packet based on the request packet, thereby improving communication reliability.

[0012] In a possible design of the first aspect, when the first communication connection is valid in the second period, the first electronic device holds connection information of the second communication connection. The first electronic device performing service communication with the second electronic device in the second period in the second communication manner includes the first electronic device resuming the first communication connection established with the second electronic device based on the connection information and performing the service communication.

[0013] In this design, the first electronic device may quickly resume the first communication connection established with the second electronic device based on the connection information (e.g., information about the second electronic device) and perform the service communication, which further improves communication delay.

[0014] In a possible design of the first aspect, a priority of the first electronic device is higher than a priority of the second electronic device. The priority indicates hardware performance of the device. The hardware performance of the device with a higher priority is higher than the hardware performance of the device with a lower priority. The hardware performance includes one or more of processor performance, memory performance, hard disk performance, or network capability. The first electronic device establishing a first communication connection with the second electronic device includes the first electronic device establishing a first communication connection with the second electronic device and determining a priority of the second electronic device, and the first electronic device determining based on the packets that the first communication connection with the second electronic device is valid for the second time period includes the first electronic device determining based on the packets that the first communication connection with the second electronic device is valid for the second time period when the priority of the first electronic device is higher than the second electronic device.

[0015] In this design, when establishing a first communication connection with the second electronic device, the first electronic device determines a priority of the second electronic device. When the priority of the first electronic device is higher than that of the second electronic device, the first electronic device determines, based on the packets, that the first communication connection with the second electronic device is valid in a second time period. Specifically, the first electronic device with a higher priority determines which of the first electronic device and the second electronic device will send request packets and receive packets, thereby further improving communication reliability.

[0016] In a possible design of the first aspect, the first period is set periodically, the first period being the first set first period. The method further comprises: the first electronic device receiving the first period, the first period being the second set first period. No packets received within determining that the first electronic device should be disconnected from the second electronic device when the first electronic device has been disconnected from the second electronic device for N consecutive times; No packets received withindetermining that the first electronic device should be disconnected from the second electronic device when the first time period and the second time period at least partially overlap and the first electronic device does not receive a response packet in the first time period within the second time period.

[0017] In this design, when the first electronic device does not receive packets sent by the second electronic device for a long time, the first electronic device determines that it should disconnect from the second electronic device, which helps improve communication reliability.

[0018] In a possible design of the first aspect, the method further includes, when the first electronic device again performs service communication with the second electronic device, the first electronic device re-establishing the first communication connection with the second electronic device.

[0019] In this design, when it is determined that the first electronic device should be disconnected from the second electronic device, if the first electronic device performs service communication with the second electronic device again, the first electronic device re-establishes the first communication connection with the second electronic device, so that the service communication can be performed normally, thereby improving communication reliability.

[0020] In a possible design of the first aspect, the packet includes one of a response packet, a query packet, or a service packet.

[0021] In this design, the packet may be a response packet, an inquiry packet, or a service packet. Thus, when the first electronic device receives any one of the response packet, the inquiry packet, or the service packet sent by the second electronic device, the first electronic device can determine that the first communication connection with the second electronic device is valid in the second time period, thereby further improving communication reliability.

[0022] In a possible design of the first aspect, the method further includes, when the first electronic device remains in a static state during the first period and the number of times the first electronic device receives a response packet sent by the second electronic device exceeds a first preset number of times, the first electronic device adjusting the first period to a third period, the length of the third period exceeding the length of the first period.

[0023] In this design, when the first electronic device remains in a static state for a long time and the number of times the first electronic device receives a response packet sent by the second electronic device exceeds a first preset number of times, the first electronic device may adjust the first period to a third period, the length of the third period exceeding the length of the first period, i.e., the first electronic device receives the packet sent by the second electronic device in a deceleration mode, helping the device power consumption to be reduced.

[0024] In a possible design of the first aspect, the method further includes, when the first electronic device is placed in a preset scenario during a first time period and the number of times the first electronic device receives a response packet sent by the second electronic device exceeds a second preset number of times, the first electronic device adjusts the first time period to a fourth time period, the length of the fourth time period being less than the length of the first time period.

[0025] In this design, when the first electronic device is placed in the preset scenario for a long time and the number of times the first electronic device receives the response packet sent by the second electronic device exceeds a second preset number, the first electronic device may adjust the first period to a fourth period, where the length of the fourth period is less than the length of the first period, i.e., the first electronic device receives the packet sent by the second electronic device in an accelerated mode, which ensures that the first electronic device maintains a connection with the second electronic device.

[0026] In a possible design of the first aspect, the method further includes the first electronic device changing the fourth period back to the first period when a preset scenario in which the first electronic device is in changes, the preset scenario change including the first electronic device switching from a screen-off display to a screen-on display.

[0027] In this design, when the first electronic device switches from screen-off display to screen-on display, the first electronic device reverts to the first period and receives packets during the first period, helping reduce power consumption of the device.

[0028] In a possible design of the first aspect, the method further includes the first electronic device changing the fourth time period back to the first time period when a scenario in which the first electronic device is located changes, the change in the preset scenario including a change in an utilization state of the first electronic device.

[0029] In this design, when the usage status of the first electronic device changes, the first electronic device reverts to the first period to receive packets during the first period, helping to reduce power consumption of the device.

[0030] In a possible design of the first aspect, the method further includes the first electronic device rediscovering the nearby device and establishing a first communication connection when a scenario in which the first electronic device is located changes, the scenario changes including an absolute position change, a spatial position change, and a vehicle change, and the first electronic device receiving packets transmitted by the nearby device in the first communication manner during the first period of time.

[0031] In this design, when the absolute position of the first electronic device changes, the spatial position changes, and the vehicle changes, the first electronic device rediscovers the nearby device and establishes a first communication connection. The first electronic device receives packets transmitted by the nearby device in the first communication manner during a first period of time. In this way, the first electronic device can maintain a connection with the nearby device, thereby improving communication reliability.

[0032] In a possible design of the first aspect, the method further includes, when a last electronic device among all electronic devices establishing a first communication connection with the first electronic device is offline, the first electronic device rediscovering nearby devices and establishing the first communication connection, and the first electronic device receiving packets transmitted by the nearby devices in the first communication manner during the first period of time.

[0033] In this design, any electronic device that establishes a first communication connection with the first electronic device The last electronic device When the nearby device is offline, the first electronic device rediscovers the nearby device and establishes a first communication connection. The first electronic device then receives packets transmitted by the nearby device in the first communication manner during the first period. In this way, the first electronic device can maintain a connection with the nearby device, thereby improving communication reliability.

[0034] In a possible design of the first aspect, the method further includes, when network conditions of a communication system in which the multiple electronic devices are located change, the first electronic device sends a network change message to the second electronic device to redetermine a physical communication method to be utilized when a first communication connection with the second electronic device is established.

[0035] In this design, when the network conditions of the multiple electronic devices change (e.g., network interruption or network delay), the first electronic device notifies the second electronic device that the network conditions have changed and redetermines the physical communication method to be utilized when the first communication connection with the second electronic device is established, thereby improving communication reliability.

[0036] In a possible design of the first aspect, the method further includes the first electronic device determining a wake-up period of the first electronic device based on a periodic connection established between a first application on the first electronic device and a cloud server of the first application, where the first application is any application on the first electronic device, and the first electronic device synchronizing the wake-up period with the second electronic device, where the wake-up period is the same as the periodically set first period.

[0037] In this design, the first electronic device sets a periodic first period based on the wake-up period. Specifically, the wake-up period is the same as the periodic first period. In this way, the first electronic device and the second electronic device can receive packets during the wake-up period, which helps reduce the power consumption of the devices.

[0038] In a possible design of the first aspect, the method further includes the first electronic device displaying a first interface in response to a user's operation on the second application, the first interface including at least one electronic device maintaining a first communication connection with the first electronic device, the at least one electronic device including the second electronic device, and the first electronic device performing a service communication with the second electronic device in response to the user's operation on the second electronic device.

[0039] In this design, a first interface of a first electronic device may directly display at least one electronic device that maintains a first communication connection with the first electronic device, the at least one electronic device including a second electronic device. Thus, when the first electronic device attempts to perform a service communication with the second electronic device, the first electronic device can directly perform the service communication with the second electronic device without first scanning for the second electronic device, thereby reducing user latency and improving user experience.

[0040] In a possible design of the first aspect, the first interface further includes at least one electronic device that is disconnected from the first electronic device.

[0041] In this design, the first interface further displays at least one electronic device that is disconnected from the first electronic device. Thus, when a user has a first electronic device that needs to perform service communication with any of the at least one electronic device, the user may directly tap the electronic device. In this way, the electronic device establishes a first communication connection with the first electronic device, thereby improving the user experience.

[0042] In a possible design of the first aspect, the first interface further includes indication information indicating that a third electronic device is being scanned, the third electronic device being a device of the plurality of electronic devices that is disconnected from the first electronic device, or the third electronic device being a device that initially establishes a first communication connection with the first electronic device.

[0043] In this design, based on the indication information displayed on the first interface, a user may know the third electronic device that is disconnected from the first electronic device or the electronic device that first establishes a first communication connection with the first electronic device, which helps further improve the user experience.

[0044] In one possible design of the first aspect, the first electronic device includes a processor. The processor includes a plurality of processing cores. The plurality of processing cores includes a low power core. The method further includes the first electronic device receiving, during the first time period, packets transmitted by the second electronic device utilizing the low power core.

[0045] In this design, a keep-alive mechanism between the first electronic device and the second electronic device is set on the low-power core, which helps reduce the power consumption of the devices.

[0046] According to a second aspect, an electronic device is provided. The electronic device is a first electronic device. The electronic device includes a memory and one or more processors. The memory stores computer program code. The computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device is enabled to perform the following steps: the first electronic device establishes a first communication connection with a second electronic device, the first communication connection includes the first electronic device and the second electronic device being connected in a first communication manner and a second communication manner; the first electronic device receives a packet transmitted by the second electronic device in the first communication manner in a first time period; the first electronic device determines based on the packet that the first communication connection with the second electronic device is valid in a second time period; and the first electronic device performs a service communication with the second electronic device in the second communication manner in a second time period.

[0047] In a possible design of the second aspect, when the computer instructions are executed by a processor before the first electronic device receives a packet transmitted by the second electronic device in the first communication method in the first time period, the electronic device is further enabled to perform the following steps: the first electronic device broadcasts or unicasts a request packet in the first communication method and the second communication method in the first time period, the request packet indicating that the first electronic device requests to maintain a first communication connection with the second electronic device.

[0048] In a possible design of the second aspect, when the first communication connection is valid in the second time period, the first electronic device retains connection information of the second communication connection. When the computer instructions are executed by the processor, the electronic device is enabled to perform, in particular, the following steps: the first electronic device resumes the first communication connection established with the second electronic device based on the connection information and performs the service communication.

[0049] In a possible design of the second aspect, a priority of the first electronic device is higher than a priority of the second electronic device. The priority indicates a hardware performance of the device. The hardware performance of the device with a higher priority is higher than the hardware performance of the device with a lower priority. The hardware performance includes one or more of processor performance, memory performance, hard disk performance, or network capability. When the computer instructions are executed by the processor, the electronic device is enabled to perform, among other things, the following steps: the first electronic device establishes a first communication connection with the second electronic device and determines a priority of the second electronic device. When the computer instructions are executed by the processor, the electronic device is enabled to perform, among other things, the following steps: when the priority of the first electronic device is higher than the second electronic device, the first electronic device determines, based on the packets, that the first communication connection with the second electronic device is valid in a second time period.

[0050] In a possible design of the second aspect, the first period is set periodically, and the first period is the first period set for the first time. When the computer instructions are executed by the processor, the electronic device performs the following steps: the first electronic device periodically sets the first period, which is the first period set for the second time. No packets received within determining that the first electronic device should be disconnected from the second electronic device when the first electronic device has been disconnected from the second electronic device for N consecutive times; No packets received within or determining that the first electronic device should be disconnected from the second electronic device when the first time period and the second time period at least partially overlap and the first electronic device does not receive a response packet in the first time period within the second time period.

[0051] In a possible design of the second aspect, when the computer instructions are executed by the processor, the electronic device is further enabled to perform the following step: when the first electronic device again performs service communication with the second electronic device, the first electronic device re-establishes a first communication connection with the second electronic device.

[0052] In a possible design of the second aspect, the packet includes one of a response packet, a query packet, or a service packet.

[0053] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when the first electronic device remains in a static state during the first period and the number of times the first electronic device receives a response packet sent by the second electronic device exceeds a first preset number of times, the first electronic device adjusts the first period to a third period, the length of the third period exceeding the length of the first period.

[0054] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when the first electronic device is placed in the preset scenario in a first time period and the number of times the first electronic device receives a response packet sent by the second electronic device exceeds a second preset number of times, the first electronic device adjusts the first time period to a fourth time period, the length of the fourth time period being less than the length of the first time period.

[0055] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when a preset scenario in which the first electronic device is in changes, the first electronic device changes the fourth period back to the first period, The change in the preset scenario includes the first electronic device switching from a screen-off display to a screen-on display.

[0056] In a possible design of the second aspect, when the computer instructions are executed by the processor, the electronic device is further enabled to perform the following step: when a scenario in which the first electronic device is located changes, the first electronic device changes the fourth time period back to the first time period, The change in the pre-set scenario includes a change in the utilization state of the first electronic device.

[0057] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when a scenario in which the first electronic device is located changes, the first electronic device rediscovers nearby devices and establishes a first communication connection, the scenario changes including an absolute position change, a spatial position change, and a vehicle change; and the first electronic device receives packets transmitted by the nearby devices in a first communication manner during a first period of time.

[0058] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when the last electronic device of all electronic devices that establish a first communication connection with the first electronic device is offline, the first electronic device rediscovers nearby devices and establishes the first communication connection; and the first electronic device receives packets transmitted by the nearby devices in the first communication manner during a first period of time.

[0059] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: when network conditions of a communication system in which the multiple electronic devices are located change, the first electronic device sends a network change message to the second electronic device and redetermines the physical communication method to be utilized when a first communication connection with the second electronic device is established.

[0060] In a possible design of the second aspect, when the computer instructions are executed by a processor, the electronic device is further enabled to perform the following steps: a first electronic device determines a wake-up period of the first electronic device based on a periodic connection established between a first application on the first electronic device and a cloud server of the first application, where the first application is any application on the first electronic device; and the first electronic device synchronizes the wake-up period with the second electronic device, where the wake-up period is the same as the periodically set first period.

[0061] In a possible design of the second aspect, when the computer instructions are executed by the processor, the electronic device is further enabled to perform the following steps: the first electronic device displays a first interface in response to a user's operation on a second application, the first interface including at least one electronic device maintaining a first communication connection with the first electronic device, the at least one electronic device including a second electronic device; and the first electronic device performs service communication with the second electronic device in response to a user's operation on the second electronic device.

[0062] In a possible design of the second aspect, the first interface further includes at least one electronic device that is disconnected from the first electronic device.

[0063] In a possible design of the second aspect, the first interface further includes indication information indicating that a third electronic device is being scanned, the third electronic device being a device of the plurality of electronic devices that is disconnected from the first electronic device, or the third electronic device being a device that initially establishes a first communication connection with the first electronic device.

[0064] In a possible design of the second aspect, the first electronic device includes a processor. The processor includes a plurality of processing cores. The plurality of processing cores includes a low power core. When the computer instructions are executed by the processor, the electronic device is further enabled to perform the following steps: the first electronic device receives, during a first time period, a packet transmitted by a second electronic device utilizing the low power core.

[0065] According to a third aspect, there is provided a communication system including a plurality of electronic devices. The plurality of electronic devices includes a first electronic device and a second electronic device. The first electronic device is any electronic device among the plurality of electronic devices. The second electronic device is another electronic device among the plurality of electronic devices other than the first electronic device. The first electronic device is configured to perform a device networking method according to the first aspect or any one of possible designs of the first aspect.

[0066] According to a fourth aspect, there is provided a computer readable storage medium comprising computer instructions which, when executed on an electronic device, enable the electronic device to perform a device networking method according to the first aspect or any one of the possible designs of the first aspect.

[0067] According to a fifth aspect, there is provided a computer program product, the computer program product including computer instructions, which when executed on an electronic device, enable the electronic device to perform a device networking method according to the first aspect or any one of possible designs of the first aspect.

[0068] It can be understood that the advantageous effects that can be achieved by the electronic device according to the second aspect and any one of the possible designs of the second aspect, the communication system according to the third aspect, the computer-readable storage medium according to the fourth aspect, and the computer program product according to the fifth aspect should refer to the advantageous effects of the first aspect and any one of the possible designs of the first aspect, and the details will not be described again here. [Brief description of the drawings]

[0069] [Figure 1] 1 is a schematic diagram of a network structure formed by an AP and a STA according to an embodiment of this application; [Diagram 2]2 is a schematic flowchart of networking between an AP and a STA according to an embodiment of the present application; [Diagram 3] FIG. 2 is a schematic diagram of the structure of a network formed by a master device and a slave device according to an embodiment of the present application; [Figure 4] 1 is a schematic flow chart of master / slave device networking according to an embodiment of the present application; [Diagram 5] 1 is a schematic diagram of a mobile phone interface according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of a super terminal structure according to an embodiment of this application; [Figure 7] FIG. 13 is a schematic diagram of the structure of another super terminal according to an embodiment of this application; [Figure 8] FIG. 13 is a schematic diagram of the structure of yet another super terminal according to an embodiment of this application. [Figure 9] FIG. 1 is a schematic diagram of a structure of an electronic device according to an embodiment of the present application. [Figure 10] 1 is a schematic diagram of the structure of a communication system according to an embodiment of this application; [Figure 11a] 1 is a schematic flow chart of a device networking method according to an embodiment of the present application. [Figure 11b] FIG. 2 is a schematic diagram of a relationship between a first period and a second period according to an embodiment of the present application. [Figure 11c] FIG. 2 is a schematic diagram of another relationship between a first period and a second period according to an embodiment of the present application. [Figure 11d] FIG. 13 is a schematic diagram of yet another relationship between a first time period and a second time period according to an embodiment of the present application. [Figure 12] 4 is a schematic flow chart of a device handshake connection according to an embodiment of the present application; [Figure 13] 4 is a schematic flow chart of another device handshake connection according to an embodiment of the present application; [Figure 14]13 is a schematic flowchart of yet another device handshake connection according to an embodiment of the present application; [Figure 15] FIG. 2 is a schematic diagram of triggering a heartbeat inquiry during a wake-up period according to an embodiment of the present application. [Figure 16] FIG. 2 is a schematic diagram of another interface of a mobile phone according to an embodiment of the present application. [Figure 17] FIG. 1 is a schematic diagram of a structure of a chip system according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0070] The following describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. In the description of this application, unless otherwise specified, " / " represents the relationship of "or" between related objects. For example, A / B can represent A or B. In this application, "and / or" only describes the association relationship to describe related objects, and represents that three relationships may exist. For example, A and / or B can represent the following three cases: only A exists, both A and B exist, and only B exists, and A and B may be singular or plural. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "At least one of the following items (parts)" or similar expressions means any combination of these items, including any combination of singular items (parts) or multiple items (parts). For example, at least one item (part) of a, b, or c may indicate a, b, c, a and b, a and c, b and c, or a, b, and c, and a, b, and c may be singular or plural. In addition, in order to clearly describe the technical solutions in the embodiments of this application, terms such as "first" and "second" are used in the embodiments of this application to distinguish between the same items or similar items that provide essentially the same function or purpose. Those skilled in the art may understand that terms such as "first" and "second" do not limit the quantity or execution order, and terms such as "first" and "second" do not indicate absolute differences. In addition, terms such as "example" or "for example" are used in the embodiments of this application to represent giving an example, illustration, or explanation. Any embodiment or design scheme described as "example" or "for example" in the embodiments of this application should not be construed as being preferred or having more advantages than other embodiments or design schemes. Rather, the use of words such as "example" or "for example" is intended to present the relevant concepts in a concrete manner to facilitate understanding.

[0071] In addition, the network architecture and service scenarios described in the embodiments of this application are intended to more clearly describe the technical solutions in the embodiments of this application, and do not constitute limitations on the technical solutions provided in the embodiments of this application. With the development of network architectures and the emergence of new service scenarios, those skilled in the art may know that the technical solutions provided in the embodiments of this application can also be applied to similar technical problems.

[0072] The local area network of the star topology structure may be a network formed by a wireless access point (AP) and a client (station, STA) in a wireless fidelity (Wi-Fi) communication method, or a network formed by a master device (master) and a slave device (slave) in a classic Bluetooth (basic rate, BR) / Bluetooth low energy (BLE) communication method. In some embodiments, the network formed by the AP, the STA, and the cloud server, and the network formed by the master device and the slave device may be referred to as a "virtual" network.

[0073] The networking process of a local area network with a star topology structure includes device discovery, device authentication, and device maintained connection (in short, keep alive). Device discovery means that a central device discovers nearby peripheral devices (or a peripheral device discovers nearby central devices). Device authentication means that a central device authenticates the discovered peripheral devices. If the authentication is successful, the central device may establish a connection with the peripheral devices. Device maintained connection means that service communication is performed between the central device and the peripheral devices in a packet transmission manner, so that the central device maintains a connection relationship with the peripheral devices.

[0074] The network formed by the AP and the STAs may be a wireless local area network (WLAN). As shown in FIG. 1, STA1, STA2, ..., STA N may establish a communication connection with the AP by using Wi-Fi. Then, STA1, STA2, ..., STA N may perform service communication with the AP and access a remote cloud server through the AP. The AP may be a wireless router or an electronic device having a Wi-Fi function module. In FIG. 2, an example in which the AP is a wireless router is used for explanation.

[0075] Referring to FIG. 1, the STA scans for nearby APs using Wi-Fi, as shown in FIG. 2. Then, the AP transmits service set identifiers (SSIDs) to the STA. After receiving the SSID transmitted by the AP, the STA selects the corresponding SSID and inputs a password for authentication. If the authentication is successful (i.e., the password is correct), the STA negotiates a communication channel with the AP and performs communication through the communication channel. Finally, the AP transmits a beacon frame to the STA, and the STA periodically listens to the beacon frame transmitted by the AP to keep alive. In some embodiments, the method of the STA discovering, connecting to the AP and keeping alive shown in FIG. 2 may be referred to as a soft AP method.

[0076] In the network formed by the AP and the STA shown in Fig. 2, when the AP and the STA keep alive, the power consumption of the AP is relatively high. In addition, when two STAs need to perform service communication, the two STAs need to perform mutual discovery and authentication first. Then, the service communication can be performed, which results in a relatively high communication delay of the STA. In addition, the AP and the STA can only be networked through WLAN, and cannot be networked using other communication media.

[0077] As shown in FIG. 3, slave device A, slave device B, ..., slave device N may establish a communication connection with the master device using BLE / BR. Then, slave device A, slave device B, ..., slave device N may perform service communication with the master device. Referring to FIG. 3, the slave device may transmit a broadcast message (e.g., ADV_IND or ADV_DIRECT_IND) on a broadcast channel as shown in FIG. 4. The broadcast message indicates that the slave device is in a state where it can be connected. The master device may perform scanning on the broadcast channel. When the master device receives the broadcast message, i.e., when it discovers a slave device, it transmits a scan request to the slave device. When it receives the scan request, the slave device responds with a scan response to the master device transmitting the connection request. The scan response responded by the slave device may be, for example, CONNECT_REQ. Then, the master device transmits a connection request to the slave device. After the slave device receives the connection request, the master device and the slave device agree to establish a connection on the same channel and communicate with each other. For example, the master device and the slave device may utilize a generic attribute profile (GATT) for communication. When the master device and the slave device are networked in a BLE communication manner, in some embodiments, the master device periodically sends a connection event to the slave device, and the slave device periodically listens to the connection event sent by the master device to keep alive, as further shown in Figure 4. In addition, when the master device and the slave device are networked in a BR communication manner, the master device and the slave device keep alive.

[0078] In the network formed by the master device and the slave devices shown in Fig. 3, if the slave device A, slave device B, ..., slave device N, and the master device include multiple devices of the same type, the multiple devices of the same type are likely to have a mismatch. In addition, the slave devices cannot communicate with each other directly and need to establish communication using a remote cloud server. In addition, if the communication medium between the slave device A, slave device B, ..., slave device N and the master device is different, the slave devices and the master device cannot be networked.

[0079] It can be understood from the above that when a central device does not exist (e.g., the device is not powered on or the device is broken) on a network formed by an AP and a STA, or on a network formed by a master device and a slave device, there is no network. As a result, the peripheral devices cannot communicate with each other. When a central device exists (e.g., works properly) and a network formed by the peripheral devices and the central device exists, the central device arranged on a local area network of a star topology structure can perform service communication with the peripheral devices, but the peripheral devices cannot directly perform service communication with each other. For example, in a Wi-Fi networking (i.e., networking between an AP and a STA) scenario, STA1 and STA2 cannot directly perform service communication. In a Bluetooth networking (i.e., networking between a slave / master device) scenario, slave device A and slave device B cannot directly perform service communication. In addition, every time a peripheral device attempts to perform service communication with another peripheral device (e.g., STA1 and STA2, slave device A and slave B), the peripheral devices need to perform mutual discovery. Specifically, peripheral devices need to first perform mutual scanning or discovery before arranging communication. In this case, communication delays between peripheral devices and other peripheral devices cannot be controlled. When a user has a communication requirement when utilizing a communication application, the user may need to wait for a long time (several seconds or even minutes), which reduces the user experience.

[0080] A mobile phone is used as an example. As shown in FIG. 5, when a user needs to hold the mobile phone and turn on a TV, a scan control 1 is displayed on the screen of the mobile phone. After the user taps the scan control 1, the mobile phone starts to perform a handshake connection with nearby online devices (i.e., the mobile phone starts to scan for nearby online devices). After a scanning period, the interface of the mobile phone displays the devices that have completed a handshake connection with the mobile phone. After the user taps any device (e.g., a computer) in the interface of the mobile phone, the mobile phone may perform service communication with the device. It can be understood that when the mobile phone scans for nearby online devices, the user needs to wait for a long time, which reduces the user experience.

[0081] It should be noted in FIG. 5 that the interface displayed by the mobile phone further includes devices (eg, a Bluetooth headset and an air purifier) ​​that are performing services communicating with the mobile phone.

[0082] Based on this, an embodiment of this application provides a device networking method applied to a communication network. The communication network does not rely on a general network formed by an AP and an STA, or a star network formed by a master device and a slave device. The method may enable multiple electronic devices to automatically form a communication network (in short, an ad-hoc network). Specifically, any two electronic devices among the multiple electronic devices may perform mutual discovery and authentication to establish a persistent connection. The persistent connection is a periodic handshake connection (sometimes referred to as handshake keep-alive). In this way, on the ad-hoc network, any two electronic devices among the multiple electronic devices may perform service communication. In addition, since any two electronic devices among the multiple electronic devices periodically perform a handshake connection, i.e., each electronic device may know in advance which online device is in the vicinity, two electronic devices that need to perform service communication may directly perform service communication without first performing mutual discovery and authentication and then performing service communication. Therefore, the device discovery and authentication phase in the communication phase is omitted, the uncertainty of device mutual discovery and authentication is reduced, communication reliability is improved while reducing communication delay, and the user experience is improved.

[0083] For example, a software bus is deployed in devices, whereby an ad-hoc network is formed between the devices. The software bus has discovery and connection capabilities, and can provide a high-throughput, low-latency, highly reliable, secure, and trustworthy communication channel between electronic devices, providing a distributed smart communication highway network with near-localized wireless access effects between electronic devices. After the software bus is deployed in the electronic devices, the electronic devices have the capabilities to discover and be discovered.

[0084] It should be noted that in the embodiment of this application, the ad-hoc network formed by multiple electronic devices may be an ad-hoc network between multiple peripheral devices, or an ad-hoc network between a central device and multiple peripheral devices. For example, the ad-hoc network is formed between STA1, STA2, ..., STA N, or the ad-hoc network is formed between slave device A, slave device B, ..., slave device N and a master device. In addition, in this application, the new network formed by multiple electronic devices may be referred to as a "horizontal" network. A "horizontal" network is a network automatically formed by electronic devices with each other without relying on a remote cloud server. For example, the ad-hoc network formed by multiple electronic devices may be an ad-hoc network between devices whose communication roles are peer-to-peer, for example, between peer devices (STAs) having an AP-STA "vertical" network, or between peer devices (slaves) having a master-slave "vertical" network, or may be a network between isolated peer devices with communication capabilities whose roles are free and are networked with each other when there is no existing AP-STA or master-slave network.

[0085] Before describing the embodiments of this application, an application scenario of the embodiments of this application will be described first.

[0086] The device networking method provided in the embodiments of this application can be applied to different fields (e.g., 1+8+N consumer goods field and industrial device field). "1" refers to mobile phone. "8" refers to head unit, speaker, headset, watch / band, tablet, large screen, personal computer (PC), or augmented reality (AR) device / virtual reality (VR) device, etc. "N" refers to internet of things (IoT) device.

[0087] Based on this, application scenarios to which the method is applicable include, but are not limited to, office scenarios, sports scenarios, home scenarios, entertainment scenarios, education scenarios, and industrial manufacturing scenarios. It should be noted that multiple electronic devices may form a "super terminal" in different scenarios, and the electronic devices in the "super terminal" may be linked together for cooperative work. For example, when multiple electronic devices form a "super terminal", an electronic device (e.g., a TV, a router, or a mobile phone) may be determined as a central control device, and each electronic device other than the central control device may be utilized as a slave device to establish a communication connection (e.g., Bluetooth connection or Wi-Fi connection) with the central control device. In this way, as a central node, the central control device may be configured to manage and control other slave devices to complete corresponding tasks. In some embodiments, a user may install an application (APP) on the central control device, and the user may operate the slave devices connected to the central control device in the application of the central control device, thereby greatly improving the user experience.

[0088] It should be noted that the central control device may be, for example, a rich device, and the slave device may be, for example, a thin device. Usually, the priority of a rich device is higher than that of a thin device. For example, a rich device is a device with powerful central processing unit (CPU), memory, hard disk, and network capabilities. A thin device is a device with weak CPU, memory, hard disk, and network capabilities. For example, a rich device may be a mobile phone, a tablet computer (PAD), a personal computer (PC), or a smart screen. A thin device may be, for example, a smart watch, a headset, or a smart glass. This is not limited in this application.

[0089] In some embodiments, the mobile phone of the rich device is selected as the central control device, as shown in Figure 6. Based on this, the user can operate the television, tablet, computer, and wireless Bluetooth headset through the application installed on the mobile phone. For example, the user can turn on the television using the application installed on the mobile phone.

[0090] It should be understood that in different scenarios, the electronic devices forming the "super terminal" are different. For example, in a home scenario, as shown in FIG. 7, the electronic devices forming the "super terminal" include a mobile phone, a tablet computer (PAD) / personal computer (PC), a smart screen, and a smart home appliance (e.g., a smart lamp, a smart switch, a smart refrigerator, a smart oven, a smart lock, and a smart curtain). For example, a mobile phone is used as a rich device. The PAD / PC, the smart screen, and the smart home appliance establish a connection with the mobile phone using an access technology (e.g., Wi-Fi, Bluetooth, USB, or Ethernet). Then, the user only needs to operate the mobile phone to control other devices in real time. For example, the user may operate the mobile phone to turn on (or off) a smart lamp and a smart switch, etc. As another example, in a sports scenario, as shown in FIG. 8, the electronic devices forming the "super terminal" include a mobile phone, a smart watch, a headset, and a smart band, etc. For example, the mobile phone is a rich device. Smart watches, headsets, and smart bands establish a connection with a mobile phone using an access technology (e.g., Wi-Fi, Bluetooth, USB, or Ethernet). Then, the user only needs to operate the mobile phone to control other devices in real time. For example, the user may operate the mobile phone to turn on the headset, so that the user can listen to music (or make a phone call) using the headset.

[0091] For example, the device networking method provided in the embodiments of this application may be applied to electronic devices such as mobile phones, tablets, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, smart vehicles, or smart speakers, but is not limited to this in the embodiments of this application.

[0092] 9 is a schematic diagram of the structure of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (SIM) card interface 195, etc.

[0093] The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, an optical proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, and a bone conduction sensor 180M.

[0094] It may be understood that the structure shown in this embodiment does not constitute a specific limitation on electronic device 100. In some other embodiments, electronic device 100 may include more or fewer components than those shown in the figures, some components may be combined, some components may be divided, or different component arrangements may be utilized. The components shown in the figures may be implemented in hardware, software, or a combination of software and hardware.

[0095] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. The different processing units may be separate components or may be integrated into one or more processors.

[0096] The controller may be the brain and command center of the electronic device 100. The controller may generate operation control signals based on instruction operation codes and time sequence signals to implement control over instruction fetching and execution.

[0097] The memory may further be located within the processor 110 and configured to store instructions and data. In some embodiments, the memory within the processor 110 is a cache memory. The memory may store instructions or data that have been used or are repeatedly used by the processor 110. When the processor 110 needs to use the instructions or data again, the processor may directly retrieve the instructions or data from the memory. This prevents repeated accesses, reduces the latency of the processor 110, and improves system efficiency.

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

[0099] It may be understood that the interface connection relationships between modules shown in this embodiment are merely illustrative examples and do not constitute limitations on the structure of the electronic device. In some other embodiments, the electronic device may alternatively utilize an interface connection scheme different from those of the above embodiment, or a combination of multiple interface connection schemes.

[0100] The charging management module 140 is configured to accept a charging input from a charger. The charger may be a wireless charger or a wired charger. In some embodiments of a wired charger, the charging management module 140 may accept the charging input from the wired charger via the USB interface 130. In some embodiments of a wireless charger, the charging management module 140 may accept the wireless charging input via a wireless charging coil of the electronic device. The charging management module 140 may further provide power to the electronic device using the power management module 141 while charging the battery 142.

[0101] The power management module 141 is configured to be connected to the battery 142, the charging management module 140, and the processor 110. The power management module 141 accepts input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may be further configured to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage or impedance). In some other embodiments, the power management module 141 may alternatively be located within the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may alternatively be located within the same component.

[0102] The wireless communication function of the electronic device 100 may be implemented via antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, a baseband processor, and the like.

[0103] Antenna 1 and Antenna 2 are configured to transmit and receive electromagnetic signals. Each antenna in electronic device 100 may be configured to cover one or more communication frequency bands. Different antennas may be further multiplexed to improve antenna utilization. For example, Antenna 1 may be multiplexed as a diversity antenna in a wireless local area network. In some other embodiments, the antennas may be used in combination with tuning switches.

[0104] The mobile communication module 150 may provide a solution applied to the electronic device 100 for wireless communication, including 2G, 3G, 4G, and 5G, etc. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves via the antenna 1, perform processing such as filtering or amplification on the received electromagnetic waves, and transmit the electromagnetic waves to a modem processor for demodulation.

[0105] Mobile communication module 150 may further amplify signals modulated by the modem processor and convert the signals into electromagnetic waves for emission via antenna 1. In some embodiments, at least some of the functional modules in mobile communication module 150 may be located within processor 110. In some embodiments, at least some of the functional modules in mobile communication module 150 may be located within the same device as at least some of the modules in processor 110.

[0106] The modem processor may include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a mid-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the low-frequency baseband signal obtained through demodulation to a baseband processor for processing. The low-frequency baseband signal is processed by the baseband processor and then transmitted to an application processor. The application processor outputs a sound signal through an audio device (such as but not limited to a speaker 170A or a receiver 170B) or displays an image or video through a display 194. In some embodiments, the modem processor may be an independent device. In some other embodiments, the modem processor may be independent from the processor 110 and is located in the same device with the mobile communication module 150 or other functional modules.

[0107] The wireless communication module 160 may be applied to the electronic device 100 and provide wireless communication solutions, including wireless local area network (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC) technology, and infrared (IR) technology, etc.

[0108] The wireless communication module 160 may be one or more components integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering operations on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may further receive signals to be transmitted from the processor 110, perform frequency modulation and amplification on the signals, and convert the signals into electromagnetic waves for emission via the antenna 2.

[0109] In some embodiments, antenna 1 is coupled to a mobile communication module 150 in electronic device 100, and antenna 2 is coupled to a wireless communication module 160, allowing electronic device 100 to communicate with networks and other devices using wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code-division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation system (SBAS).

[0110] The electronic device 100 implements display functions using a GPU, a display 194, an application processor, and the like. The GPU is a microprocessor for image processing and is connected to the display 194 and the application processor. The GPU is configured to perform mathematical and geometric calculations and render images. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0111] The display 194 is configured to display images, videos, etc. The display 194 includes a display panel. The display panel may include a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini LED, a micro LED, a micro OLED, or a quantum dot light-emitting diode (QLED), etc.

[0112] The electronic device 100 can implement a photographing function using an ISP, a camera 193, a video codec, a GPU, a display 194, an application processor, and the like.

[0113] The ISP is configured to process data fed back by the camera 193. For example, when taking a picture, the shutter is pressed, light is transmitted through the lens to the camera's photosensitive elements, the light signal is converted to an electrical signal, and the camera's photosensitive elements transmit the electrical signal to the ISP for processing, converting the electronic signal into a visible image. The ISP may further perform algorithmic optimization of image noise, brightness, and complexion. The ISP may further optimize parameters such as exposure and color temperature for the shooting scenario. In some embodiments, the ISP may be located within the camera 193.

[0114] The camera 193 is configured to capture still images or video. An optical image of an object is generated through a lens and projected onto a photosensitive element. The photosensitive element may be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into a standard image signal in a format such as RGB or YUV. In some embodiments, the electronic device may include one or N cameras 193, where N is a positive integer greater than 1.

[0115] The digital signal processor is configured to process digital signals, and may process other digital signals in addition to digital image signals, for example, when the electronic device selects a frequency, the digital signal processor is configured to perform a Fourier transform or the like on the frequency energy.

[0116] A video codec is configured to compress or decompress digital video. Electronic device 100 may support one or more types of video codecs. In this manner, the electronic device may play or record video in multiple coding formats, e.g., moving picture experts group (MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

[0117] NPU is a neural-network (NN) computing processor that can quickly process input information based on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, and can continuously perform self-learning. NPU can implement applications such as intelligent perception of electronic devices, such as image recognition, face recognition, speech recognition, and text understanding.

[0118] The external memory interface 120 may be configured to connect to an external memory card, such as a microSD card, to expand the storage capabilities of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos are stored on the external storage card.

[0119] The internal memory 121 may be configured to store computer executable program code. The executable program code includes instructions. The processor 110 executes the instructions stored in the internal memory 121 to perform various functions, applications, and data processing of the electronic device 100. For example, in an embodiment of this application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

[0120] The program storage area may store an operating system and applications required by at least one function (e.g., a sound playback function or an image playback function), etc. The data storage area may store data generated in the use of the electronic device 100 (e.g., audio data, an address book, etc.) In addition, the internal memory 121 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory, or universal flash storage (UFS).

[0121] The electronic device 100 may implement audio functions, such as music playback and recording, using an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, and an application processor.

[0122] The audio module 170 is configured to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 may be configured to encode and decode audio signals. In some embodiments, the audio module 170 may be located within the processor 110, or some functional modules of the audio module 170 are located within the processor 110. The speaker 170A, also referred to as a "loudspeaker", is configured to convert audio electrical signals into sound signals. The receiver 170B, also referred to as an "earpiece", is configured to convert audio electrical signals into sound signals. The microphone 170C, also referred to as a "microphone" or "mic", is configured to convert sound signals into electrical signals.

[0123] The headset jack 170D is configured to connect to a wired headset. The headset jack 170D may be a USB interface 130 or a 3.5 mm open mobile electronic terminal. End It may be an open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0124] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch-sensitive buttons. The motor 191 may generate a vibration prompt. The motor 191 may be configured to provide an incoming call vibration prompt or a touch vibration feedback. The indicator 192 may be an indicator light and may be configured to indicate a charging status and a power change, or may be configured to indicate messages, missed calls, notifications, and the like. The SIM card interface 195 is configured to connect to a SIM card. The SIM card is inserted or removed from the SIM card interface 195 to implement a connection or disconnection from the electronic device 100. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 may support a nano SIM card, a micro SIM card, a SIM card, and the like.

[0125] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS With reference to the accompanying drawings in this specification, the following specifically describes the device networking method provided in the embodiments of this application.

[0126] The device networking method provided in this embodiment of the application is applied to a communication system 200. As shown in Fig. 10, the communication system 200 includes a plurality of electronic devices (e.g., a mobile phone, a headset, a smart screen, a band, and a tablet). The plurality of electronic devices may perform mutual discovery and mutual authentication. If the authentication is successful, any two electronic devices of the plurality of electronic devices may establish and keep alive a communication connection (e.g., a first communication connection) with each other, and complete the networking process of the communication system 200.

[0127] The plurality of electronic devices may specifically include a first electronic device and a second electronic device. The first electronic device is any electronic device among the plurality of electronic devices. The second electronic device is another electronic device among the plurality of electronic devices other than the first electronic device. For example, the plurality of electronic devices include a device 1, a device 2, and a device 3. For example, the first electronic device may be the device 1, and the second electronic device may be the device 2, or the first electronic device may be the device 2, and the second electronic device may be the device 3, or the first electronic device may be the device 3, and the second electronic device may be the device 2, or the first electronic device and the second electronic device may be a combination of any two of the device 1, the device 2, and the device 3. This is not limited in the embodiment of this application.

[0128] The first electronic device has the ability to discover the second electronic device, and the first electronic device can be discovered by the second electronic device in turn. Similarly, the second electronic device has the ability to discover the first electronic device, and the second electronic device can be discovered by the first electronic device in turn. Based on this, the first electronic device and the second electronic device that are mutually discovered can perform authentication. If the authentication is successful, the first electronic device establishes a communication connection with the second electronic device.

[0129] For example, the first electronic device may establish a communication connection with the second electronic device in at least two physical communication methods. The at least two physical communication methods may include a first communication method and a second communication method. Specifically, the first electronic device and the second electronic device are connected in the first communication method and the second communication method. The at least two physical communication methods may be a connection-type physical layer communication method or a connectionless physical layer communication method. The connection-type physical layer communication method may be, for example, a Wi-Fi connection or other physical layer connection method. The connectionless physical layer communication method may be, for example, a Bluetooth (such as BR or BLE) connection method, a network port connection method, or other physical connection method. This is not limited in this application.

[0130] 11a is a schematic flowchart of a device networking method according to an embodiment of the present application. As shown in FIG. 11a, the method includes the following steps:

[0131] S10: The first electronic device sends a discovery message to the second electronic device.

[0132] The discovery message indicates that the first electronic device can be discovered by other electronic devices.

[0133] At the same time, the second electronic device scans for nearby devices. When the second electronic device receives the discovery message sent by the first electronic device, the second electronic device discovers the first electronic device by scanning.

[0134] Similarly, the second electronic device sends a discovery message to the first electronic device. At the same time, the first electronic device scans for nearby devices. When the first electronic device receives the discovery message sent by the second electronic device, the first electronic device discovers the second electronic device by scanning.

[0135] It can be understood that the first electronic device and the second electronic device may each be utilized as a sending device to send a discovery message and as a scanning device to perform a scan. In this manner, both the first electronic device and the second electronic device have the ability to discover and be discovered. Similarly, each electronic device of the plurality of electronic devices has the ability to discover and be discovered.

[0136] S20: The first electronic device sends an authentication message to the second electronic device.

[0137] The authentication message indicates device information of the first electronic device, including the SSID, account information, and communication medium (also referred to as communication method) of the first electronic device.

[0138] The SSID indicates the name of the first electronic device (e.g., Huawei P30). The account information indicates the account information of the user who uses the first electronic device (e.g., the user's mobile phone number or email address). The communication medium indicates the line used when the first electronic device performs network communication. For example, the communication medium includes, but is not limited to, various types of the following: wireless local area network (WLAN), peer-to-peer (P2P) network, BR, BLE, and power line communication (PLC).

[0139] Similarly, the second electronic device sends an authentication message to the first electronic device. For the authentication message sent by the second electronic device, please refer to the above example of the authentication message sent by the first electronic device, and the details will not be described again here.

[0140] After the first electronic device and the second electronic device exchange device information with each other, the first electronic device performs authentication based on the device information sent by the second electronic device. At the same time, the second electronic device performs authentication based on the device information sent by the first electronic device. If the SSID of the first electronic device and the second electronic device are the same, the first electronic device automatically establishes a communication connection with the second electronic device. For example, when the first electronic device is a Huawei P30 model and the second electronic device is a Huawei MAX model, the first electronic device automatically establishes a communication connection with the second electronic device. If the SSID of the first electronic device and the second electronic device are different, the first electronic device establishes a communication connection with the second electronic device through user authentication. For example, the user may select the SSID of the second electronic device from the first electronic device and enter a password, so that the first electronic device establishes a communication connection with the second electronic device. If the account information of the first electronic device is the same as that of the second electronic device, i.e., the first electronic device and the second electronic device are devices belonging to the same user, the first electronic device may directly establish a communication connection with the second electronic device.

[0141] For example, the first electronic device may establish a communication connection with the second electronic device through at least two physical communication methods (e.g., the first communication method and the second communication method) described in the above embodiment. For examples of the at least two physical communication methods, please refer to the above embodiment. Details will not be described again here.

[0142] S30: The first electronic device establishes a persistent connection with the second electronic device.

[0143] Establishing a persistent connection specifically means that the first electronic device maintains a first communication connection with the second electronic device.

[0144] For example, the first electronic device and the second electronic device may periodically trigger a heartbeat inquiry, so that the first electronic device can maintain a state of persistent connection with the second electronic device. The persistent connection is a regular and rhythmic (i.e., periodic) discovery or connection means. In this application, the persistent connection applies to various connection-oriented and connectionless physical layer communication methods. For example, the connection-oriented physical layer communication method may be, for example, a Wi-Fi connection, and the connectionless physical layer communication method may be, for example, a Bluetooth connection or a network port connection. Of course, the connection-oriented and connectionless physical layer communication methods may alternatively be other connection methods. This is not limited in this application. For example, the first electronic device may maintain a persistent connection with the second electronic device in a first communication method and a second communication method. The first communication method and the second communication method are not limited to a method of maintaining a conventional connection defined according to the communication protocol of those physical communication methods, and may be a method of only retaining connection information. The connection information is utilized to quickly resume a persistent connection established in the physical communication system or to quickly execute a persistent connection in the physical communication system, for example, the connection information may be relevant parameters or relevant information (e.g., information about the peer device) needed to establish and resume a connection.

[0145] For example, when the first electronic device establishes a communication connection with the second electronic device in the BLE communication method, the first electronic device may establish a persistent connection with the second electronic device using a BLE advertisement frame. In another example, when the first electronic device establishes a communication connection with the second electronic device in the BR communication method, the BR maintains a persistent connection between the first electronic device and the second electronic device. In another example, when the first electronic device establishes a communication connection with the second electronic device in a communication method such as USB, Ethernet, WLAN, or PLC, and the first electronic device performs service communication with the second electronic device using a user datagram protocol (UDP), the first electronic device may establish a persistent connection with the second electronic device using a connectionless Internet of Things (constrained application protocol, CoAP) packet. In another example, when the first electronic device establishes a communication connection with the second electronic device through a communication method such as USB, Ethernet, WLAN, or PLC, and the first electronic device performs service communication with the second electronic device through IP, the first electronic device may establish a persistent connection with the second electronic device through a transmission control protocol (TCP) and maintain the persistent connection through a keepalive mechanism. In another example, when the first electronic device establishes a communication connection with the second electronic device through a P2P method, P2P allows the first electronic device and the second electronic device to directly establish a persistent connection.

[0146] The first electronic device and the second electronic device periodically trigger the heart rate survey, which indicates that the first electronic device receives a packet transmitted by the second electronic device in a first communication manner in a first period, and then the first electronic device determines that the first communication connection with the second electronic device is valid in a second period based on the packet. It should be noted that the packet transmitted by the second electronic device and received by the first electronic device in the first communication manner in the first period can be a packet of various forms (e.g., a response packet, an inquiry packet, or a service packet).

[0147] In some embodiments, the first period is set periodically. The length of the first period may be left unchanged or may be dynamically changed (e.g., increased or decreased). In the first period set periodically, the interval between two adjacent first periods is from the current start point to the next start point or from the current end point to the next end point. This is not limited in this application.

[0148] In some embodiments, as shown in Fig. 11b, the start of the second period is the same as the time when the first electronic device receives the packet, and the end of the second period is a period after the first electronic device receives the packet. For example, the end of the second period is greater than or equal to the start (or end) of the Nth first period. Fig. 11b shows an example in which the end of the second period is equal to the start of the Nth first period.

[0149] In some other embodiments, as shown in Fig. 11c, the start time of the second period is the same as the start time of the current first period (e.g., the first first period), and the end time of the second period is a period after the start time of the current first period. For example, the end time of the second period is after the start time (or end time) of the Nth first period. Fig. 11c shows an example in which the end time of the second period is equal to the start time of the Nth first period.

[0150] In yet another embodiment, as shown in Fig. 11d, the start time of the second period is equal to the end time of the current first period (e.g., the first first period), and the end time of the second period is a period after the end time of the current first period. For example, the end time of the second period is after the start time (or end time) of the Nth first period. Fig. 11d shows an example in which the end time of the second period is equal to the start time of the Nth first period.

[0151] When the first electronic device determines, based on the packets, that the first communication connection with the second electronic device is valid for the second period, the first electronic device performs service communication with the second electronic device in the second communication manner for the second period. For example, the first electronic device may quickly resume the first communication connection established with the second electronic device based on the stored connection information and perform the service communication.

[0152] In some embodiments, the first period is set periodically. Assume that the first period is the first period set initially. The method further includes: determining that the first electronic device should be disconnected from the second electronic device when the first electronic device does not receive a packet within the first period, which is the first period set for a second time; determining that the first electronic device should be disconnected from the second electronic device when the first electronic device does not receive a packet within the first period, which is the first period set for N consecutive times (N>1); or determining that the first electronic device should be disconnected from the second electronic device when the first period and the second period at least partially overlap and the first electronic device does not receive a packet in the first period within the second period.

[0153] Based on this, when the first electronic device performs service communication with the second electronic device again, the first electronic device re-establishes the first communication connection with the second electronic device.

[0154] It should be noted that the first electronic device re-establishing the first communication connection with the second electronic device indicates that the first electronic device and the second electronic device perform mutual scanning and discovery again, and then perform mutual authentication. If the authentication is successful, the first electronic device re-establishes the first communication connection with the second electronic device. Unlike the first electronic device resuming the first communication connection established with the second electronic device, the first electronic device resuming the first communication connection established with the second electronic device indicates that the first electronic device does not need to perform the process of mutual scanning, mutual discovery, and mutual authentication, but that the first electronic device sends a request packet and receives a packet responded to by the second electronic device to resume the first communication connection. Specifically, a first electronic device resuming a first communication connection with a second electronic device may be understood as there being a first communication connection established between the first electronic device and the second electronic device, and the first communication connection (i.e., keep-alive) being maintained in a manner to receive packets for a first period of time.

[0155] In some embodiments, each of the plurality of electronic devices is utilized as a sender device to send a handshake request message (e.g., send a request packet), and each of the plurality of electronic devices is utilized as a receiver device to respond with a handshake response message (e.g., respond with a packet). In some other embodiments, each of the plurality of electronic devices is utilized as a broadcaster to broadcast the handshake response message. In still other embodiments, through negotiation, one electronic device of the plurality of electronic devices is utilized as a master device, and other devices of the plurality of electronic devices other than the master device are utilized as slave devices. Based on this, the master device may send a handshake request message to each slave device, and each slave device then responds to the master device with a handshake response message.

[0156] It should be noted that the first electronic device is any electronic device among the plurality of electronic devices, the second electronic device is any electronic device among the plurality of electronic devices other than the first electronic device, and the first electronic device establishing a persistent connection with the second electronic device indicates that a persistent connection can be established between any two electronic devices among the plurality of electronic devices. Based on this, a process of establishing a persistent connection between any two electronic devices among the plurality of electronic devices will be described in detail with reference to Figures 12, 13 and 14.

[0157] In some embodiments, for example, the multiple electronic devices include device 1 and device 2. As shown in Figure 12, device 1 sends a handshake request message to device 2, and device 2 responds with a handshake response message to device 1. Similarly, device 2 sends a handshake request message to device 1, and device 1 responds with a handshake response message to device 2.

[0158] The handshake request message may be, for example, "online or not". When device 1 sends a handshake request message to device 2, device 1 inquires whether device 2 is online or not. Then device 2 detects the network adapter state of device 2. When the network adapter of device 2 is in a connected state, device 2 responds with a handshake response message, i.e., device 2 responds "online". When the network adapter of device 2 is in a disconnected state, device 2 does not respond with a handshake response message, i.e., device 2 is "offline". In this way, device 1 and device 2 send handshake request messages and respond with handshake response messages, so that device 1 and device 2 know that each other is "online" and furthermore, device 1 and device 2 can complete a handshake connection.

[0159] It should be noted that "online" indicates that the electronic device is within the coverage of the communication network (or that the electronic device is connected to the communication network), has communication capabilities, and can carry out communication. "offline" indicates that the electronic device is not within the coverage of the communication network (or that the electronic device is disconnected from the communication network) and cannot carry out communication.

[0160] In this embodiment, each electronic device of the plurality of electronic devices sends a handshake request message. When each electronic device of the plurality of electronic devices responds with a handshake response message, any two electronic devices of the plurality of electronic devices complete a handshake connection with each other. It should be noted that the handshake response message may be, for example, an inquiry packet. The completion of the handshake connection between device 1 and device 2 is that device 1 determines, based on the packet (for example, the inquiry packet), that the first communication connection with device 2 is valid in a second period of time. Based on this, device 1 may directly perform service communication with device 2.

[0161] In some other embodiments, each electronic device of the multiple electronic devices broadcasts a handshake response message. Then, the first electronic device receives the handshake response message broadcast by other electronic devices other than the first electronic device. For example, the multiple electronic devices include device 1, device 2, and device 3. For example, as shown in FIG. 13, device 1 broadcasts a handshake response message, device 2 broadcasts a handshake response message, and device 3 broadcasts a handshake response message. Based on this, device 1 receives the handshake response message broadcast by device 2 and device 3, device 2 receives the handshake response message broadcast by device 1 and device 3, and device 3 receives the handshake response message broadcast by device 1 and device 2. In this way, device 1, device 2, and device 3 can complete a handshake connection with each other.

[0162] For an example of the corresponding handshake response message, please refer to the above embodiment, and note that the details will not be described again here. It should be understood that when the electronic device broadcasts the handshake response message, it indicates that the electronic device is "online". When the electronic device does not broadcast the handshake response message, it indicates that the electronic device is "offline".

[0163] In this embodiment, when each electronic device of the multiple electronic devices broadcasts a handshake response message, it indicates that each electronic device is "online". Then, each electronic device may receive a handshake response message broadcast by other electronic devices other than that electronic device, thereby completing a handshake connection between any two electronic devices of the multiple electronic devices. It should be noted that the handshake response message may be, for example, a response packet (acknowledgement character, ACK). For example, device 1 and device 2 complete a handshake connection by device 1 determining that the first communication connection with device 2 is valid in a second period based on the packet (e.g., the response packet). Based on this, device 1 may directly perform service communication with device 2.

[0164] In yet another embodiment, the multiple electronic devices determine one master device through negotiation, and other electronic devices other than the master device are used as slave devices. For example, the multiple electronic devices include a master device, a slave device 1, and a slave device 2. For example, as shown in FIG. 14, the master device sends a handshake request message to the slave device 1, and the master device 1 sends a handshake request message to the slave device 2. Then, after the slave device 1 and the slave device 2 receive the handshake request message sent by the master device, the slave device 1 sends a handshake response message to the master device, and the slave device 2 sends a handshake response message to the master device.

[0165] It should be noted that for examples of the handshake request message and the handshake response message, please refer to the above embodiment, and the details will not be described again here. When the slave device responds to the master device with a handshake response message, it indicates that the slave device is "online". When the slave device does not respond to the master device with a handshake response message, it indicates that the slave device is "offline".

[0166] In this embodiment, when all the slave devices among the multiple electronic devices respond to the master device with a handshake response message, it indicates that all the slave devices are "online". Then, all the slave devices may complete a handshake connection with the master device. It should be noted that the handshake response message may be, for example, a response packet. For example, device 1 and device 2 complete a handshake connection, and device 1 determines that the first communication connection with device 2 is valid in a second period based on the packet (e.g., the response packet). Based on this, device 1 may directly perform service communication with device 2.

[0167] In addition, the multiple electronic devices determine one master device through negotiation. For example, the electronic device with the highest priority among the multiple electronic devices may be determined as the master device, or one master device may be determined in other manners. This is not limited in this application. Priority indicates the hardware performance of the device. The hardware performance of a device with a high priority is higher than the hardware performance of a device with a low priority. The hardware performance includes one or more of processor performance, memory performance, hard disk performance, or network capability. For example, the processor performance (e.g., CPU clock speed), hard disk performance, or network capability of a device with a high priority is higher than the processor performance (e.g., CPU clock speed), hard disk performance, or network capability of a device with a low priority.

[0168] In some embodiments, in the process of the first electronic device establishing a first communication connection with the second electronic device, the first electronic device determines a priority of the second electronic device. At the same time, in the process of the first electronic device establishing a first communication connection with the second electronic device, the second electronic device determines a priority of the first electronic device. When the first electronic device determines that the priority of the first electronic device is higher than that of the second electronic device, the first electronic device determines that the first communication connection with the second electronic device is valid in a second period based on the packets. Specifically, the first electronic device with the higher priority is utilized to send the request packet and receive the packet.

[0169] It should be noted that when the first electronic device is performing service communication with the second electronic device (e.g., in a BR, BLE, or P2P manner), the first electronic device may receive a service packet sent by the second electronic device and determine that the first communication connection with the second electronic device is valid during a second period of time.

[0170] Based on the above description, in the embodiment of this application, a plurality of electronic devices automatically form a communication network (in short, an ad-hoc network). Specifically, any two electronic devices among the plurality of electronic devices may perform mutual discovery and authentication to establish a persistent connection. The persistent connection is a periodic handshake connection (sometimes referred to as handshake keep-alive). In this way, any two electronic devices among the plurality of electronic devices may perform service communication on the ad-hoc network. In addition, any two electronic devices among the plurality of electronic devices periodically perform a handshake connection, i.e., each electronic device may know in advance which online devices are in the vicinity, so that two electronic devices that need to perform service communication may directly perform service communication without first performing mutual discovery and authentication and then performing service communication. Therefore, the device discovery and authentication phase in the communication phase is omitted, the uncertainty of device mutual discovery and authentication is reduced, communication reliability is improved while communication delay is reduced, and user experience is improved.

[0171] In some embodiments, in a process in which the first electronic device performs a handshake connection with the second electronic device (i.e., maintains a first communication connection), the first electronic device may perform a handshake connection with the second electronic device in the first communication method or the second communication method. For example, the first communication method may be, for example, any one of WLAN, P2P, BR, BLE, and PLC methods, and the second communication method may be, for example, any one of WLAN, P2P, BR, BLE, and PLC methods. In some embodiments, the first communication method and the second communication method may be the same or different.

[0172] Since the reliability of each communication medium is different, it should be noted that when an electronic device executes a handshake connection using different communication media, the power consumption of the electronic device is different. Based on this, when an electronic device executes a handshake connection, a communication medium that results in relatively low power consumption of the electronic device can be used. In some embodiments, when an electronic device executes a handshake connection using different communication media, the order of the communication media corresponding to the power consumption generated by the electronic device is, in ascending order, BLE < Wi-Fi < P2P < PLC. Based on this, when an electronic device includes a plurality of communication media, the electronic device may select a communication medium with relatively low power consumption and execute a handshake connection, thereby reducing the power consumption of the electronic device.

[0173] As can be understood from the above embodiments, the first electronic device and the second electronic device exchange device information with each other before establishing a persistent connection, and the device information includes the communication media supported by the electronic device. Specifically, the first electronic device knows the communication media supported by the second electronic device, and the second electronic device knows the communication media supported by the first electronic device. Therefore, the first electronic device can execute a handshake connection with the second electronic device based on the communication media exchanged with each other.

[0174] For example, the communication medium supported by the first electronic device includes WLAN, P2P, BR, BLE, and PLC, and the communication medium supported by the second electronic device includes WLAN, P2P, BR, BLE, and PLC. In some embodiments, the first electronic device may send a handshake request message to the second electronic device using a BLE communication medium, and the second electronic device may respond with a handshake response message using a WLAN communication medium. In some other embodiments, the first electronic device may send a handshake request message to the second electronic device using a BLE communication medium, and the second electronic device may respond with a handshake response message using a BLE, WLAN, or other communication medium. In some other embodiments, the first electronic device sends a handshake request message to the second electronic device using a BLE, WLAN, or P2P communication medium, and the second electronic device responds with a handshake response message using a P2P communication medium. In some other embodiments, the first electronic device transmits a handshake request message to the second electronic device utilizing a BLE, WLAN, or P2P communication medium, and the second electronic device responds with a handshake response message utilizing a BLE, WLAN, or P2P communication medium.

[0175] In embodiments of the present application, the first electronic device may trigger the heart rate study based on the first time period. In some embodiments, the first electronic device may dynamically adjust the first time period to trigger the heart rate study based on a state of the first electronic device, including the first electronic device being in a static state and being within a pre-set scenario.

[0176] For example, when the first electronic device is in a static state for a long time, the first electronic device may trigger a heart rate study in a dynamic deceleration mode, and when the first electronic device is in a pre-set scenario for a long time, the first electronic device may trigger a heart rate study in a dynamic acceleration mode.

[0177] An example in which the first period is 5 minutes is used for illustration. For example, if the first electronic device remains in a static state for the first period and the number of times the first electronic device performs a heart rate study based on the first period exceeds a first preset number of times (e.g., 3 times), the first electronic device may adjust the first period to a third period (e.g., 10 minutes). Based on this, if the first electronic device is still in a static state and the number of times the first electronic device performs a heart rate study based on the third period exceeds a first preset number of times (e.g., 3 times), the first electronic device may continue to increase the length of the third period, etc. (e.g., increase to 30 minutes).

[0178] An example in which the first period is 5 minutes is further used for explanation. For example, if the first electronic device is in the preset scenario for the first period and the number of times the first electronic device receives a packet sent by the second electronic device exceeds a second preset number of times, the first electronic device adjusts the first period to a fourth period (e.g., adjusts from 5 minutes to 3 minutes). Based on this, if the first electronic device is still in a static state and the number of times the first electronic device performs a heartbeat survey based on the fourth period exceeds a second preset number of times (e.g., 3 times), the first electronic device may continue to decrease the length of the fourth period, etc. (e.g., decreases from 3 minutes to 1 minute).

[0179] In some embodiments, the first electronic device returns the fourth period to the first period when the preset scenario in which the first electronic device is located changes. For example, the preset scenario changes include the first electronic device switching from a screen-off display to a screen-on display, a change in the usage state of the first electronic device (e.g., a user uses the first electronic device to read text, watch a video, or make a call), a change in the absolute position (e.g., horizontal position) of the first electronic device, a change in the spatial position (e.g., latitude and longitude coordinates) of the first electronic device, and a change in the vehicle (e.g., a bus, a car, an airplane, or an elevator) in which the first electronic device is located.

[0180] For example, when a user holds the first electronic device and changes from a screen-off display to a screen-on display, the first electronic device restores the first period. As another example, when a user holds the first electronic device and changes from reading text to watching a video, the first electronic device restores the first period. As another example, when a user holds the first electronic device and walks, the first electronic device restores the first period. As another example, when a user holds the first electronic device and changes from a bus to a car, the first electronic device restores the first period.

[0181] In some embodiments, when the absolute position of the first electronic device changes, the spatial position changes, or the vehicle changes, the first electronic device rediscovers the nearby device and establishes a first communication connection. The first electronic device then receives a response packet transmitted by the nearby device in the first communication manner during a first time period.

[0182] In some embodiments, when the last electronic device of all electronic devices that establish a communication connection with the first electronic device is offline, the first electronic device rediscovers nearby electronic devices and establishes a first communication connection, and the first electronic device receives a response packet transmitted by the nearby device in a first communication manner during a first time period.

[0183] In some embodiments, when network conditions of a communication system in which the multiple electronic devices are located change, the first electronic device sends a network change message to the second electronic device to redetermine the physical communication method to be utilized when a first communication connection is established with the second electronic device.

[0184] In some embodiments, the processor of the electronic device may be a general-purpose central processing unit (CPU), a microprocessor, or the like. For example, the CPU may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). When the CPU is a multi-core processor, the module for triggering a heart rate survey by the first electronic device may be located on a low-power core (e.g., a Sensor Hub or M3 core). In this way, the power consumption of the device may be reduced.

[0185] Based on this, each electronic device needs to use over-the-air (OTA) technology to upgrade the data of the electronic device and the SIM card, and the application installed on the electronic device needs to communicate with a remote cloud server. Therefore, the processor (such as a CPU) and the associated communication module (such as a Wi-Fi chip) of the electronic device need to be woken up periodically. Based on this, in an embodiment of this application, a heart rate survey may be triggered in the wake-up period of the electronic device (i.e., the wake-up period is the same as the first period that is set periodically), thereby reducing the power consumption of the device.

[0186] It should be noted that the CPU wake-up functionality of an electronic device may be prioritized inside the chip, then on a low power core, and then on the application, thereby reducing the number and time of waking up the CPU of the electronic device.

[0187] For example, the multiple electronic devices may agree on the same wake-up period through negotiation. For example, the multiple electronic devices may first determine one master device through negotiation, and other devices other than the master device are utilized as slave devices. Then, the master device may first determine the wake-up period of the master device, and then the master device may transmit the wake-up period of the master device to each slave device, so that the wake-up periods of the multiple electronic devices are the same. In some embodiments, the master device may determine the wake-up period of the master device based on a periodic connection established between an application installed on the master device and a remote cloud server.

[0188] An example is used in which the application installed on the master device is WeChat. For example, the remote cloud server periodically pushes messages to the master device, and the master device determines the wake-up period based on the period during which the remote cloud server pushes messages to WeChat. In some embodiments, the master device may determine the wake-up period based on the period during which the remote cloud server pushes messages to the application installed on the master device, or the master device may determine the wake-up period based on the period during which the remote cloud server pushes messages to the multiple applications installed on the master device. When the master device determines the wake-up period based on the period during which the remote cloud server pushes messages to the multiple applications installed on the master device, for example, the multiple applications installed on the master device may determine the wake-up period based on the period during which the remote cloud server pushes messages to the multiple applications installed on the master device. server When it is possible to negotiate with the remote cloud server However, the period for pushing messages to multiple applications installed on the master device is set to the same period.

[0189] Figure 15 is a schematic diagram of triggering a heartbeat investigation in a wake-up period according to an embodiment of this application. With reference to Figure 14, it can be understood that the wake-up periods of the first electronic device and the second electronic device are the same (e.g., 5 minutes), and the first electronic device and the second electronic device synchronize their wake-up clocks and align their wake-up windows. The wake-up window includes a wake-up state and a back-end state. Based on this, the first electronic device and the second electronic device trigger a heartbeat investigation in the back-end state.

[0190] In addition, as further shown in Figure 15, when the first electronic device and the second electronic device align their wake-up windows, the windows for triggering heartbeat checks are also aligned. Specifically, the first electronic device and the second electronic device trigger heartbeat checks at the same time. In this way, the duty cycle is dynamically adjusted, which allows the CPU (or chip) to be utilized in a low power consumption manner.

[0191] It should be noted that when the first electronic device is in a static state for a long time, the first electronic device may trigger a heartbeat study in a deceleration mode. Specifically, the period for triggering a heartbeat study by the first electronic device is extended (e.g., from 5 minutes to 10 minutes, and then to 30 minutes, 1 hour, or longer). Based on this, if the heartbeat study period of the first electronic device (i.e., the first period periodically set) exceeds the wake-up period (e.g., the heartbeat study period is 10 minutes and the wake-up period is 5 minutes), the first electronic device may forcefully wake up the first electronic device to trigger a heartbeat study.

[0192] In this embodiment, the wake-up periods of all the electronic devices among the multiple electronic devices are aligned, and the wake-up periods of all the electronic devices are the same. Based on this, each electronic device can trigger a heart rate check during the wake-up period, which can reduce the device power consumption.

[0193] An example is taken in which the application scenario is a home scenario and the first electronic device is a mobile phone. For example, as shown in Fig. 16, when a user logs into an application on a mobile phone and controls a home smart device, the application interface of the mobile phone directly displays the device (e.g., smart screen, tablet, computer, or speaker) that completes a handshake connection with the mobile phone. Specifically, the application interface of the mobile phone directly displays the smart home devices that are currently online. Then, the user may tap any online device, so that the mobile phone executes service communication with the device. For example, the user may tap a speaker and use the speaker to play music sound on the mobile phone.

[0194] In some embodiments, as shown in FIG. 16, the application interface of the mobile phone further displays smart home devices (e.g., the mobile phone) that are currently offline. The display manner of online smart devices does not match that of offline smart devices. For example, offline smart devices are displayed in gray. In addition, in some embodiments, the application interface of the mobile phone further displays indication information. The indication information indicates that the mobile phone is scanning for other devices nearby. It should be understood that the other devices are devices that have not established a communication connection with the mobile phone, or devices that previously established a communication connection with the mobile phone but have since been disconnected from the mobile phone.

[0195] It should be noted in Figure 16 that the application interface of the mobile phone further includes a device (e.g., a Bluetooth headset or an air purifier) ​​that is performing a service communication with the mobile phone. For example, a user may be listening to music or making a call using a Bluetooth headset.

[0196] In this embodiment, when a user needs to use a mobile phone to start any of the smart home devices, the application interface of the mobile phone will directly display the currently online devices. In this way, the user can use the mobile phone to directly start the devices, thereby saving the time for scanning online devices by the mobile phone, reducing the waiting time of the user, and improving the user experience.

[0197] An embodiment of this application provides an electronic device. The electronic device may include a memory and one or more processors. The memory is configured to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device may perform the functions or steps performed by the electronic device in the above method embodiments. For the structure of the electronic device, please refer to the structure of the electronic device 100 shown in FIG. 9.

[0198] An embodiment of this application further provides a chip system. As shown in Fig. 17, the chip system 1800 includes at least one processor 1801 and at least one interface circuit 1802. The processor 1801 may be the processor 110 shown in Fig. 9 in the above embodiment. The interface circuit 1802 may be, for example, an interface circuit between the processor 110 and an external memory 120, or an interface circuit between the processor 110 and an internal memory 121.

[0199] The processor 1801 and the interface circuit 1802 may be interconnected using a line. For example, the interface circuit 1802 may be configured to receive a signal from another device (e.g., a memory in the electronic device). In another example, the interface circuit 1802 may be configured to transmit a signal to another device (e.g., the processor 1801). For example, the interface circuit 1802 may read an instruction stored in a memory and send the instruction to the processor 1801. When the instruction is executed by the processor 1801, the electronic device is enabled to execute the steps executed by the mobile phone 180 in the above embodiment. Of course, the chip system may further include other separate devices. This is not particularly limited in the embodiment of this application.

[0200] An embodiment of this application further provides a computer storage medium, which includes computer instructions, which when executed on an electronic device, enable the electronic device to perform the functions or steps performed by the electronic device in the above method embodiments.

[0201] An embodiment of this application further provides a computer program product, which, when run on a computer, enables the computer to perform the functions or steps performed by the electronic device in the above method embodiments.

[0202] The above description of the implementation allows those skilled in the art to clearly understand that the above functional module division is made as an example for illustrative purposes for convenient and concise description. In actual application, the above functions can be allocated to different functional modules and implemented based on requirements, that is, the internal structure of the device is divided into different functional modules to implement all or part of the above-described functions.

[0203] In some embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the described device embodiments are merely examples. For example, the module or unit division is merely a logical division of functions, and may be divided in other ways in actual implementation. For example, multiple units or components may be combined or integrated into other devices, and some features may be omitted or not implemented. In addition, the shown or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electrical, mechanical, or other forms.

[0204] The units described as separate parts may or may not be physically separate, and the parts shown as units may be one or more physical units, located in one place or distributed in different places. Some or all of the units may be selected according to actual requirements to achieve the objectives of the solutions in the embodiments.

[0205] In addition, the functional units in the embodiments of this application may be integrated into one processing unit, each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0206] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a readable storage medium. Based on such understanding, the technical solutions in the embodiments of this application may be essentially implemented in the form of a software product, or the part that contributes to the prior art, or all or part of the technical solutions. The software product is stored in a storage medium and includes some instructions to instruct a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in the embodiments of this application. The storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0207] The above description is merely a specific implementation of this application, and is not intended to limit the protection scope of this application. Any variation or replacement within the technical scope disclosed in this application should fall within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A device networking method applied to a communication system, the communication system including a plurality of electronic devices, the method comprising: Establishing a first communication connection with a second electronic device by a first electronic device, the first communication connection including a first communication method and a second communication method between the first electronic device and the second electronic device; receiving, by the first electronic device, a packet transmitted by the second electronic device in the first communication manner during a first time period; adjusting, by the first electronic device, the first period based on a number of times the first electronic device receives the packet transmitted by the second electronic device; determining, by the first electronic device, based on the packets, that the first communication connection with the second electronic device is valid for a second period of time; executing, by the first electronic device, service communication with the second electronic device in the second communication method during the second period; A method comprising:

2. Prior to the step of receiving, by the first electronic device, a packet transmitted by the second electronic device in the first communication method during a first time period, the method further comprises: broadcasting or unicasting a request packet by the first electronic device in the first communication method or the second communication method during the first time period, the request packet indicating a request by the first electronic device to maintain the first communication connection with the second electronic device. The method of claim 1.

3. When the first communication connection is valid during the second period, the first electronic device holds connection information of the first communication connection; The step of executing service communication with the second electronic device by the first electronic device in the second communication method during the second period includes: resuming, by the first electronic device, the first communication connection established with the second electronic device based on the connection information, and performing service communication; The method of claim 1.

4. a priority of the first electronic device is higher than a priority of the second electronic device, the priority indicating a hardware performance of a device, the hardware performance of a device having a higher priority being higher than a hardware performance of a device having a lower priority, the hardware performance including one or more of processor performance, memory performance, hard disk performance, or network capability; Establishing, by a first electronic device, a first communication connection with a second electronic device, establishing, by the first electronic device, the first communication connection with the second electronic device and determining the priority of the second electronic device; The step of determining, by the first electronic device, based on the packets, that the first communication connection with the second electronic device is valid for a second time period, further comprising: determining, by the first electronic device based on the packets, that the first communication connection with the second electronic device is valid during the second time period when the priority of the first electronic device is higher than that of the second electronic device. The method of claim 1.

5. the first period is set periodically, and the first period is an initially set first period; The method comprises: determining by the first electronic device that the first electronic device should be disconnected from the second electronic device when the first electronic device does not receive a packet during the first period, the first period being a second time set; or determining by the first electronic device that the first electronic device should be disconnected from the second electronic device when the first electronic device does not receive a packet during a first period set for N consecutive first periods, where N>1; or determining, by the first electronic device, that the first electronic device should be disconnected from the second electronic device when the first time period and the second time period at least partially overlap and the first electronic device does not receive a packet during a first time period within the second time period. Further comprising: The method of claim 1.

6. The method comprises: and re-establishing, by the first electronic device, the first communication connection with the second electronic device when the first electronic device again performs service communication with the second electronic device. The method according to claim 5.

7. The packet includes one of a response packet, an inquiry packet, or a service packet. The method according to any one of claims 1 to 6.

8. The method comprises: and adjusting, by the first electronic device, the first period to a third period when the first electronic device remains in a static state during the first period and the number of times the first electronic device receives the packet transmitted by the second electronic device exceeds a first preset number of times, wherein a length of the third period exceeds a length of the first period. The method according to any one of claims 1 to 6.

9. The method comprises: and adjusting, by the first electronic device, the first period to a fourth period when the first electronic device is placed in a preset scenario during the first period and the number of times the first electronic device receives the packet transmitted by the second electronic device exceeds a second preset number of times, wherein a length of the fourth period is less than a length of the first period. The method according to any one of claims 1 to 6.

10. The method comprises: and returning the fourth period to the first period by the first electronic device when the preset scenario in which the first electronic device is placed changes, the change in the preset scenario including the first electronic device switching from a screen-off display to a screen-on display.

10. The method of claim 9.

11. The method comprises: and changing the fourth time period back to the first time period by the first electronic device when the preset scenario in which the first electronic device is located changes, the change in the preset scenario including a change in an utilization state of the first electronic device.

10. The method of claim 9.

12. The method comprises: rediscovering nearby devices and establishing the first communication connection by the first electronic device when the pre-configured scenario in which the first electronic device is located changes, the pre-configured scenario changes including absolute position change, spatial position change, and vehicle change; receiving, by the first electronic device, packets transmitted by the nearby device in the first communication method during the first time period; Further comprising:

10. The method of claim 9.

13. A device networking method applied to a communication system, the communication system including a plurality of electronic devices, the method comprising: Establishing a first communication connection with a second electronic device by a first electronic device, the first communication connection including a first communication method and a second communication method between the first electronic device and the second electronic device; receiving, by the first electronic device, a packet transmitted by the second electronic device in the first communication manner during a first time period; determining, by the first electronic device, based on the packets, that the first communication connection with the second electronic device is valid for a second period of time; executing, by the first electronic device, service communication with the second electronic device in the second communication method during the second period; said method comprising: when a last electronic device among all electronic devices that establish the first communication connection with the first electronic device is offline, rediscovering nearby devices by the first electronic device and establishing the first communication connection; receiving, by the first electronic device, packets transmitted by the nearby device in the first communication method during the first time period; The method further comprising:

14. A device networking method applied to a communication system, the communication system including a plurality of electronic devices, the method comprising: Establishing a first communication connection with a second electronic device by a first electronic device, the first communication connection including a first communication method and a second communication method between the first electronic device and the second electronic device; receiving, by the first electronic device, a packet transmitted by the second electronic device in the first communication manner during a first time period; determining, by the first electronic device, based on the packets, that the first communication connection with the second electronic device is valid for a second period of time; executing, by the first electronic device, service communication with the second electronic device in the second communication method during the second period; said method comprising: the method further comprising the step of, when a network condition of the communication system in which the plurality of electronic devices are located changes, sending a network change message to the second electronic device by the first electronic device to redetermine a physical communication method to be utilized when the first communication connection with the second electronic device is established.

15. The method comprises: determining a wake-up period of the first electronic device based on a periodic connection established by the first electronic device between a first application on the first electronic device and a cloud server of the first application, the first application being any application on the first electronic device; synchronizing, by the first electronic device, the wake-up period with the second electronic device, the wake-up period being the same as the first period that is periodically set; Further comprising: The method according to claim 5.

16. The method comprises: displaying, by the first electronic device, a first interface in response to a user's interaction with a second application, the first interface including at least one electronic device that maintains the first communication connection with the first electronic device, the at least one electronic device including the second electronic device; performing, by the first electronic device, service communication with the second electronic device in response to an operation of the user on the second electronic device; Further comprising: The method of claim 15.

17. the first interface further includes at least one electronic device that is disconnected from the first electronic device; 17. The method of claim 16.

18. The first interface further includes indication information, the indication information indicating that a third electronic device is being scanned; the third electronic device is a device of the plurality of electronic devices that is disconnected from the first electronic device, or the third electronic device is a device that initially establishes the first communication connection with the first electronic device; 18. The method according to claim 16 or 17.

19. The first electronic device includes a processor, the processor includes a plurality of processing cores, the plurality of processing cores including a low power core, and the method includes: receiving, by the first electronic device, a packet transmitted by the second electronic device during the first period utilizing the low power core; The method according to any one of claims 1 to 6.

20. An electronic device, the electronic device being a first electronic device, the electronic device comprising a memory and one or more processors, the memory storing computer program code, the computer program code comprising computer instructions, the computer instructions, when executed by the processor, enabling the electronic device to perform the method of any one of claims 1 to 6.

21. A computer readable storage medium comprising computer instructions, which when executed on an electronic device enable the electronic device to perform the method of any one of claims 1 to 6.

22. A computer program comprising computer instructions which, when executed on an electronic device, enable the electronic device to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Radio communication device, radio communication system, radio communication method, and program

    JP2010258619A

  • wireless communication system

    JP2017518657A

  • Device with radio communication function and program executed by the same

    JP2018032928A

  • Content distribution system and its control method

    WO2008120332A1

  • Method for reducing power consumption of mobile terminal and mobile terminal

    WO2021143314A1