Communication system, networking method, electronic device, and computer-readable storage medium

WO2025148357A8PCT designated stage expired Publication Date: 2025-08-07HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/116149
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-09
Filing Date
2024-08-30
Publication Date
2025-08-07

AI Technical Summary

Technical Problem

The existing ad hoc networking methods cannot meet the ad hoc networking needs in multiple accounts or multi-equipment scenarios such as home, industry, multi-person collaboration, and public equipment, resulting in poor user experience.

Method used

By carrying the group identifier, device account identifier and trusted device identifier to which the device belongs in the heartbeat discovery broadcast, the devices can match the group, account or device ID to determine whether to perform ad hoc networking and increase the number of devices on the ad hoc networking.

Benefits of technology

It effectively increases the number of devices on the ad hoc network, meets the needs of ad hoc network in multiple accounts or multiple device scenarios, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024116149_07082025_PF_FP_ABST
    Figure CN2024116149_07082025_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applicable to the technical field of communications, and relates in particular to a communication system, a networking method, an electronic device, and a computer-readable storage medium. In the method, a first device broadcasts a first heartbeat discovery broadcast comprising a first identifier indicating a group to which the first device belongs, a second identifier indicating an account of the first device, and a third identifier indicating a trusted device corresponding to the first device, such that after receiving the first heartbeat discovery broadcast, a second device can match at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier to obtain a first matching result, and, on the basis of the first matching result, process the first heartbeat discovery broadcast. That is, inter-device matching can be performed by means of any one of a group, an account, or a device ID, so as to determine whether to form an ad-hoc network, such that the number of devices of an ad-hoc network can be effectively increased, thereby meeting the need to form an ad-hoc network in multi-account or multi-device scenarios such as in a home, industry, multi-party cooperation, and public equipment, and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Communication system, networking method, electronic device and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 9, 2024, with application number 202410040118.0 and application name “Communication system, networking method, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application belongs to the field of communication technology, and in particular relates to a communication system, a networking method, an electronic device, and a computer-readable storage medium. Background Art

[0003] Self-organizing networks generally include several stages such as discovery, connection, authentication, and information exchange. In the discovery stage, the sender can broadcast a heartbeat discovery broadcast, which can carry the sender's account identity (ID) and trusted device ID. After receiving the heartbeat discovery broadcast, the receiver can match its own account ID with the account ID in the heartbeat discovery broadcast, or match its own device ID with the trusted device ID in the heartbeat discovery broadcast to determine whether to conduct a self-organizing network with the receiver. Among them, only when the receiver's own account ID matches the account ID in the heartbeat discovery broadcast, or its own device ID matches the trusted device ID in the heartbeat discovery broadcast, will the receiver conduct the subsequent self-organizing network process with the sender.

[0004] With the continuous development of multi-device collaboration technology, more and more devices require self-organizing networks. The existing self-organizing network methods cannot meet the self-organizing network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, resulting in poor user experience.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a communication system, a networking method, an electronic device, and a computer-readable storage medium, which can effectively increase the number of devices in a self-organizing network, meet the needs of self-organizing networks in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0007] In the first aspect, an embodiment of the present application provides a communication system, including a first device and a second device, the first device being used to broadcast a first heartbeat discovery broadcast, the first heartbeat discovery broadcast including a first identifier, a second identifier and a third identifier, the first identifier being used to indicate the group to which the first device belongs, the second identifier being used to indicate the account of the first device, and the third identifier being used to indicate the trusted device corresponding to the first device; the second device being used to receive the first heartbeat discovery broadcast and match at least one of the first identifier, the second identifier and the third identifier with a fourth identifier to obtain a first matching result, the fourth identifier being used to indicate at least one of the group to which the second device belongs, the account of the second device and the device identity ID of the second device; the second device being further used to process the first heartbeat discovery broadcast according to the first matching result.

[0008] The first matching result includes a match and a mismatch. When the first matching result is a match, the second device may send a connection request to the first device, where the connection request is used to request to establish a connection with the first device. When the first matching result is a mismatch, the second device may discard the first heartbeat discovery broadcast.

[0009] In the communication system provided above, when networking is required, the first device can broadcast a first heartbeat discovery broadcast including a first identifier indicating the group to which the first device belongs, a second identifier indicating the account of the first device, and a third identifier indicating the trusted device corresponding to the first device, so that after the second device receives the first heartbeat discovery broadcast, it can match the fourth identifier according to at least one of the first identifier, the second identifier, and the third identifier to obtain a first matching result, and process the first heartbeat discovery broadcast according to the first matching result. That is, devices can be matched by any one of the group, account, or device ID to determine whether to conduct a self-organized network, which can effectively increase the number of devices in the self-organized network, meet the self-organized network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0010] In particular, when the fourth identifier is used to indicate one of the group to which the second device belongs, the account number of the second device, or the device ID of the second device, a match may refer to a match between the fourth identifier and the first identifier, or a match between the fourth identifier and the second identifier, or a match between the fourth identifier and the third identifier. A mismatch may refer to a mismatch between the fourth identifier and the first identifier, or a mismatch between the fourth identifier and the second identifier, or a mismatch between the fourth identifier and the third identifier.

[0011] For example, when the fourth identifier is used to indicate the group to which the second device belongs, a match may mean that the group indicated by the fourth identifier is the same as the group indicated by the first identifier, and a mismatch may mean that the group indicated by the fourth identifier is different from the group indicated by the first identifier. For example, when the fourth identifier is used to indicate the account number of the second device, a match may mean that the account number indicated by the fourth identifier is the same as the account number indicated by the second identifier, and a mismatch may mean that the account number indicated by the fourth identifier is different from the account number indicated by the second identifier. For example, when the fourth identifier is used to indicate the device ID of the second device, a match may mean that the device ID indicated by the fourth identifier is one of the trusted devices indicated by the third identifier, and a mismatch may mean that the device ID indicated by the fourth identifier is not among the trusted devices indicated by the third identifier.

[0012] In certain implementations of the first aspect, when the fourth identifier is used to indicate multiple of the group to which the second device belongs, the account number of the second device, or the device ID of the second device, the second device may respectively match each of the fourth identifiers with the first identifier, the second identifier, or the third identifier. When one of the multiple identifiers indicated by the fourth identifier matches the first identifier, the second identifier, or the third identifier, the first matching result is a match. Otherwise, the first matching result is a mismatch.

[0013] For example, when the fourth identifier is used to indicate the group to which the second device belongs and the account of the second device, the second device can match the group indicated by the fourth identifier with the first identifier, and can match the account indicated by the fourth identifier with the second identifier. When the group indicated by the fourth identifier is the same as the group indicated by the first identifier, or when the account indicated by the fourth identifier is the same as the account indicated by the second identifier, the first matching result is a match. Otherwise, the first matching result is a mismatch.

[0014] Optionally, when the fourth identifier is used to indicate multiple of the group to which the second device belongs, the account number of the second device, or the device ID of the second device, the second device may perform matching according to a preset matching order. If a matching result is found in a particular match, the second device may not perform subsequent matching, thereby improving matching efficiency.

[0015] The preset matching order can be determined based on the actual scenario, and the embodiments of the present application do not impose specific limitations on this. For example, the preset matching order can be determined based on the actual scenario as: group-account-device ID. For example, the preset matching order can be determined based on the actual scenario as: account-group-device ID, etc.

[0016] For example, in an application scenario where the preset matching order is: group-account-device ID, when the fourth identifier indicates the group to which the second device belongs, the account number of the second device, and the device ID of the second device, the second device may match the group indicated by the fourth identifier with the first identifier. If the group indicated by the fourth identifier is the same as the group indicated by the first identifier, the second device may directly determine that the first matching result is a match without further matching the account number and device ID. If the group indicated by the fourth identifier is different from the group indicated by the first identifier, the second device may continue to match the account number indicated by the fourth identifier with the second identifier. If the account number indicated by the fourth identifier is the same as the account number indicated by the second identifier, the second device may directly determine that the first matching result is a match without further matching the device ID. If the account number indicated by the fourth identifier is different from the account number indicated by the second identifier, the second device may continue to match the device ID indicated by the fourth identifier with the third identifier. If the device ID indicated by the fourth identifier is one of the trusted devices indicated by the third identifier, the second device may determine that the first matching result is a match. Otherwise, the second device may determine that the first matching result is a mismatch.

[0017] In certain implementations of the first aspect, the first device is further used to send an authentication request to the second device after establishing a connection with the second device based on the connection request, and the authentication request is used to perform authentication between the first device and the second device; the second device is further used to save the device ID of the first device to a filtering list when it is determined that the authentication between the first device and the second device has failed.

[0018] In the communication system provided by this implementation, a filter list for the first heartbeat discovery broadcast may be provided in the second device. When it is determined that there is a misidentification (i.e., authentication failure), the second device may store the first device in the filter list, for example, the device ID of the first device may be stored in the filter list. Subsequently, when the second device receives the first heartbeat discovery broadcast broadcasted by the first device again, the second device may not respond to the first heartbeat discovery broadcast, so that the misidentification only causes the first false wake-up of the first device, thereby effectively reducing the false wake-up of the first device, and can reduce invalid response broadcasts, thereby improving the user experience.

[0019] That is, after receiving the first heartbeat discovery broadcast from the first device, the second device can first determine whether the first device is on the filter list. If the first device is on the filter list, the second device may not respond to the first heartbeat discovery broadcast, for example, it may discard the first heartbeat discovery broadcast, i.e., it may not wake up the first device. If the first device is not on the filter list, the second device may respond to the first heartbeat discovery broadcast, i.e., it may wake up the second device, and then connect, authenticate, exchange information, and other networking processes with the first device.

[0020] In certain implementations of the first aspect, the first identifier is obtained by compressing and truncating the group ID of the group to which the first device belongs; and / or, the second identifier is obtained by compressing and truncating the account ID of the first device; and / or, the third identifier is obtained by compressing and truncating the device ID of the trusted device.

[0021] In the communication system provided by this implementation, in order to increase the number of devices in the self-organizing network and improve the user experience, the first device can compress one or more of the group ID, account ID and trusted device ID respectively to obtain compressed data, and intercept the compressed data to obtain the final group ID indicated by the first identifier, the final account ID indicated by the second identifier or the final trusted device ID indicated by the third identifier, thereby reducing the storage space occupied by the group ID, account ID or trusted device ID, and increasing the capacity of the characteristic value that can be carried by the payload in the first heartbeat discovery broadcast, so that the first heartbeat discovery broadcast can have a larger carrying capacity to meet the self-organizing network requirements in multi-account or multi-device scenarios.

[0022] Exemplarily, the first device may compress the group ID to obtain compressed data corresponding to the group ID (e.g., compressed data A), and may intercept the last M1 bits of the compressed data A as the final group ID to reduce the storage space occupied by the group ID. Alternatively, the first device may compress the account ID to obtain compressed data corresponding to the account ID (e.g., compressed data B), and may intercept the last M2 bits of the compressed data B as the final account ID to reduce the storage space occupied by the account ID. Alternatively, the first device may compress the trusted device ID to obtain compressed data corresponding to the trusted device ID (e.g., compressed data C), and may intercept the last M3 bits of the compressed data C as the final trusted device ID to reduce the storage space occupied by the trusted device ID.

[0023] In one example, the first device can compress the group ID, account ID or trusted device ID through a hash operation to obtain a hash value corresponding to the group ID (for example, hash value A), a hash value corresponding to the account ID (for example, hash value B) or a hash value corresponding to the trusted device ID (for example, hash value C), so that the final group ID, the final account ID or the final trusted device ID can be obtained based on hash value A, hash value B or hash value C.

[0024] For example, the last M1 bits of hash value A can be intercepted as the final group ID. For example, the last M2 bits of hash value B can be intercepted as the final account ID. For example, the last M3 bits of hash value C can be intercepted as the final trusted device ID.

[0025] In another example, the first device can compress the group ID, account ID or trusted device ID through a Bloom filter to obtain compressed data A corresponding to the group ID, compressed data B corresponding to the account ID or compressed data C corresponding to the trusted device ID, so that the final group ID, final account ID or final trusted device ID can be obtained based on the compressed data A, compressed data B or compressed data C.

[0026] For example, the last M1 bits of compressed data A can be intercepted as the final group ID. For example, the last M2 bits of compressed data B can be intercepted as the final account ID. For example, the last M3 bits of compressed data C can be intercepted as the final trusted device ID.

[0027] In certain implementations of the first aspect, the communication system further includes a third device;

[0028] The first device is further used to determine the survival time of the service, the third device, and the status response time interval corresponding to the third device according to the service running on the first device, and send a second heartbeat discovery broadcast to the third device, where the second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service and the status response time interval corresponding to the third device;

[0029] The third device is used to receive the second heartbeat discovery broadcast, and after networking with the first device according to the second heartbeat discovery broadcast, report the service status of the third device to the first device according to the status response time interval within the survival time of the service.

[0030] In the communication system provided by this implementation, the first device can conduct a business-level self-organizing network with the third device based on the business it runs, so as to truly start from the business on the demand side and conduct on-demand networking, which can eliminate a large amount of power consumption caused by invalid device-level heartbeat discovery broadcasts. The time when the third device participates in the networking can be determined according to the time of the business service in the first device, that is, the third device only needs to report the service status (i.e. broadcast) within the service time of the business, and does not need to broadcast the service status periodically, which can reduce the power consumption of the third device, so that low-power devices (such as smart headphones, smart speakers, etc.) can also participate in the self-organizing network, and the types of devices participating in the self-organizing network can be expanded. In addition, the third device can actively report the service status to the first device according to the status response time interval within the business service time, which can effectively solve the problem of false online.

[0031] The service may refer to an application running on the first device. The service duration may refer to the running time of the application. The service lifetime indicated in the second heartbeat discovery broadcast may be determined by the first device based on the running service. For example, it may be determined to be any value such as 60 seconds, 100 seconds, or 120 seconds.

[0032] In some implementations of the first aspect, the communication system further includes a fourth device;

[0033] The fourth device is configured to broadcast a third heartbeat discovery broadcast, the third heartbeat discovery broadcast including a sixth identifier, a seventh identifier, and an eighth identifier, the sixth identifier being configured to indicate a group to which the fourth device belongs, the seventh identifier being configured to indicate an account number of the fourth device, and the eighth identifier being configured to indicate a trusted device corresponding to the fourth device;

[0034] The second device is also used to receive the third heartbeat discovery broadcast and match at least one of the sixth identifier, the seventh identifier and the eighth identifier with the fourth identifier; determine that the fourth identifier does not match the sixth identifier, the fourth identifier does not match the seventh identifier, and the fourth identifier does not match the eighth identifier, and discard the first heartbeat discovery broadcast.

[0035] In a second aspect, an embodiment of the present application provides a networking method, including:

[0036] The first device generates a first heartbeat discovery broadcast, where the first heartbeat discovery broadcast includes a first identifier, a second identifier, and a third identifier, where the first identifier is used to indicate a group to which the first device belongs, the second identifier is used to indicate an account number of the first device, and the third identifier is used to indicate a trusted device corresponding to the first device;

[0037] The first device broadcasts the first heartbeat discovery broadcast.

[0038] In the networking method provided above, when networking is required, the first device can broadcast a first heartbeat discovery broadcast including a first identifier indicating the group to which the first device belongs, a second identifier indicating the account of the first device, and a third identifier indicating the trusted device corresponding to the first device, so that after the second device receives the first heartbeat discovery broadcast, it can match the fourth identifier according to at least one of the first identifier, the second identifier, and the third identifier to obtain a first matching result, and process the first heartbeat discovery broadcast according to the first matching result. That is, devices can be matched by any one of the group, account, or device ID to determine whether to conduct a self-organizing network, which can effectively increase the number of devices in the self-organizing network, meet the self-organizing network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0039] In certain implementations of the second aspect, the method further includes:

[0040] The first device obtains the group ID to which the first device belongs, and compresses the group ID to which the first device belongs to obtain first compressed data;

[0041] The first device intercepts the last M1 bits of the first compressed data as the first identifier.

[0042] In certain implementations of the second aspect, the method further includes:

[0043] The first device obtains the account ID of the first device and compresses the account ID of the first device to obtain second compressed data;

[0044] The first device intercepts the last M2 bits of the second compressed data as the second identifier.

[0045] In certain implementations of the second aspect, the method further includes:

[0046] The first device obtains, by the first device, a device ID of a trusted device corresponding to the first device, and compresses the device ID of the trusted device to obtain third compressed data;

[0047] The first device intercepts the last M3 bits of the third compressed data as the third identifier.

[0048] In the networking method provided by this implementation, by compressing and truncating at least one of the group ID, account ID or trusted device ID, the storage space occupied by each group ID, each account ID or each trusted device ID in the first heartbeat discovery broadcast can be effectively reduced, so that the first heartbeat discovery broadcast can carry more group IDs, account IDs or trusted device IDs, thereby improving the carrying capacity of the first heartbeat discovery broadcast, ensuring that more devices can participate in the self-organizing network, increasing the number of devices in the self-organizing network, meeting the networking needs in multi-account or multi-device scenarios, and improving the user experience.

[0049] In certain implementations of the second aspect, the method further includes:

[0050] The first device determines the survival time of the service, the third device and the status response time interval corresponding to the third device based on the service running on the first device, and sends a second heartbeat discovery broadcast to the third device. The second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service and the status response time interval corresponding to the third device.

[0051] In a third aspect, an embodiment of the present application provides a networking method, including:

[0052] The second device receives a first heartbeat discovery broadcast from the first device, where the first heartbeat discovery broadcast includes a first identifier, a second identifier, and a third identifier, where the first identifier is used to indicate a group to which the first device belongs, the second identifier is used to indicate an account number of the first device, and the third identifier is used to indicate a trusted device corresponding to the first device;

[0053] The second device matches at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier, where the fourth identifier is used to indicate at least one of a group to which the second device belongs, an account number of the second device, and a device ID of the second device;

[0054] The second device determines that the fourth identifier matches the first identifier, and sends a connection request to the first device, where the connection request is used to request to establish a connection with the first device.

[0055] In the networking method provided above, when networking is required, the first device can broadcast a first heartbeat discovery broadcast including a first identifier indicating the group to which the first device belongs, a second identifier indicating the account of the first device, and a third identifier indicating the trusted device corresponding to the first device, so that after the second device receives the first heartbeat discovery broadcast, it can match the fourth identifier according to at least one of the first identifier, the second identifier, and the third identifier to obtain a first matching result, and process the first heartbeat discovery broadcast according to the first matching result. That is, devices can be matched by any one of the group, account, or device ID to determine whether to conduct a self-organizing network, which can effectively increase the number of devices in the self-organizing network, meet the self-organizing network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0056] In certain implementations of the third aspect, the method further includes:

[0057] The second device receives the authentication request sent by the first device and performs authentication with the first device, wherein the authentication request is sent by the first device to the second device after the first device establishes a connection with the second device based on the connection request;

[0058] When it is determined that the authentication between the first device and the second device fails, the second device saves the device ID of the first device to a filtering list.

[0059] In certain implementations of the third aspect, the method further includes:

[0060] The second device obtains at least one of a group ID to which the second device belongs, an account ID of the second device, and a device ID of the second device;

[0061] The second device compresses at least one of the group ID to which the second device belongs, the account ID of the second device, and the device ID of the second device to obtain compressed data, and determines the fourth identifier according to the compressed data.

[0062] In the networking method provided by this implementation, when the first identifier is an identifier obtained by compressing and truncating the group ID to which the first device belongs, and the fourth identifier is used to represent the group to which the second device belongs, the fourth identifier can be an identifier obtained by compressing the group ID to which the second device belongs, or it can be an identifier obtained by compressing and truncating the group ID to which the second device belongs, so that the fourth identifier can be accurately matched with the first identifier to ensure a matching effect.

[0063] In an embodiment of the present application, the fourth identifier can be obtained by compressing the group ID to which the second device belongs. Alternatively, the cloud can compress the group ID to which the second device belongs and send the resulting compressed group ID to the second device. Similarly, truncation of the compressed data corresponding to the group ID to which the second device belongs can be performed by the second device or performed by the cloud and then sent to the second device.

[0064] The fourth identifier is obtained by compressing the group ID to which the second device belongs in the same manner as the aforementioned method for compressing the group ID to which the first device belongs. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs using hash method A, the second device or the cloud may also compress the group ID to which the second device belongs using hash method A to obtain the fourth identifier. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs using Bloom filter A, the second device or the cloud may also compress the group ID to which the second device belongs using Bloom filter A to obtain the fourth identifier.

[0065] In some implementations of the third aspect, the second device determining the fourth identifier according to the compressed data includes:

[0066] The second device intercepts the last N bits of the compressed data as the fourth identifier.

[0067] When the fourth identifier is used to indicate the group to which the second device belongs, N may be the same as or different from the aforementioned M1. When the fourth identifier is used to indicate the account number of the second device, N may be the same as or different from the aforementioned M2. When the fourth identifier is used to indicate the device ID of the second device, N may be the same as or different from the aforementioned M3.

[0068] In one example, when N is different from the aforementioned M1, the second device may use a backward matching algorithm to match the first identifier with the fourth identifier based on the minimum length. The minimum length may be understood as the minimum length of the first identifier and the fourth identifier, that is, the smaller value of N and M1.

[0069] For example, when N>M1, the second device can match the last M1 bits of the fourth identifier with the content of the first identifier to obtain a first matching result. If N<M1, the second device can match the content of the fourth identifier with the content of the last N bits of the first identifier to obtain a first matching result.

[0070] In certain implementations of the third aspect, the method further includes:

[0071] The second device receives a second heartbeat discovery broadcast from the first device; wherein the second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service running on the first device and the status response time interval corresponding to the second device;

[0072] The second device reports the service status of the second device to the first device according to the status response time interval within the survival time of the service.

[0073] In certain implementations of the third aspect, the method further includes:

[0074] The second device receives a third heartbeat discovery broadcast from a third device, where the third heartbeat discovery broadcast includes a sixth identifier, a seventh identifier, and an eighth identifier, where the sixth identifier is used to indicate a group to which the third device belongs, the seventh identifier is used to indicate an account number of the third device, and the eighth identifier is used to indicate a trusted device corresponding to the third device;

[0075] The second device matches at least one of the sixth identifier, the seventh identifier, and the eighth identifier with the fourth identifier;

[0076] The second device determines that the fourth identifier does not match the sixth identifier, the fourth identifier does not match the seventh identifier, and the fourth identifier does not match the eighth identifier, and discards the third heartbeat discovery broadcast.

[0077] In a fourth aspect, an embodiment of the present application provides a networking device, including:

[0078] a processing module, configured to generate a first heartbeat discovery broadcast, wherein the first heartbeat discovery broadcast includes a first identifier, a second identifier, and a third identifier, wherein the first identifier is used to indicate a group to which the first device belongs, the second identifier is used to indicate an account number of the first device, and the third identifier is used to indicate a trusted device corresponding to the first device;

[0079] The transceiver module is used to broadcast the first heartbeat discovery broadcast.

[0080] In certain implementations of the fourth aspect, the processing module is further used to obtain the group ID to which the first device belongs, and compress the group ID to which the first device belongs to obtain first compressed data; and intercept the content of the last M1 bits of the first compressed data as the first identifier.

[0081] In certain implementations of the fourth aspect, the processing module is further used to obtain the account ID of the first device, and compress the account ID of the first device to obtain second compressed data; and intercept the content of the last M2 bits of the second compressed data as the second identifier.

[0082] In certain implementations of the fourth aspect, the processing module is further used to obtain the device ID of the trusted device corresponding to the first device, and compress the device ID of the trusted device to obtain third compressed data; and intercept the content of the last M3 bits of the third compressed data as the third identifier.

[0083] In certain implementations of the fourth aspect, the processing module is also used to determine the survival time of the service, the third device, and the status response time interval corresponding to the third device based on the service running on the first device, and send a second heartbeat discovery broadcast to the third device, the second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service and the status response time interval corresponding to the third device.

[0084] In a fifth aspect, an embodiment of the present application provides a networking device, including:

[0085] a transceiver module, configured to receive a first heartbeat discovery broadcast from a first device, wherein the first heartbeat discovery broadcast includes a first identifier, a second identifier, and a third identifier, wherein the first identifier is used to indicate a group to which the first device belongs, the second identifier is used to indicate an account number of the first device, and the third identifier is used to indicate a trusted device corresponding to the first device;

[0086] A processing module, used to match at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier, where the fourth identifier is used to indicate at least one of the group to which the second device belongs, the account number of the second device, and the device ID of the second device; determine that the fourth identifier matches the first identifier; and send a connection request to the first device, where the connection request is used to request to establish a connection with the first device.

[0087] In the networking method provided above, when networking is required, the first device can broadcast a first heartbeat discovery broadcast including a first identifier indicating the group to which the first device belongs, a second identifier indicating the account of the first device, and a third identifier indicating the trusted device corresponding to the first device, so that after the second device receives the first heartbeat discovery broadcast, it can match the fourth identifier according to at least one of the first identifier, the second identifier, and the third identifier to obtain a first matching result, and process the first heartbeat discovery broadcast according to the first matching result. That is, devices can be matched by any one of the group, account, or device ID to determine whether to conduct a self-organizing network, which can effectively increase the number of devices in the self-organizing network, meet the self-organizing network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0088] In some implementations of the fifth aspect, the transceiver module is further configured to receive an authentication request sent by the first device, where the authentication request is sent by the first device to the second device after the first device establishes a connection with the second device based on the connection request;

[0089] The processing module is configured to perform authentication with the first device; and when it is determined that the authentication between the first device and the second device fails, save the device ID of the first device to a filtering list.

[0090] In certain implementations of the fifth aspect, the processing module is further used to obtain at least one of the group ID to which the second device belongs, the account ID of the second device, and the device ID of the second device; compress at least one of the group ID to which the second device belongs, the account ID of the second device, and the device ID of the second device to obtain compressed data, and determine the fourth identifier based on the compressed data.

[0091] In certain implementations of the fifth aspect, the processing module is further configured to intercept the last N bits of the compressed data as the fourth identifier.

[0092] In certain implementations of the fifth aspect, the transceiver module is further configured to receive a second heartbeat discovery broadcast from the first device; wherein the second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service running on the first device and the status response time interval corresponding to the second device;

[0093] The processing module is further configured to report the service status of the second device to the first device according to the status response time interval within the survival time of the service.

[0094] In certain implementations of the fifth aspect, the transceiver module is further configured to receive a third heartbeat discovery broadcast from a third device, where the third heartbeat discovery broadcast includes a sixth identifier, a seventh identifier, and an eighth identifier, where the sixth identifier is used to indicate a group to which the third device belongs, the seventh identifier is used to indicate an account number of the third device, and the eighth identifier is used to indicate a trusted device corresponding to the third device.

[0095] The processing module is also used to match at least one of the sixth identifier, the seventh identifier and the eighth identifier with the fourth identifier; determine that the fourth identifier does not match the sixth identifier, the fourth identifier does not match the seventh identifier, and the fourth identifier does not match the eighth identifier, and discard the third heartbeat discovery broadcast.

[0096] In the sixth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the electronic device implements the networking method described in any one of the second aspects above, or implements the networking method described in any one of the third aspects above.

[0097] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a computer, the computer implements the networking method described in any one of the second aspects above, or implements the networking method described in any one of the third aspects above.

[0098] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the networking method described in any one of the second aspects above, or implements the networking method described in any one of the third aspects above.

[0099] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] FIG1 is an example diagram of a heartbeat discovery broadcast;

[0101] FIG2 is a schematic diagram of the structure of a mobile phone to which the networking method provided in an embodiment of the present application is applicable;

[0102] FIG3 is a schematic diagram of a software architecture to which the networking method provided in an embodiment of the present application is applicable;

[0103] FIG4 is a schematic diagram of the structure of a communication system applicable to a personal scenario provided in an embodiment of the present application;

[0104] FIG5 is a schematic structural diagram of a communication system applicable to a home scenario provided in an embodiment of the present application;

[0105] FIG6 is a schematic diagram of the structure of a communication system applicable to industrial scenarios provided in an embodiment of the present application;

[0106] FIG7 is an example diagram of a network topology structure obtained by an ad hoc network;

[0107] FIG8 is a flow chart of a networking method provided in an embodiment of the present application;

[0108] FIG9 is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0109] FIG10 is a flow chart of a service-level self-organizing network method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0110] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0111] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0112] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0113] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0114] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0115] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0116] The steps involved in the networking method provided in the embodiments of the present application are merely examples. Not all steps are mandatory, nor are all information or messages required. These steps can be added or removed as needed during use. The same step or steps or messages with the same function in different embodiments of the present application can be referenced and learned from each other.

[0117] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field will know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0118] Ad hoc networks generally include stages such as discovery, connection, authentication, and information exchange.

[0119] During the discovery phase, the sender can broadcast a heartbeat discovery broadcast. For example, as shown in Figure 1, the heartbeat discovery broadcast can carry the sender's account ID (i.e., the local account ID shown in Figure 1) and the trusted device ID. If there are multiple trusted devices, the trusted device IDs carried in the heartbeat discovery broadcast can be a list of trusted device IDs. Furthermore, the heartbeat discovery broadcast can also include the sender's device ID (i.e., the local device ID shown in Figure 1).

[0120] After receiving the heartbeat discovery broadcast, the receiver can match its own account ID with the account ID in the heartbeat discovery broadcast to determine whether to establish an ad hoc network with the receiver, that is, a same-account ad hoc network. Alternatively, the receiver can match its own device ID with the trusted device ID in the heartbeat discovery broadcast to determine whether to establish an ad hoc network with the receiver, that is, a different-account ad hoc network.

[0121] When the receiver's own account ID matches the account ID in the heartbeat discovery broadcast, or when the receiver's own device ID matches the trusted device ID in the heartbeat discovery broadcast, the receiver will proceed with the subsequent self-organizing network process with the sender, such as connection, authentication, and information exchange with the sender.

[0122] In other words, the aforementioned ad hoc networking method only supports ad hoc networking based on the same account or based on a trusted device ID. However, with the continuous development of multi-device collaboration technology, more and more devices require ad hoc networking, and the scenarios requiring ad hoc networking are becoming increasingly complex. This ad hoc networking method that only supports ad hoc networking based on the same account or trusted device ID cannot meet the ad hoc networking needs of multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public equipment, resulting in a poor user experience.

[0123] In order to solve the above problems, the embodiments of the present application provide a communication system, a networking method, an electronic device and a computer-readable storage medium. The communication system includes a first device and a second device. When networking is required, the first device can broadcast a heartbeat discovery broadcast. The heartbeat discovery broadcast may include a first identifier, a second identifier and a third identifier. The first identifier can be used to indicate the group to which the first device belongs, the second identifier is used to indicate the account of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device. After the second device receives the heartbeat discovery broadcast, it can match at least one of the first identifier, the second identifier and the third identifier with the fourth identifier to obtain a first matching result, and process the first heartbeat discovery broadcast based on the first matching result. The fourth identifier is used to indicate at least one of the group to which the second device belongs, the account of the second device or the device ID of the second device. That is, devices can be matched by any one of the group, account or device ID to determine whether to conduct a self-organizing network, which can effectively increase the number of devices in the self-organizing network, meet the self-organizing network needs in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0124] The first device or the second device involved in the embodiments of the present application can be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart TV, a smart speaker, a smart headset, and a desktop computer, etc. The embodiments of the present application do not impose any restrictions on the specific type of the first device or the second device.

[0125] The following will take the example that the first device and the second device are both mobile phones to exemplify the first device or the second device involved in the embodiment of the present application. Please refer to Figure 2, which shows a schematic structural diagram of a mobile phone 200.

[0126] The mobile phone 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, and a display screen 290, etc.

[0127] Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

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

[0129] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0130] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0131] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

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

[0133] USB port 230 is an interface that complies with USB standards and may be a Mini USB port, a Micro USB port, a USB Type-C port, or the like. USB port 230 can be used to connect a charger to charge mobile phone 200 and to transfer data between mobile phone 200 and peripheral devices. It can also be used to connect headphones to play audio. This port can also be used to connect other mobile phones, such as AR devices.

[0134] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative illustration and does not constitute a structural limitation on the mobile phone 200. In other embodiments of the present application, the mobile phone 200 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0135] The charging management module 240 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 can receive charging input from the wired charger via the USB interface 230. In some wireless charging embodiments, the charging management module 240 can receive wireless charging input via the wireless charging coil of the mobile phone 200. While charging the battery 242, the charging management module 240 can also provide power to the mobile phone 200 via the power management module 241.

[0136] The power management module 241 is used to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 and provides power to the processor 210, the internal memory 221, the display 290, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 241 can also be provided in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be provided in the same device.

[0137] The wireless communication function of the mobile phone 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.

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

[0139] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the mobile phone 200. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0140] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 290. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

[0141] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 200. The wireless communication module 260 can be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0142] In some embodiments, the antenna 1 of the mobile phone 200 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the mobile phone 200 can communicate with the network and other devices through 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-CDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The 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).

[0143] Mobile phone 200 implements display functions through a GPU, display screen 290, and an application processor. The GPU is a microprocessor for image processing that connects display screen 290 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0144] Display screen 290 is used to display images, videos, and the like. Display screen 290 includes a display panel. The display panel can be made of materials such as a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, mobile phone 200 may include one or N display screens 290, where N is a positive integer greater than one.

[0145] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the mobile phone 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0146] Video codecs are used to compress or decompress digital video. Mobile phone 200 may support one or more video codecs. This allows mobile phone 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0147] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in the mobile phone 200, such as image recognition, face recognition, voice recognition, and text comprehension.

[0148] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 200. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

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

[0150] The mobile phone 200 can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0151] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 270 can also be used to encode and decode audio signals. In some embodiments, the audio module 270 can be provided in the processor 210, or some functional modules of the audio module 270 can be provided in the processor 210.

[0152] The speaker 270A, also called a "horn," is used to convert audio electrical signals into sound signals. The mobile phone 200 can listen to music or make hands-free calls through the speaker 270A.

[0153] The receiver 270B, also called the "earpiece", is used to convert the audio electrical signal into a sound signal. When the mobile phone 200 receives a call or a voice message, the voice can be heard by placing the receiver 270B close to the ear.

[0154] The microphone 270C, also known as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 270C to input the sound signal into the microphone 270C. The mobile phone 200 can be provided with at least one microphone 270C. In other embodiments, the mobile phone 200 can be provided with two microphones 270C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the mobile phone 200 can also be provided with three, four or more microphones 270C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.

[0155] The earphone jack 270D is used to connect a wired earphone and can be a USB interface 230 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0156] The software system of the mobile phone 200 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. For example, the software system of the mobile phone 200 can adopt a layered architecture Android operating system (OS), Hongmeng operating system (Harmony OS) or IOS, etc. The embodiment of the present application takes the layered architecture Android system as an example to illustrate the software structure of the mobile phone 200.

[0157] FIG3 is a block diagram of the software structure of the mobile phone 200 according to an embodiment of the present application.

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

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

[0160] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

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

[0162] As shown in FIG3 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

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

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

[0165] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0166] The phone manager is used to provide communication functions of the mobile phone 200, such as management of call status (including answering, hanging up, etc.).

[0167] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0168] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the phone, or flashing indicator lights.

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

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

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

[0172] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

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

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

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

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

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

[0178] The networking method provided in the embodiments of the present application can be applied to personal scenarios, home scenarios, and industrial scenarios.

[0179] The following describes the communication system to which the networking method provided in the embodiment of the present application is applicable in combination with different scenarios.

[0180] Please refer to Figure 4, which shows a schematic structural diagram of a communication system suitable for personal scenarios provided in an embodiment of the present application.

[0181] As shown in Figure 4, communication system 400 may include core network equipment 410, at least one access network equipment 420, and at least one electronic device, such as a mobile phone 431, a smart TV 432, a tablet computer 433, a laptop computer 434, a smart watch 435, a smart headset 436, and a tablet computer 437. The electronic device may be directly or indirectly connected to access network equipment 420 for communication. Access network equipment 420 may be directly or indirectly connected to core network equipment 410 for network access.

[0182] The present embodiment does not impose any specific restrictions on the communication method between the access network device 420 and the core network device 410. For example, the access network device 420 can establish a wireless link with the core network device 410 through the gateway 411, or the access network device 420 can directly establish a wireless link with the core network device 410.

[0183] Similarly, the embodiment of the present application does not impose any specific restrictions on the communication method between the electronic device and the access network device 420.

[0184] In some embodiments, the electronic device may directly establish a wireless link with the access network device 420 .

[0185] For example, as shown in FIG. 4 , the mobile phone 431 may directly establish a wireless link with the access network device 420 to implement communication between the mobile phone 431 and the access network device 420 .

[0186] In other embodiments, the electronic device may establish a wireless link with the access network device 420 through the router 440 and the firewall 450 .

[0187] For example, as shown in FIG4 , a mobile phone 431 , a smart TV 432 , a tablet computer 433 , a laptop computer 434 , and a tablet computer 437 may establish wireless links with an access network device 420 through a router 440 and a firewall 450 .

[0188] The present embodiment does not impose any specific restrictions on the communication method between mobile phone 431, smart TV 432, tablet computer 433, laptop computer 434, and tablet computer 437 and router 440. For example, mobile phone 431, smart TV 432, tablet computer 433, laptop computer 434, and tablet computer 437 can each communicate with router 440 via a Wi-Fi network.

[0189] In other embodiments, the electronic device may establish a wireless link with the access network device 420 through an intermediate device.

[0190] For example, as shown in FIG4 , a tablet computer 433 , a smart watch 435 , and a smart headset 436 can establish a wireless link with the access network device 420 through a mobile phone 431 .

[0191] The present embodiment does not impose any specific restrictions on the communication method between the tablet computer 433, smart watch 435, smart headset 436, and the mobile phone 431. For example, the tablet computer 433 can communicate with the mobile phone 431 via Wi-Fi direct (Wi-Fi peer-to-peer, Wi-Fi p2p), and the smart watch 435 and smart headset 436 can each communicate with the mobile phone 431 via BT.

[0192] For example, communication system 400 may further include at least one data center 460. In this embodiment of the present application, data center 460 may be communicatively connected to access network device 420 to connect data center 460 to the network. Data center 460 may be used for transmitting, receiving, storing, or processing data.

[0193] The embodiment of the present application does not impose any specific restrictions on the communication method between the data center 460 and the access network device 420. For example, the data center 460 can establish a wireless link with the access network device 420 through the router 440 and the firewall 450.

[0194] The embodiment of the present application does not impose any specific limitation on the communication method between the data center 460 and the router 440. For example, the data center 460 can communicate with the router 440 via a local area network (LAN).

[0195] Please refer to Figure 5, which shows a structural diagram of a communication system suitable for home scenarios provided in an embodiment of the present application.

[0196] As shown in Figure 5, communication system 500 may include core network equipment 510, at least one access network device 520, and at least one electronic device: user A's mobile phone 531, smartwatch 532, and tablet computer 533; user B's mobile phone 541, laptop computer 542, and smart headset 543; and a family's shared smart TV 551 and air purifier 552. The electronic device may be directly or indirectly connected to the access network device 520 for communication. The access network device 520 may be directly or indirectly connected to the core network device 510 for communication with the electronic device to connect to the network.

[0197] The embodiment of the present application does not limit the communication method between the access network device 520 and the core network device 510. For example, the access network device 520 can establish a wireless link with the core network device 510 through the gateway 511, or the access network device 520 can directly establish a wireless link with the core network device 510.

[0198] Similarly, the embodiment of the present application does not impose any specific restrictions on the communication method between the electronic device and the access network device 520.

[0199] For example, as shown in Figure 5 , user A's mobile phone 531 and user B's mobile phone 541 can directly establish wireless links with access network device 520. For example, user B's mobile phone 541, user B's laptop 542, smart TV 551, and air purifier 552 can establish wireless links with access network device 520 through router 540 and firewall 550.

[0200] The embodiment of the present application does not impose any specific restrictions on the communication method between user B's mobile phone 541, laptop computer 542, smart TV 551, and air purifier 552 and router 540. For example, user B's mobile phone 541, laptop computer 542, smart TV 551, and air purifier 552 can each communicate with router 540 via a Wi-Fi network.

[0201] For example, as shown in Figure 5, user A's tablet computer 533 and smartwatch 532 can establish a wireless link with access network device 520 through user A's mobile phone 531. User B's laptop computer 542 and smart headset 543 can establish a wireless link with access network device 520 through user B's mobile phone 541.

[0202] The present embodiment does not specifically limit the communication method between the tablet computer 533, the smartwatch 532, and the mobile phone 531. For example, the tablet computer 533 can communicate with the mobile phone 531 via Wi-Fi p2p, and the smartwatch 532 can communicate with the mobile phone 531 via BT. Similarly, the laptop computer 542 can communicate with the mobile phone 541 via Wi-Fi p2p, and the smart headset 543 can communicate with the mobile phone 541 via BT.

[0203] For example, the communication system 500 may further include at least one data center 560. In this embodiment of the present application, the data center 560 may be communicatively connected to the access network device 520 to connect the data center 560 to the network. The data center 560 may be used for transmitting, receiving, storing, or processing data.

[0204] The embodiment of the present application does not impose any specific restrictions on the communication method between the data center 560 and the access network device 520. For example, the data center 560 can establish a wireless link with the access network device 520 through the router 540 and the firewall 550.

[0205] The embodiment of the present application does not impose any specific limitation on the communication method between the data center 560 and the router 540. For example, the data center 560 can communicate with the router 540 via a LAN.

[0206] Please refer to Figure 6, which shows a schematic structural diagram of a communication system suitable for industrial scenarios provided in an embodiment of the present application.

[0207] As shown in Figure 6, the communication system 600 may include an industrial intranet. The industrial intranet can be used for networking electronic devices in an industrial production environment (hereinafter, electronic devices in an industrial production environment may be referred to as industrial devices). At least one core network device 610 may be deployed in the industrial intranet. The communication system 600 may also include at least one access network device 620 and at least one industrial device, for example, industrial device 631, industrial device 632, and industrial device 633. It should be understood that the industrial device can be connected to the access network device 620 in a direct or indirect manner. The access network device 620 can be connected to the core network device 610 in a direct or indirect manner to connect the industrial device to the industrial intranet.

[0208] The embodiments of the present application do not impose any specific restrictions on the types of industrial equipment. For example, industrial equipment may include coal mining machines, machine tools, mechanical equipment, or instruments and meters.

[0209] The embodiment of the present application does not limit the communication method between the access network device 620 and the core network device 610. For example, the access network device 620 can establish a wireless link with the core network device 610 through the gateway 611, or the access network device 620 can directly establish a wireless link with the core network device 610.

[0210] Similarly, the embodiment of the present application does not impose any specific restrictions on the communication method between the industrial device and the access network device 620.

[0211] For example, as shown in FIG6 , industrial device 631 and industrial device 632 may establish a wireless link with access network device 620 through router 640 , core router 650 , and firewall 660 .

[0212] For example, as shown in FIG. 6 , industrial device 632 and industrial device 633 may establish a wireless link with access network device 620 through core router 650 and firewall 660 .

[0213] The embodiment of the present application does not impose any specific restrictions on the communication method between industrial device 631 and industrial device 632 and router 640. For example, industrial device 631 and industrial device 632 can communicate with router 640 respectively through a Wi-Fi network. Similarly, the embodiment of the present application does not impose any specific restrictions on the communication method between industrial device 632 and industrial device 633 and core router 650. For example, industrial device 632 can communicate with core router 650 through a LAN. For example, industrial device 633 can communicate with core router 650 through a controller area network (CAN) bus, a 485 bus, a programmable logic controller (PLC) or zigbee technology.

[0214] For example, the communication system 600 may further include at least one data center 670. In this embodiment of the present application, the data center 670 may be communicatively connected to the access network device 620 to connect the data center 670 to the network. The data center 670 may be used for transmitting, receiving, storing, or processing data.

[0215] The embodiment of the present application does not impose any specific restrictions on the communication method between the data center 670 and the access network device 620. For example, the data center 670 can establish a wireless link with the access network device 620 through the core router 650 and the firewall 660.

[0216] The embodiment of the present application does not impose any specific limitation on the communication method between the data center 670 and the core router 650. For example, the data center 670 can communicate with the core router 650 via a LAN.

[0217] In some embodiments, the communication system 600 may further include at least one electronic device that is not used for industrial production (hereinafter referred to as non-industrial device), such as a laptop 680, a tablet 681, a mobile phone 682, and a smartwatch 683 as shown in FIG6 .

[0218] The embodiments of the present application do not impose any specific restrictions on the networking method of non-industrial equipment.

[0219] For example, non-industrial devices can be connected to an industrial intranet. The embodiments of the present application do not impose any specific restrictions on the manner in which non-industrial devices are connected to an industrial intranet.

[0220] For example, as shown in FIG6 , a laptop computer 680 , a tablet computer 681 , and a mobile phone 682 can establish wireless links with an access network device 620 through a router 640 , a core router 650 , and a firewall 660 to connect the laptop computer 680 , the tablet computer 681 , and the mobile phone 682 to the industrial intranet, respectively.

[0221] The embodiment of the present application does not impose any specific restrictions on the communication method between the laptop 680, tablet 681, and mobile phone 682 and the router 640. For example, the laptop 680, tablet 681, and mobile phone can communicate with the router 640 via a Wi-Fi network.

[0222] For example, as shown in Figure 6, mobile phone 682 can directly establish a wireless link with access network device 620 to connect mobile phone 682 to the industrial intranet. For example, smart watch 683 can indirectly establish a wireless link with access network device 620 through mobile phone 682 to connect smart watch 683 to the industrial intranet. This embodiment of the application does not specifically limit the communication method between smart watch 683 and mobile phone 682. For example, smart watch 683 can communicate with mobile phone 682 via BT.

[0223] For example, non-industrial devices can also be connected to the industrial extranet. For example, mobile phone 682 can be connected to the industrial extranet. The embodiment of the present application does not specifically limit the method of connecting non-industrial devices to the industrial extranet.

[0224] It should be noted that the classification of industrial equipment and non-industrial equipment described in FIG6 is for illustrative purposes only and should not be construed as limiting the embodiments of the present application.

[0225] The access network devices shown in Figures 4 to 6 can be any device with wireless transceiver functions. For example, the access network devices may include, but are not limited to, base stations (BS), evolved NodeBs (eNodeBs), transmission reception points (TRPs), next-generation NodeBs (gNBs) in 5G mobile communication systems, next-generation NodeBs in 6th-generation (6G) mobile communication systems, base stations in future mobile communication systems, or access nodes in WiFi systems, etc.

[0226] It should be understood that in the communication system 400 shown in FIG4 , the communication system 500 shown in FIG5 , or the communication system 600 shown in FIG6 , the electronic devices can form an ad hoc network to enable communication between the electronic devices via the ad hoc network. In other words, after the ad hoc network is completed, the electronic devices can directly communicate with each other.

[0227] For example, in the communication system 400 shown in FIG4 , a mobile phone 431, a smart TV 432, a tablet computer 433, a laptop computer 434, and a tablet computer 437 can form an ad hoc network to obtain the network topology shown in FIG7 . After the ad hoc network is completed, any electronic device in the ad hoc network can directly communicate with any electronic device in the network topology formed by the ad hoc network. For example, as shown in FIG7 , the mobile phone 431 can directly communicate with any one of the smart TV 432, the tablet computer 433, the laptop computer 434, and the tablet computer 437; the smart TV 432 can also directly communicate with any one of the mobile phone 431, the tablet computer 433, the laptop computer 434, and the tablet computer 437; and the tablet computer 433 can also directly communicate with any one of the mobile phone 431, the smart TV 432, the laptop computer 434, and the tablet computer 437, and so on.

[0228] Among them, an ad hoc network generally includes stages such as discovery, connection, authentication, and information exchange. During the discovery stage, the sender can broadcast a heartbeat discovery broadcast. The heartbeat discovery broadcast can carry the sender's account ID and trusted device ID (for ease of understanding, the heartbeat discovery broadcast carrying the account ID and trusted device ID will be referred to as heartbeat discovery broadcast A below). For example, the data field area (e.g., payload) of the heartbeat discovery broadcast A can be filled with the sender's account ID and trusted device ID. The account ID and trusted device ID carried in the heartbeat discovery broadcast A can be called feature values.

[0229] After receiving the heartbeat discovery broadcast A, the receiver can match its own account ID with the account ID in the heartbeat discovery broadcast A, or it can match its own device ID with the trusted device ID in the heartbeat discovery broadcast A to determine whether to establish an ad hoc network with the sender. Only when the receiver's own account ID matches the account ID in the heartbeat discovery broadcast A, or when the receiver's own device ID matches the trusted device ID in the heartbeat discovery broadcast A, will the receiver proceed with subsequent ad hoc network processes with the sender, such as connection, authentication, and information exchange.

[0230] In other words, devices can form an ad hoc network based on the same account or a trusted device ID. However, with the continuous development of multi-device collaboration technology, more and more devices require ad hoc networking, and the scenarios requiring ad hoc networking are becoming more and more complex. Ad hoc networks based on the same account or trusted device ID cannot meet the ad hoc networking needs of multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public equipment, resulting in a poor user experience.

[0231] In order to meet the needs of self-organizing networks in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and to improve user experience, an embodiment of the present application provides a new heartbeat discovery broadcast structure. The new heartbeat discovery broadcast (hereinafter referred to as heartbeat discovery broadcast B) can carry an identifier indicating the group to which the device belongs (for example, identifier A), an identifier indicating the account of the device (for example, identifier B), and an identifier indicating a trusted device (for example, identifier C), so that devices can be matched through any one of the groups, accounts, or trusted devices to determine whether to network. Moreover, when self-organizing networks are based on the same group or the same account, there is no limit on the number of devices belonging to the same group or the number of devices logged in to the same account, which can greatly increase the number of devices in the self-organizing network, meet the needs of self-organizing networks in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public equipment, and improve user experience.

[0232] That is, when conducting an ad hoc network, after a device broadcasts a heartbeat discovery broadcast B (hereinafter referred to as device A), the device that receives the heartbeat discovery broadcast B (e.g., device B) can match the identifier A in the heartbeat discovery broadcast B with the group to which device B belongs, and determine whether to network with device A based on the matching result. Alternatively, device B can match the identifier B in the heartbeat discovery broadcast B with its own account number, and determine whether to network with device A based on the matching result. Alternatively, device B can match the identifier C in the heartbeat discovery broadcast B with its own device ID, and determine whether to network with device A based on the matching result.

[0233] It should be understood that the matching results may include matches and mismatches. A match may mean that the group indicated by identifier A is the same as the group to which device B belongs, or the account indicated by identifier B is the same as the account of device B, or device B is one of the trusted devices indicated by identifier C. A mismatch may mean that the group indicated by identifier A is different from the group to which device B belongs, or the account indicated by identifier B is different from the account of device B, or device B is not among the trusted devices indicated by identifier C.

[0234] For example, when the group to which device B belongs matches identifier A in heartbeat discovery broadcast B, that is, when device B and device A belong to the same group, device A and device B can proceed with the subsequent ad hoc networking process. In other words, when the group to which device B belongs is the same as the group to which device A belongs, device A can form a network with device B regardless of whether the account of device B is the same as the account of device A. Furthermore, the embodiments of the present application do not limit the number of devices belonging to the same group, which can effectively increase the number of devices that can participate in an ad hoc network and facilitate the subsequent expansion of ad hoc network devices, meeting the ad hoc networking needs in multi-account or multi-device scenarios and improving the user experience.

[0235] For example, when the account of device B itself matches the identifier B in the heartbeat discovery broadcast B, that is, when the account logged in by device B is the same account logged in by device A, device A and device B can proceed with the subsequent self-organizing network process. The embodiment of the present application does not limit the number of devices logged in to the same account, which can effectively increase the number of devices that can participate in the self-organizing network, meet the self-organizing network needs in multi-device scenarios, and improve user experience.

[0236] The structure of the heartbeat discovery broadcast B provided in the embodiment of the present application is first described in detail below.

[0237] In some embodiments, the heartbeat discovery broadcast B may include identifier A, identifier B, and identifier C.

[0238] Among them, identifier A can be used to indicate the group to which device A belongs. Identifier B can be used to indicate the account of device A. Identifier C can be used to indicate the trusted device corresponding to device A.

[0239] The embodiments of this application do not impose any restrictions on the specific contents of identifiers A, B, and C, which can be determined based on actual scenarios. For example, identifier A can be determined to be a group ID, identifier B can be an account ID, and identifier C can be determined to be a trusted device ID, i.e., the device ID of a trusted device. The following example uses identifier A as the group ID, identifier B as the account ID, and identifier C as the trusted device ID as an example.

[0240] The embodiment of the present application does not limit the arrangement order of identifier A, identifier B, and identifier C in the heartbeat discovery broadcast B, and can be determined according to the actual scenario. For example, in the heartbeat discovery broadcast B, identifier A, identifier B, and identifier C can be arranged in the order of identifier A, identifier B, and identifier C. For example, in the heartbeat discovery broadcast B, identifier A, identifier B, and identifier C can be arranged in the order of identifier B, identifier A, and identifier C. For example, in the heartbeat discovery broadcast B, identifier A, identifier B, and identifier C can be arranged in the order of identifier B, identifier C, and identifier A, and so on.

[0241] In the embodiments of this application, trusted devices refer to devices that have completed mutual authentication. For example, if device A and device B have completed mutual authentication, they can be considered mutually trusted devices. In other words, device A can be a trusted device of device B, and device B can be a trusted device of device A.

[0242] It should be noted that the embodiments of the present application do not impose specific restrictions on the authentication method between devices. For example, devices can authenticate each other using the same account. For example, devices can authenticate each other without using an account. For example, devices can authenticate each other using multiple accounts. When authenticating across accounts, for example, when authenticating using account A and account B, account A and account B are bound to each other.

[0243] It should be understood that the embodiments of the present application do not impose any restrictions on the group division method and the group ID generation method, which can be determined specifically according to actual scenarios.

[0244] For example, the groups may be divided based on the account number, that is, one group may include one or more accounts. For example, the user may divide different accounts into groups according to actual needs.

[0245] For example, a smart life application (APP) can be installed on device A or device B. Users can use the smart life application to divide or create groups for different accounts based on actual needs. The smart life application can communicate with the cloud. The cloud can assign different accounts to corresponding groups based on the user's division or creation, generate a group ID for each group, and send the group ID to device A or device B. For each group, the group ID can be a group relationship identifier between members within the group.

[0246] For example, a user can view the group to which the device belongs and the members within the group on the device. It should be understood that the embodiments of the present application do not impose specific restrictions on the way in which a user views the group to which the device belongs and the members within the group on the device. For example, a user can open the group details interface in the smart life application APP, and the group details interface can display the group to which the device belongs and the group members within the group. The embodiments of the present application do not impose specific restrictions on the form in which the members of the group to which the device belongs are presented on the device. For example, the members of the group to which the device belongs can be presented on the device in the form of the device name.

[0247] In one example, device A can broadcast a heartbeat discovery broadcast B based on Bluetooth low energy (BLE) or user datagram protocol (UDP). When broadcasting heartbeat discovery broadcast B based on BLE or UDP, a payload of up to 31 bytes can be included in heartbeat discovery broadcast B to carry characteristic values, i.e., a payload of up to 31 bytes can be included in heartbeat discovery broadcast B to carry group ID, account ID, and trusted device ID.

[0248] When the number of groups, accounts, and trusted devices exceeds a certain limit, the payload cannot carry all group IDs, account IDs, or trusted device IDs, thereby limiting the number of self-organizing network devices and failing to meet the self-organizing network requirements in multi-account or multi-device scenarios, resulting in a poor user experience.

[0249] In order to increase the number of devices in the self-organizing network and improve the user experience, device A can compress one or more of the group ID, account ID and trusted device ID respectively to obtain compressed data, and intercept the compressed data to obtain the final group ID, account ID or trusted device ID, thereby reducing the storage space occupied by the group ID, account ID or trusted device ID, and increasing the capacity of the characteristic values ​​that can be carried by the payload in the heartbeat discovery broadcast B, so that the heartbeat discovery broadcast B can have a larger carrying capacity to meet the self-organizing network needs in multi-account or multi-device scenarios.

[0250] Exemplarily, device A can compress the group ID to obtain compressed data corresponding to the group ID (e.g., compressed data A), and can intercept the last M1 bits of the compressed data A as the final group ID to reduce the storage space occupied by the group ID. Alternatively, device A can compress the account ID to obtain compressed data corresponding to the account ID (e.g., compressed data B), and can intercept the last M2 bits of the compressed data B as the final account ID to reduce the storage space occupied by the account ID. Alternatively, device A can compress the trusted device ID to obtain compressed data corresponding to the trusted device ID (e.g., compressed data C), and can intercept the last M3 bits of the compressed data C as the final trusted device ID to reduce the storage space occupied by the trusted device ID.

[0251] For example, device A can compress the group ID and account ID separately to obtain compressed data A corresponding to the group ID and compressed data B corresponding to the account ID, and can intercept the last M1 bits of compressed data A as the final group ID and the last M2 bits of compressed data B as the final account ID, thereby reducing the storage space occupied by the group ID and account ID. Alternatively, device A can compress the group ID and trusted device ID separately to obtain compressed data A corresponding to the group ID and compressed data C corresponding to the trusted device ID, and can intercept the last M1 bits of compressed data A as the final group ID and the last M3 bits of compressed data C as the final trusted device ID, thereby reducing the storage space occupied by the group ID and trusted device ID. Alternatively, device A can compress the account ID and trusted device ID separately to obtain compressed data B corresponding to the account ID and compressed data C corresponding to the trusted device ID, and can intercept the last M2 bits of compressed data B as the final account ID and the last M3 bits of compressed data C as the final trusted device ID, thereby reducing the storage space occupied by the account ID and trusted device ID.

[0252] Exemplarily, device A can compress the group ID, account ID and trusted device ID respectively to obtain compressed data A corresponding to the group ID, compressed data B corresponding to the account ID and compressed data C corresponding to the trusted device ID, and can intercept the last M1 bits of the compressed data A as the final group ID, intercept the last M1 bits of the compressed data B as the final account ID, and intercept the last M3 bits of the compressed data C as the final trusted device ID, thereby reducing the storage space occupied by the group ID, account ID and trusted device ID, so that the heartbeat discovery broadcast B can have a larger carrying capacity.

[0253] It should be noted that M1, M2, and M3 may be the same or different. In addition, the embodiments of the present application do not impose any restrictions on the specific values ​​of M1, M2, and M3, which can be determined according to the actual scenario. For example, according to the actual scenario, it can be determined that M1, M2, and M3 are all 8 bits. For example, according to the actual scenario, it can be determined that M1 and M2 are both 8 bits and M3 is 10 bits. For example, according to the actual scenario, it can be determined that M1 is 6 bits, M2 is 8 bits, and M3 is 10 bits.

[0254] When device A belongs to multiple groups, for each group, device A can compress the group ID of the group to obtain compressed data corresponding to the group ID. Subsequently, device A can intercept the last M1 bits of the compressed data corresponding to the group ID as the final group ID of the group.

[0255] Similarly, when device A logs in to multiple accounts, for each account, device A can compress the account ID of that account to obtain the compressed data corresponding to that account ID. Subsequently, device A can intercept the last M2 digits of the compressed data corresponding to the account ID as the final account ID of that account.

[0256] Similarly, when device A has multiple trusted devices, for each trusted device, device A can compress the device ID of the trusted device to obtain compressed data corresponding to the trusted device ID. Device A can then intercept the last M3 bits of the compressed data corresponding to the trusted device ID as the final device ID of the trusted device.

[0257] That is, the group ID indicated in identifier A may include one or more, the account ID indicated in identifier B may include one or more, and the trusted device ID indicated in identifier C may include one or more.

[0258] The embodiment of the present application does not impose any restrictions on the compression method of the group ID, account ID or trusted device ID, which can be determined specifically according to the actual scenario.

[0259] In one example, device A can compress the group ID, account ID or trusted device ID through a hash operation to obtain the hash value corresponding to the group ID (hereinafter referred to as hash value A), the hash value corresponding to the account ID (hereinafter referred to as hash value B) or the hash value corresponding to the trusted device ID (hereinafter referred to as hash value C), so that the final group ID, the final account ID or the final trusted device ID can be obtained based on the hash value A, hash value B or hash value C.

[0260] For example, the last M1 bits of hash value A can be intercepted as the final group ID. For example, the last M2 bits of hash value B can be intercepted as the final account ID. For example, the last M3 bits of hash value C can be intercepted as the final trusted device ID.

[0261] It should be noted that the embodiments of the present application do not impose any specific restrictions on the specific calculation method of the hash operation, which can be determined according to the actual scenario.

[0262] In another example, device A can compress the group ID, account ID or trusted device ID through a Bloom filter to obtain compressed data A corresponding to the group ID, compressed data B corresponding to the account ID or compressed data C corresponding to the trusted device ID, so that the final group ID, final account ID or final trusted device ID can be obtained based on the compressed data A, compressed data B or compressed data C.

[0263] For example, the last M1 bits of compressed data A can be intercepted as the final group ID. For example, the last M2 bits of compressed data B can be intercepted as the final account ID. For example, the last M3 bits of compressed data C can be intercepted as the final trusted device ID.

[0264] From the above, it can be seen that by compressing and truncating at least one of the group ID, account ID or trusted device ID, the storage space occupied by each group ID, each account ID or each trusted device ID in the heartbeat discovery broadcast B can be effectively reduced, so that the heartbeat discovery broadcast B can carry more group IDs, account IDs or trusted device IDs, thereby improving the carrying capacity of the heartbeat discovery broadcast B, ensuring that more devices can participate in the self-organizing network, increasing the number of devices in the self-organizing network, meeting the networking needs in multi-account or multi-device scenarios, and improving the user experience.

[0265] When the number of trusted devices is large, when the trusted device ID included in the heartbeat discovery broadcast B is obtained by compression and truncation, a conflict of trusted device IDs may occur, that is, different devices may correspond to the same device ID, which may lead to misidentification of the device, that is, misidentifying a device that is not a trusted device as a trusted device, causing incorrect wake-up of the device and reducing the user experience.

[0266] For example, a filter list for heartbeat discovery broadcast B can be set in the device receiving heartbeat discovery broadcast B (i.e., device B). When it is determined that there is a misidentification, device B can store the device broadcasting heartbeat discovery broadcast B (i.e., device A) in the filter list. For example, the device ID of device A can be stored in the filter list. Subsequently, when device B receives heartbeat discovery broadcast B broadcasted by device A again, device B may not respond to the heartbeat discovery broadcast B. This ensures that the misidentification only causes the first false wakeup of device B, effectively reducing false wakeups of device B and invalid response broadcasts, thereby improving the user experience.

[0267] It should be noted that the filter list can be a list for heartbeat discovery broadcast B. That is, when device B receives a broadcast from device A (for example, broadcast C), but broadcast C is not heartbeat discovery broadcast B, device B can respond to broadcast C. When authentication between device B and device A is successful, device B can remove device A from the filter list.

[0268] That is, when device B receives heartbeat discovery broadcast B from device A, it can first determine whether device A is filtering the list. If device A is filtering the list, device B can choose not to respond to heartbeat discovery broadcast B, meaning it will not wake up device B. If device A is not filtering the list, device B can respond to heartbeat discovery broadcast B, meaning it can wake up device B and proceed with networking processes such as connecting, authenticating, and exchanging information with device A.

[0269] In an embodiment of the present application, during the networking process, when the device ID of device B matches the trusted device ID in the heartbeat discovery broadcast B, device B can respond to the heartbeat discovery broadcast B and request to establish a connection with device A. After the connection is established, device A can send an authentication request to device B to authenticate between device A and device B. During the authentication process, device A and device B will exchange the full string of their own device IDs (i.e., the complete device ID before compression) and match the full string of the device ID. That is, device A can match the full string of the device ID transmitted by device B (hereinafter referred to as full string A) with the full string of the device ID of the locally stored trusted device (hereinafter referred to as full string B). If no full string B is found that is identical to full string A, device A can confirm that the authentication has failed. Similarly, device B can match the full string of the device ID transmitted by device A (hereinafter referred to as full string C) with the full string of the device ID of the locally stored trusted device (hereinafter referred to as full string D). If no full string D is found that is identical to full string C, device B can confirm that the authentication has failed.

[0270] Misidentification will result in connection and authentication between devices. However, since the misidentified device is not a trusted device, authentication between the devices will fail. Therefore, device B can determine whether misidentification has occurred based on whether authentication between device B and device A is successful. When authentication between device B and device A fails, device B can determine that misidentification has occurred. At this time, device B can add device A's device ID to the filter list. Subsequently, when device B receives heartbeat discovery broadcast B again from device A, device B may not respond to it, thereby avoiding false wakeup of device B and improving the user experience.

[0271] Similarly, when there are a large number of groups or accounts, when the group ID or account ID included in the heartbeat discovery broadcast B is obtained through compression and truncation, a group ID conflict or an account ID conflict may occur, that is, different groups may correspond to the same group ID, or different accounts may correspond to the same account ID, which may lead to misidentification of the device and cause the device to wake up incorrectly. When it is determined that there is misidentification, device B can store the device ID of device A in the filter list. Subsequently, when device B receives the heartbeat discovery broadcast B broadcast by device A again, device B may not respond to the heartbeat discovery broadcast B, thereby reducing the false wake-up of device B and improving the user experience.

[0272] The networking method provided in the embodiments of the present application is described in detail below. This networking method can be applied to a communication system including a first device and a second device. It should be understood that the embodiments of the present application do not limit the number and type of the first device and / or the second device. For example, the first device and / or the second device can be any electronic device in Figure 4 or Figure 5 above. For example, the first device and / or the second device can be any industrial device or non-industrial device in Figure 6 above.

[0273] Please refer to Figure 8, which shows a schematic flow chart of a networking method provided by an embodiment of the present application. As shown in Figure 8, the method may include:

[0274] S801: A first device broadcasts a first heartbeat discovery broadcast.

[0275] When an ad hoc network is required, the first device may broadcast a first heartbeat discovery broadcast. The first heartbeat discovery broadcast may include a first identifier, a second identifier, and a third identifier. The first identifier may be used to indicate the group to which the first device belongs. The second identifier may be used to indicate the account number of the first device. The third identifier may be used to indicate that the first device is a trusted device. In other words, the structure of the first heartbeat discovery broadcast may be the structure of the heartbeat discovery broadcast B described above. The content of the first heartbeat discovery broadcast may refer to the description of the heartbeat discovery broadcast B described above and will not be repeated here.

[0276] For example, the first identifier may be the identifier A described above, i.e., the first identifier may be the group ID to which the first device belongs. The second identifier may be the identifier B described above, i.e., the second identifier may be the account ID of the first device. The third identifier may be the identifier C described above, i.e., the third identifier may be a trusted device ID.

[0277] The specific contents of the first identifier, the second identifier and the third identifier can refer to the relevant contents of the aforementioned identifier A, identifier B and identifier C, and will not be repeated here.

[0278] For example, the first identifier may be obtained by compressing and truncating the group ID, thereby reducing the storage space occupied by each group ID and improving the carrying capacity of the first heartbeat discovery broadcast.

[0279] For example, the second identifier may be obtained by compressing and truncating the account ID, thereby reducing the storage space occupied by each account ID and improving the carrying capacity of the first heartbeat discovery broadcast.

[0280] For example, the third identifier may be obtained by compressing and truncating the trusted device ID, thereby reducing the storage space occupied by each trusted device ID and improving the carrying capacity of the first heartbeat discovery broadcast.

[0281] The specific contents of compressing and truncating the group ID, compressing and truncating the account ID, and compressing and truncating the trusted device ID can be referred to the above description and will not be repeated here.

[0282] For example, the first device may broadcast the first heartbeat discovery broadcast via Bluetooth, such as BLE. Alternatively, the first device may broadcast the first heartbeat discovery broadcast via UDP. The embodiment of the present application does not specifically limit the manner in which the first heartbeat discovery broadcast is sent, and may be determined based on the actual scenario.

[0283] S802: The second device receives the first heartbeat discovery broadcast, and matches at least one of the first identifier, the second identifier, and the third identifier with the fourth identifier to obtain a first matching result.

[0284] The second device can be any device whose distance from the first device is less than or equal to a preset distance threshold. The preset distance threshold can be determined based on actual scenarios, and the present embodiment does not impose any limitations thereon. For example, the preset distance threshold can be determined based on the manner in which the first device broadcasts the first heartbeat discovery broadcast.

[0285] For example, when the first device broadcasts the first heartbeat discovery broadcast via Bluetooth, the preset distance threshold may be determined based on the maximum propagation distance of Bluetooth. For example, when the first device broadcasts the first heartbeat discovery broadcast via a Wi-Fi network, the preset distance threshold may be determined based on the maximum connection distance of the Wi-Fi network.

[0286] The fourth identifier may be used to indicate at least one of the group to which the second device belongs, the account number of the second device, or the device ID of the second device.

[0287] For example, the fourth identifier can be used to indicate the group to which the second device belongs. In this case, the second device can match the first identifier in the first heartbeat discovery broadcast (i.e., the group to which the first device belongs) with the fourth identifier. When the first identifier and the fourth identifier are the same, that is, when the group to which the second device belongs is the same as the group to which the first device belongs, the first matching result is a match. When the first identifier and the fourth identifier are different, that is, when the group to which the second device belongs is different from the group to which the first device belongs, the first matching result is a mismatch.

[0288] For example, the fourth identifier can be used to indicate the account of the second device. In this case, the second device can match the second identifier (i.e., the account of the first device) in the first heartbeat discovery broadcast with the fourth identifier. When the second identifier is the same as the fourth identifier, that is, when the account logged in by the second device is the same as the account logged in by the first device, the first matching result is a match. When the second identifier is different from the fourth identifier, that is, when the account logged in by the second device is different from the account logged in by the first device, the first matching result is a mismatch.

[0289] For example, the fourth identifier can be used to indicate the device ID of the second device. In this case, the second device can match the third identifier in the first heartbeat discovery broadcast (i.e., the trusted device of the first device) with the fourth identifier. When the third identifier is the same as any one of the fourth identifiers, that is, when the device ID of the second device is one of the trusted device IDs, it indicates that the second device is a trusted device of the first device, and the first matching result is a match. When there is no identifier in the fourth identifier that is the same as the third identifier, that is, when the trusted device ID does not have the same device ID as the device ID of the second device, it indicates that the second device is not a trusted device of the first device, and the first matching result is a mismatch.

[0290] For example, when the fourth identifier is used to indicate multiple of the group to which the second device belongs, the account number of the second device, or the device ID of the second device, the second device may match each of the fourth identifiers with the first identifier, the second identifier, or the third identifier, respectively. If one of the multiple identifiers indicated by the fourth identifier matches the first identifier, the second identifier, or the third identifier, the first matching result is a match. Otherwise, the first matching result is a mismatch.

[0291] For example, when the fourth identifier is used to indicate the group to which the second device belongs and the account of the second device, the second device may match the group ID indicated by the fourth identifier with the first identifier, and may match the account ID indicated by the fourth identifier with the second identifier. When the group ID indicated by the fourth identifier matches the first identifier, or when the account ID indicated by the fourth identifier matches the second identifier, the first matching result is a match. Otherwise, the first matching result is a mismatch.

[0292] For example, when the fourth identifier is used to indicate the group to which the second device belongs, the account number of the second device, and the device ID of the second device, the second device can match the group ID indicated by the fourth identifier with the first identifier, match the account number indicated by the fourth identifier with the second identifier, and match the device ID indicated by the fourth identifier with the third identifier. When the group ID indicated by the fourth identifier matches the first identifier, or when the account number indicated by the fourth identifier matches the second identifier, or when the device ID indicated by the fourth identifier matches the third identifier, the first matching result is a match. Otherwise, the first matching result is a mismatch.

[0293] In one example, when the fourth identifier indicates multiple of the group to which the second device belongs, the account number of the second device, or the device ID of the second device, the second device may perform matching according to a preset matching order. If a matching result is found in a particular match, the second device may not perform subsequent matching, thereby improving matching efficiency.

[0294] The preset matching order can be determined based on the actual scenario, and the embodiments of the present application do not impose specific limitations on this. For example, the preset matching order can be determined based on the actual scenario as: group-account-device ID. For example, the preset matching order can be determined based on the actual scenario as: account-group-device ID, etc.

[0295] For example, when the fourth identifier is used to indicate the group to which the second device belongs, the account number of the second device, and the device ID of the second device, the second device can match the group ID indicated by the fourth identifier with the first identifier. If the group ID indicated by the fourth identifier matches the first identifier, the second device can directly determine that the first matching result is a match without further matching the account number and device ID. If the group ID indicated by the fourth identifier does not match the first identifier, the second device can continue to match the account ID indicated by the fourth identifier with the second identifier. If the account ID indicated by the fourth identifier matches the second identifier, the second device can directly determine that the first matching result is a match without further matching the device ID. If the account ID indicated by the fourth identifier does not match the second identifier, the second device can continue to match the device ID indicated by the fourth identifier with the third identifier. If the device ID indicated by the fourth identifier matches the third identifier, the second device can determine that the first matching result is a match. Otherwise, the second device can determine that the first matching result is a mismatch.

[0296] In some embodiments, when the first identifier is an identifier obtained by compressing and truncating the group ID to which the first device belongs, and the fourth identifier is used to represent the group to which the second device belongs, the fourth identifier can be an identifier obtained by compressing the group ID to which the second device belongs, or can be an identifier obtained by compressing and truncating the group ID to which the second device belongs.

[0297] In an embodiment of the present application, the fourth identifier can be obtained by compressing the group ID to which the second device belongs. Alternatively, the cloud can compress the group ID to which the second device belongs and send the resulting compressed group ID to the second device. Similarly, truncating the compressed data corresponding to the group ID to which the second device belongs can be performed by the second device or performed by the cloud and then sent to the second device.

[0298] The fourth identifier is obtained by compressing the group ID to which the second device belongs in the same manner as the aforementioned method for compressing the group ID to which the first device belongs. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs using hash method A, the second device or the cloud may also compress the group ID to which the second device belongs using hash method A to obtain the fourth identifier. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs using Bloom filter A, the second device or the cloud may also compress the group ID to which the second device belongs using Bloom filter A to obtain the fourth identifier.

[0299] It should be noted that the embodiment of the present application does not impose any specific restrictions on the algorithm for matching the fourth identifier with the first identifier.

[0300] In an example, when the length of the first identifier is the same as the length of the fourth identifier, the second device may use an existing matching algorithm to match the first identifier with the fourth identifier.

[0301] In another example, when the lengths of the first identifier and the fourth identifier are different, the second device may use a backward matching algorithm to match the first identifier with the fourth identifier based on a minimum length, where the minimum length may be understood as the minimum length between the lengths of the first identifier and the lengths of the fourth identifier.

[0302] For example, when the length of the first identifier is M bits and the length of the fourth identifier is N bits, if N>M, the second device may match the last M bits of the fourth identifier with the content of the first identifier to obtain a first matching result. If N<M, the second device may match the content of the fourth identifier with the content of the last N bits of the first identifier to obtain a first matching result.

[0303] It should be understood that the content of the last M bits of the fourth identifier can be understood as the content obtained by cutting the M bits of the fourth identifier from back to front. Similarly, the content of the last N bits of the first identifier can be understood as the content obtained by cutting the N bits of the first identifier from back to front.

[0304] For example, when the length of the first identifier is 10 bits and the length of the fourth identifier is 8 bits, the second device may match the content of the last 8 bits of the first identifier with the content of the fourth identifier.

[0305] Similarly, when the second identifier is an identifier obtained by compressing and truncating the account ID, and the fourth identifier is used to represent the account of the second device, the fourth identifier can be an identifier obtained by compressing the account ID of the second device, or an identifier obtained by compressing and truncating the account ID of the second device. The method of compressing the account ID of the second device to obtain the fourth identifier is the same as the method of compressing the account ID of the first device described above. The matching of the second identifier and the fourth identifier can refer to the matching of the first identifier and the fourth identifier described above, and will not be repeated here.

[0306] When the third identifier is a compressed and truncated trusted device ID, and the fourth identifier is used to represent the device ID of the second device, the fourth identifier can be a compressed identifier of the device ID of the second device, or can be a compressed and truncated identifier of the device ID of the second device. The fourth identifier is obtained by compressing the device ID of the second device in the same manner as the aforementioned compression of the trusted device ID of the first device. The matching of the third identifier and the fourth identifier can refer to the matching of the first identifier and the fourth identifier, and will not be repeated here.

[0307] The first matching result includes a match and a mismatch.

[0308] When the fourth identifier is used to indicate the group to which the second device belongs, a match means that the first identifier and the fourth identifier are the same, i.e., the group to which the first device belongs is the same as the group to which the second device belongs. A mismatch means that the first identifier and the fourth identifier are different, i.e., the group to which the first device belongs is different from the group to which the second device belongs.

[0309] When the fourth identifier is used to represent the account of the second device, a match means that the second identifier and the fourth identifier are the same, that is, the account logged in by the first device is the same as the account logged in by the second device. A mismatch means that the second identifier and the fourth identifier are different, that is, the account logged in by the first device is different from the account logged in by the second device.

[0310] When the fourth identifier represents the device ID of the second device, a match means that the second identifier contains an identifier that is identical to the fourth identifier, i.e., the second device is one of the trusted devices indicated by the second identifier. A mismatch means that the second identifier does not contain an identifier that is identical to the fourth identifier, i.e., the second device is not a trusted device indicated by the second identifier.

[0311] In one example, a filter list for heartbeat discovery broadcasts may be set in the second device. The filter list may store misidentified device IDs. After the second device receives the first heartbeat discovery broadcast sent by the first device, it may determine whether the device ID of the first device is in the filter list. When it is determined that the device ID of the first device is in the filter list, the second device may not respond to the first heartbeat discovery broadcast to avoid false wake-up of the second device. When the device ID of the first device is not in the filter list, the second device may respond to the first heartbeat discovery broadcast, that is, the second device may be woken up at this time. After the second device wakes up, it may send a connection request to the first device to request to establish a connection with the first device.

[0312] For the contents of the filter list, please refer to the relevant description of the filter list mentioned above, which will not be repeated here.

[0313] S803: The second device processes the first heartbeat discovery broadcast according to the first matching result.

[0314] When the first matching result is a match, the second device can determine to network with the first device. At this time, the second device can send a connection request to the first device to request to establish a connection with the first device, so as to perform subsequent networking processes such as authentication and information exchange. When the first matching result is a mismatch, the second device can discard the first heartbeat discovery broadcast.

[0315] Exemplarily, after a connection is established between the first device and the second device, authentication can also be performed between the first device and the second device. For example, the first device can send an authentication request to the second device to perform authentication between the first device and the second device. Among them, when the authentication between the first device and the second device fails, the second device can save the first device (such as the device ID of the first device) to a filter list, so that when the first heartbeat discovery broadcast sent by the first device is received again in the future, it can determine whether to respond to the first heartbeat discovery broadcast sent by the first device based on the filter list. That is, when the first device is on the filter list, the second device can directly discard the first heartbeat discovery broadcast to avoid waking up the second device by mistake and improve the user experience. When the first device is not on the filter list, the second device can respond to the first heartbeat discovery broadcast to form a network with the first device.

[0316] It should be understood that the authentication between the first device and the second device may refer to the authentication between the device A and the device B described above, and will not be repeated here.

[0317] The networking method provided by the embodiment of the present application is exemplified below in conjunction with a specific application scenario. Please refer to Figure 9, which shows a schematic diagram of the application scenario provided by the embodiment of the present application. This application scenario is exemplified by taking the device that broadcasts the first heartbeat discovery broadcast as device 1, and the devices that can receive the first heartbeat discovery broadcast include devices 2, device 3, device 4, device 5, device 6, and device 7 as an example. Among them, the account logged in by device 1 is account A, the device ID of device 1 is 001, the group to which device 1 belongs is the family group, and the group ID of the family group is GRP01. In addition, the group members in the family group may include account A and account B. The devices that log in to account A include device 1 and device 2, and the devices that log in to account B include device 3 and device 4. The device ID of device 2 is 002, the device ID of device 3 is 003, the device ID of device 4 is 004, the device ID of device 5 is 005, the device ID of device 6 is 006, and the device ID of device 7 is 007. Device 6 is a trusted device of device 1.

[0318] As shown in Figure 9, when device 1 wants to establish an ad hoc network, it can broadcast a first heartbeat discovery broadcast. This first heartbeat discovery broadcast can include a first identifier, a second identifier, and a third identifier. The first identifier can be used to indicate device 1's account A. The second identifier can be used to indicate the group ID to which device 1 belongs (i.e., GRP01). The third identifier can be used to indicate device 1's trusted device ID (i.e., 005).

[0319] It should be understood that the first identifier can be obtained by compressing account number A and extracting the last M1 bits of the compressed data. The second identifier can be obtained by compressing the group ID (i.e., GRP01) and extracting the last M2 bits of the compressed data. The third identifier can be obtained by compressing the trusted device ID (i.e., 005) and extracting the last M3 bits of the compressed data.

[0320] After receiving the first heartbeat discovery broadcast from device 1, device 2 can match the account logged in by device 2 with the second identifier in the first heartbeat discovery broadcast. For example, device 2 can compress and truncate the account logged in by device 2 using the same compression and truncation method, and then match the resulting account ID with the second identifier. Since the account logged in by device 2 is the same as the account logged in by device 1, both are account A. Therefore, the first matching result obtained by device 2 is a match. At this point, device 2 can respond to the first heartbeat discovery broadcast, that is, it can connect with device 1, authenticate, and perform other networking processes.

[0321] After receiving the first heartbeat discovery broadcast from device 1, device 3 can match the group to which device 3 belongs with the first identifier in the first heartbeat discovery broadcast. For example, device 3 can compress and truncate the group to which device 3 belongs using the same compression and truncation method, and then match the group ID obtained by compression and truncation with the first identifier. Because the group to which device 3 belongs and the group to which device 1 belongs are both the home group (GRP01), the first matching result obtained by device 3 is a match. At this point, device 3 can respond to the first heartbeat discovery broadcast, that is, it can connect with device 1, authenticate, and perform other networking processes.

[0322] After receiving the first heartbeat discovery broadcast from device 1, device 4 can match the group to which device 4 belongs with the first identifier in the first heartbeat discovery broadcast. For example, device 4 can compress and truncate the group to which device 4 belongs using the same compression and truncation method, and then match the group ID obtained by compression and truncation with the first identifier. Because the group to which device 4 belongs and the group to which device 1 belongs are both the home group (GRP01), the first matching result obtained by device 4 is a match. At this point, device 4 can respond to the first heartbeat discovery broadcast, that is, it can connect with device 1, authenticate, and perform other networking processes.

[0323] After receiving the first heartbeat discovery broadcast from device 1, device 5 can match its device ID with the third identifier in the first heartbeat discovery broadcast. For example, device 5 can compress and truncate its device ID using the same compression and truncation methods, and then match the resulting compressed and truncated device ID with the third identifier. Because device 5 is a trusted device of device 1, the first matching result obtained by device 5 is a match. At this point, device 5 can respond to the first heartbeat discovery broadcast and proceed with networking processes such as connection and authentication with device 1.

[0324] After receiving the first heartbeat discovery broadcast from device 1, device 6 can match its device ID with the third identifier in the first heartbeat discovery broadcast. For example, device 6 can compress and truncate its device ID using the same compression and truncation method, and then match the resulting device ID (assuming it is the same as the trusted device ID) with the third identifier. Since the device ID obtained by compressing and truncating device 6's device ID is the same as the trusted device ID, i.e., there is a misidentification, the first matching result obtained by device 6 is a match. In this case, device 6 can respond to the first heartbeat discovery broadcast, i.e., connect and authenticate with device 1. Since device 6 is not a trusted device of device 1, authentication between device 6 and device 1 will fail. After the authentication fails, device 6 can add device 1 to its filter list. Subsequently, when device 6 receives the first heartbeat discovery broadcast from device 1 again, device 6 can determine that device 1 is on the filter list. Therefore, device 6 may not respond to the first heartbeat discovery broadcast broadcasted again by device 1, thereby avoiding further false wake-up of device 6.

[0325] After receiving the first heartbeat discovery broadcast from device 1, device 7 can match its device ID with the third identifier in the first heartbeat discovery broadcast. For example, device 7 can compress and truncate its device ID using the same compression and truncation method, and then match the resulting compressed and truncated device ID with the third identifier. Since device 7 is not a trusted device of device 1, if there is no misidentification, the first match result obtained by device 7 is a mismatch. In this case, device 7 may not respond to the first heartbeat discovery broadcast.

[0326] The self-organizing network described above can be understood as a device-level self-organizing network. After the network is successfully established, devices need to periodically send broadcasts to report their own status, that is, to inform other devices whether they are in the online state of the network, which greatly increases the power consumption of the devices and makes low-power devices unable to participate in the self-organizing network. In addition, in order to avoid excessive power consumption of the devices, after the network is successfully established, the period of the device sending broadcasts is generally not set to be very short, such as 5 minutes, 7 minutes or 10 minutes. In other words, in a device-level self-organizing network, the time interval for the device to broadcast its own status is generally long. When a device is offline within this time interval, other devices can only know the offline status of the device based on the next broadcast sent. Before that, other devices will think that the device is in the online state of the network, that is, there may be a problem of false online.

[0327] In some embodiments, the first device can perform service-level self-organizing networking based on the service run by the first device. That is, the first device can determine the device participating in the self-organizing network (hereinafter referred to as the third device) based on the service run by the first device, and send a heartbeat discovery broadcast (hereinafter referred to as the second heartbeat discovery broadcast) to the third device to establish communication with the third device through the second heartbeat discovery broadcast. In addition, the first device can also determine the survival time (time to live, TTL) of the network based on the service time required for the service, and determine the status response interval (SRI) or payload frequency level (PFL) corresponding to the third device, and carry TTL and SRI in the second heartbeat discovery broadcast, or carry TTL and PFL in the second heartbeat discovery broadcast.

[0328] After receiving the second heartbeat discovery broadcast from the first device, the third device can determine whether to network with the first device based on the second heartbeat discovery broadcast. If the third device determines to network with the first device, after networking with the first device, the third device can proactively update its service status to the first device based on the TTL and SRI in the second heartbeat discovery broadcast, or proactively update its service status to the first device based on the TTL and PFL in the second heartbeat discovery broadcast. In other words, the third device can proactively update its service status to the first device within the TTL time and according to the SRI or PFL time interval.

[0329] That is to say, the first device can conduct a business-level self-organizing network with the third device based on the business it runs, so as to truly start from the business on the demand side and conduct on-demand networking, which can eliminate a large amount of power consumption caused by invalid device-level heartbeat discovery broadcasts. The time when the third device participates in the network can be determined according to the time of the business service in the first device, that is, the third device only needs to report the service status (i.e. broadcast) within the service time of the business, and does not need to broadcast the service status periodically, which can reduce the power consumption of the third device, so that low-power devices (such as smart headphones, smart speakers, etc.) can also participate in the self-organizing network, and the types of devices participating in the self-organizing network can be expanded. In addition, the third device can actively report the service status to the first device according to SRI or PFL within the time of the business service, which can effectively solve the problem of false online.

[0330] In the embodiment of the present application, the service status of the device may include being online or offline. The service may refer to an application running on the first device. The service time may refer to the running time of the application.

[0331] The structure of the second heartbeat discovery broadcast may be different from the structure of the first heartbeat discovery broadcast. For example, the second heartbeat discovery broadcast may be a multicast domain name system (mDNS). The mDNS may use the dns_sd format. The first device may fill in the TTL and PFL in the mDNS, or may fill in the TTL and SRI in the mDNS.

[0332] It should be understood that the embodiments of the present application do not limit the specific values ​​of TTL and PFL, which can be determined by the first device based on the running service. The first device can set the TTL by default, for example, to 60 seconds. If the TTL is not determined based on the running service, the first device can determine the TTL based on the default setting.

[0333] The following uses the example of carrying TTL and PFL in the second heartbeat discovery broadcast as an example. The TTL data structure can be a TLV, which can contain three fields: type (e.g., TTL), length (length), and value (value). The PFL can also contain three fields: type (e.g., PFL), length (length), and value (value).

[0334] Exemplarily, the value of the value in TTL may be determined by the first device according to the running service, for example, it may be determined to be any value such as 60 seconds, 100 seconds, or 120 seconds.

[0335] For example, the value in PFL can be 00, 01, 10, or 11.

[0336] When the value = 00, service status reporting is not performed. When the value = 01, service status reporting is performed at an interval of TLV / 2. When the value = 10, service status reporting is performed at an interval of TLV / 3. When the value = 11, service status reporting is performed at an interval of TLV / 5. A shorter service status reporting period improves performance but increases power consumption. A longer service status reporting period deteriorates performance but reduces power consumption.

[0337] For example, when TLV is: type=TTL, length=8bit, value=60s, and PFL is: type=TTL, length=8bit, value=01, it means that the survival time of the service run by the first device is 60 seconds. Within these 60 seconds, the third device can report the service status of the third device every 30 seconds.

[0338] For example, when TLV is: type=TTL, length=8bit, value=60s, and PFL is: type=TTL, length=8bit, value=10, it means that the survival time of the service run by the first device is 60 seconds. Within these 60 seconds, the third device can report the service status of the third device every 20 seconds.

[0339] For example, when TLV is: type=TTL, length=8bit, value=60s, and PFL is: type=TTL, length=8bit, value=11, it means that the survival time of the service run by the first device is 60 seconds. Within these 60 seconds, the third device can report the service status of the third device every 12 seconds.

[0340] In one example, the first device may also update the TTL based on the operational status of the service. For example, when the first device detects that the TTL is about to expire and the service on the first device is still in service, the first device may update the TTL. After receiving the updated TTL, the third device may continue to proactively report its service status to the first device within the updated TTL, so that the third device can continue to maintain a networking status with the first device while the service on the first device is running.

[0341] In another example, when the first device detects that a service is closed, the first device may update the TTL to 0, so that the third device may no longer report the service status.

[0342] The embodiment of the present application does not limit the manner in which the monitoring service of the first device is closed, and it can be determined specifically according to the actual scenario.

[0343] In another example, when the third device detects that the TTL times out, the third device may stop reporting the service status, that is, no longer report its own service status to the first device.

[0344] Please refer to Figure 10, which shows a flow chart of a service-level ad hoc networking method provided by an embodiment of the present application. In this diagram, the third device is a low-power device as an example for illustrative description.

[0345] As shown in FIG10 , the service-level self-organizing network method may include:

[0346] S1001. The first device broadcasts a second heartbeat discovery broadcast.

[0347] When the service being run by the first device requires the cooperation of a third device, the first device can perform service-level ad hoc networking based on the service being run. That is, the first device can broadcast a second heartbeat discovery broadcast to the third device. The second heartbeat discovery broadcast can carry a TTL and PFL.

[0348] S1002. The third device responds to the second heartbeat discovery broadcast.

[0349] The third device may receive the second heartbeat discovery broadcast and may respond to the second heartbeat discovery broadcast. For example, the third device may be networked with the first device.

[0350] S1003: The third device actively updates its own service status.

[0351] After the networking is successfully established, the third device can discover the PFL in the broadcast according to the second heartbeat, and actively update its own service status to the first device.

[0352] S1004: The first device updates the TTL.

[0353] When the first device detects that the TTL is about to time out and the service on the first device is still in service, that is, when the service on the first device still requires cooperation from the third device, the first device can update the TTL to the third device.

[0354] S1005: The third device updates the TTL.

[0355] After receiving the updated TTL from the first device, the third device can update the TTL stored in the third device, that is, the third device can update the TTL stored in itself to the updated TTL.

[0356] S1006. The third device actively updates its own service status.

[0357] Among them, after updating the TTL saved by itself, the third device can continue to actively report its service status to the first device according to the PFL within the updated TTL, so that the third device can continue to maintain the networking status with the first device during the service operation of the first device.

[0358] S1007: The first device updates the TTL to 0.

[0359] During the operation of the service, the first device can monitor the operation status of the service. When the first device monitors that the service is closed, the first device can update the TTL to the third device. The updated TTL is 0, so that the third device does not need to report the service status.

[0360] S1008. The third device no longer reports its own service status.

[0361] After the third device receives the TTL updated to 0 from the first device, or the third device detects that the TTL times out, the third device may no longer report its own service status to the first device.

[0362] In the embodiments of the present application, low-power devices have relatively low battery life. To minimize power consumption, low-power devices generally do not respond to periodic device-level ad hoc networking. Therefore, when the first device broadcasts a first heartbeat discovery broadcast, i.e., when the first device is performing device-level ad hoc networking, the third device may not respond to the first heartbeat discovery broadcast. Furthermore, to minimize power consumption, the third device will not actively initiate ad hoc networking, i.e., the third device will not broadcast the first heartbeat discovery broadcast.

[0363] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0364] Corresponding to the networking method described in the above embodiment, the embodiment of the present application further provides a networking device, and each module of the device can correspond to implement each step of the networking method.

[0365] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0366] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0367] The present application also provides an electronic device comprising at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the electronic device implements the steps of any of the above-described method embodiments. For example, the structure of the electronic device may be as shown in FIG2 .

[0368] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer is enabled to implement the steps of any of the above method embodiments.

[0369] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the steps of any of the above method embodiments.

[0370] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable storage medium cannot be an electric carrier signal or a telecommunication signal.

[0371] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

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

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

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

[0375] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A communication system, characterized in that, The communication system includes a first device and a second device; The first device is configured to broadcast a first heartbeat discovery broadcast, which includes a first identifier, a second identifier, and a third identifier. The first identifier is used to indicate the group to which the first device belongs, the second identifier is used to indicate the account of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device; The second device is configured to receive the first heartbeat discovery broadcast and match at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier, where the fourth identifier is used to indicate at least one of the group to which the second device belongs, the account of the second device, and the device identity ID of the second device; Determine that the fourth identifier matches the first identifier; send a connection request to the first device, where the connection request is used to request to establish a connection with the first device.

2. The system according to claim 1, wherein The first device is further configured to, after establishing a connection with the second device based on the connection request, send an authentication request to the second device, where the authentication request is used to perform authentication between the first device and the second device; The second device is further configured to, when determining that the authentication between the first device and the second device fails, save the device ID of the first device to a filtering list.

3. The system according to claim 1 or 2, wherein The first identifier is obtained by compressing and truncating the group ID of the group to which the first device belongs; and / or, The second identifier is obtained by compressing and truncating the account ID of the first device; and / or, The third identifier is obtained by compressing and truncating the device ID of the trusted device.

4. The system according to any one of claims 1 to 3, characterized in that The communication system further includes a third device; The first device is further configured to determine the survival time of the service, the third device, and the status response time interval corresponding to the third device according to the service running on the first device, and send a second heartbeat discovery broadcast to the third device, where the second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service and the status response time interval corresponding to the third device; The third device is configured to receive the second heartbeat discovery broadcast and, after networking with the first device according to the second heartbeat discovery broadcast, report the service status of the third device to the first device according to the status response time interval within the survival time of the service.

5. The system according to any one of claims 1 to 4, characterized in that The communication system further includes a fourth device; The fourth device is configured to broadcast a third heartbeat discovery broadcast, which includes a sixth identifier, a seventh identifier, and an eighth identifier. The sixth identifier is used to indicate the group to which the fourth device belongs, the seventh identifier is used to indicate the account of the fourth device, and the eighth identifier is used to indicate the trusted device corresponding to the fourth device; The second device is further configured to receive the third heartbeat discovery broadcast, and match at least one of the sixth identifier, the seventh identifier, and the eighth identifier with the fourth identifier; determine that the fourth identifier does not match the sixth identifier, the fourth identifier does not match the seventh identifier, and the fourth identifier does not match the eighth identifier, and discard the third heartbeat discovery broadcast.

6. A networking method, characterized in that, including: The first device generates a first heartbeat discovery broadcast, which includes a first identifier, a second identifier, and a third identifier. The first identifier is used to indicate the group to which the first device belongs, the second identifier is used to indicate the account number of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device; The first device broadcasts the first heartbeat discovery broadcast.

7. The method according to claim 6, wherein The method further includes: The first device obtains the group ID to which the first device belongs, and compresses the group ID to which the first device belongs to obtain first compressed data; The first device intercepts the content of the last M1 bits of the first compressed data as the first identifier.

8. The method according to claim 6 or 7, characterized in that, The method further includes: The first device obtains the account ID of the first device, and compresses the account ID of the first device to obtain second compressed data; The first device intercepts the content of the last M2 bits of the second compressed data as the second identifier.

9. The method according to any one of claims 6 to 8, characterized in that, The method further includes: The first device obtains the device ID of the trusted device of the first device, and compresses the device ID of the trusted device to obtain third compressed data; The first device intercepts the content of the last M3 bits of the third compressed data as the third identifier.

10. The method according to any one of claims 6 to 9, characterized in that The method further includes: The first device determines the survival time of the service, the third device, and the status response time interval corresponding to the third device according to the service running on the first device, and sends a second heartbeat discovery broadcast to the third device. The second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service and the status response time interval corresponding to the third device.

11. A networking method, characterized in that, including: The second device receives the first heartbeat discovery broadcast from the first device. The first heartbeat discovery broadcast includes a first identifier, a second identifier, and a third identifier. The first identifier is used to indicate the group to which the first device belongs, the second identifier is used to indicate the account number of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device; The second device matches at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier, and the fourth identifier is used to indicate at least one of the group to which the second device belongs, the account number of the second device, and the device ID of the second device; The second device determines that the fourth identifier matches the first identifier, and sends a connection request to the first device, and the connection request is used to request to establish a connection with the first device.

12. The method according to claim 11, characterized in that, The method further includes: The second device receives the authentication request sent by the first device and performs authentication with the first device. The authentication request is sent by the first device to the second device after establishing a connection with the second device based on the connection request. When it is determined that the authentication between the first device and the second device fails, the second device saves the device ID of the first device to the filtering list.

13. The method according to claim 11 or 12, characterized in that The method further includes: The second device obtains at least one of the group ID to which the second device belongs, the account ID of the second device, and the device ID of the second device. The second device compresses at least one of the group ID to which the second device belongs, the account ID of the second device, and the device ID of the second device to obtain compressed data, and determines the fourth identifier based on the compressed data.

14. The method according to claim 13, wherein The second device determines the fourth identifier based on the compressed data, including: The second device intercepts the content of the last N bits of the compressed data as the fourth identifier.

15. The method according to any one of claims 11 to 14, characterized in that, The method further includes: The second device receives a second heartbeat discovery broadcast from the first device. The second heartbeat discovery broadcast includes a fifth identifier, and the fifth identifier is used to indicate the survival time of the service running on the first device and the status response time interval corresponding to the second device. Within the survival time of the service, the second device reports the service status of the second device to the first device according to the status response time interval.

16. The method according to any one of claims 11 to 15, characterized in that, The method further includes: The second device receives a third heartbeat discovery broadcast from a third device. The third heartbeat discovery broadcast includes a sixth identifier, a seventh identifier, and an eighth identifier. The sixth identifier is used to indicate the group to which the third device belongs, the seventh identifier is used to indicate the account of the third device, and the eighth identifier is used to indicate the trusted device corresponding to the third device. The second device matches at least one of the sixth identifier, the seventh identifier, and the eighth identifier with the fourth identifier. The second device determines that the fourth identifier does not match the sixth identifier, the fourth identifier does not match the seventh identifier, and the fourth identifier does not match the eighth identifier, and discards the third heartbeat discovery broadcast.

17. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the electronic device to implement the networking method according to any one of claims 6 to 10, or implement the networking method according to any one of claims 11 to 16.

18. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a computer, it causes the computer to implement the networking method according to any one of claims 6 to 10, or implement the networking method according to any one of claims 11 to 16.