Communication system, networking method, electronic equipment and computer readable storage medium
By carrying the heartbeat discovery broadcast of groups, accounts and trusted device identifiers in the ad hoc network, and by compressing and truncating the identification, the ad hoc network problem in multi-device scenarios is solved, achieving a higher number of devices and a better user experience.
Patent Information
- Application Number
- CN202410040118.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-07-11
AI Technical Summary
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.
By carrying the identifiers of the group, account number and trusted device to which the device belongs in the heartbeat discovery broadcast, the number of devices on the ad hoc network can be matched through the group, account number or device ID, and the number of devices on the ad hoc network is compressed and truncated to reduce storage space and increase load-bearing capacity.
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 user experience.
Smart Images

Figure CN120302376A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technologies, and particularly relates to a communication system, a networking method, an electronic device, and a computer-readable storage medium. Background Art
[0002] An ad-hoc network generally includes several stages such as discovery, connection, authentication, and information exchange. In the discovery stage, a sending end can broadcast a heartbeat discovery broadcast, which may carry the account identity (ID) of the sending end and a trusted device ID. After receiving the heartbeat discovery broadcast, a receiving end 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 perform an ad-hoc network with the receiving end. Among them, when the receiving end'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, the receiving end will perform subsequent ad-hoc network processes with the sending end.
[0003] With the continuous development of multi-device collaboration technologies, more and more devices need to form ad-hoc networks. The existing ad-hoc network methods cannot meet the ad-hoc network requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices, resulting in a poor user experience. Summary of the Invention
[0004] Embodiments of this 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 forming ad-hoc networks, meet the ad-hoc network requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices, and improve the user experience.
[0005] In a first aspect, embodiments of this application provide a communication system, including a first device and a second device. The first device is configured to broadcast a first heartbeat discovery broadcast, where 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 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 to obtain a 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, and the device identity ID of the second device. The second device is further configured to process the first heartbeat discovery broadcast according to the first matching result.
[0006] Among them, the first matching result includes matching and non-matching. When the first matching result is a match, the second device can send a connection request to the first device, and the connection request is used to request to establish a connection with the first device. When the first matching result is a non-match, the second device can discard the first heartbeat discovery broadcast.
[0007] 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 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 process the first heartbeat discovery broadcast according to the first matching result. That is, devices can match through any one of the group, account, or device ID to determine whether to perform self-networking, which can effectively increase the number of devices for self-networking, meet the self-networking requirements in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public devices, and improve the user experience.
[0008] Among them, when the fourth identifier is used to indicate one of the group to which the second device belongs, the account of the second device, or the device ID of the second device, the match can mean that the fourth identifier matches the first identifier, or the fourth identifier matches the second identifier, or the fourth identifier matches the third identifier. The non-match can mean that the fourth identifier does not match the first identifier, or the fourth identifier does not match the second identifier, or the fourth identifier does not match the third identifier.
[0009] For example, when the fourth identifier is used to indicate the group to which the second device belongs, the match can mean that the group indicated by the fourth identifier is the same as the group indicated by the first identifier, and the non-match can 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 of the second device, the match can mean that the account indicated by the fourth identifier is the same as the account indicated by the second identifier, and the non-match can mean that the account indicated by the fourth identifier is different from the account indicated by the second identifier. For example, when the fourth identifier is used to indicate the device ID of the second device, the match can mean that the device ID indicated by the fourth identifier is one of the trusted devices indicated by the third identifier, and the non-match can mean that the device ID indicated by the fourth identifier is not among the trusted devices indicated by the third identifier.
[0010] In some implementations of the first aspect, when the fourth identifier is used to indicate multiple ones of the group to which the second device belongs, the account of the second device, or the device ID of the second device, the second device may respectively match each one indicated by the fourth identifier with the first identifier, the second identifier, or the third identifier. When one of the multiple ones 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 non-match.
[0011] 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 indicated by the fourth identifier with the first identifier, and may 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 non-match.
[0012] Optionally, when the fourth identifier is used to indicate multiple ones of the group to which the second device belongs, the account of the second device, or the device ID of the second device, the second device may perform the matching according to a preset matching order. Among them, after the matching result of a certain time is a match, the second device may not perform subsequent matching, improving the matching efficiency.
[0013] The preset matching order may be determined according to the actual scenario, and the embodiments of the present application do not make specific limitations thereto. For example, it may be determined according to the actual scenario that the preset matching order is: group - account - device ID. For example, it may be determined according to the actual scenario that the preset matching order is: account - group - device ID, and so on.
[0014] For example, in an application scenario where the preset matching order is: group - account - device ID, when the fourth identifier is used to indicate the group to which the second device belongs, the account 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 and the device ID. If the group indicated by the fourth identifier is not the same as the group indicated by the first identifier, the second device may continue to match the account indicated by the fourth identifier with the second identifier. If the account indicated by the fourth identifier is the same as the account 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 indicated by the fourth identifier is not the same as the account 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 non-match.
[0015] In some implementations of the first aspect, the first device is further configured to send an authentication request to the second device after establishing a connection with the second device based on the connection request, where the authentication request is used to perform authentication between the first device and the second device; the second device is further configured 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 fails.
[0016] In the communication system provided by this implementation, a filtering list for the first heartbeat discovery broadcast can be set in the second device. When it is determined that there is a misidentification (i.e., authentication fails), the second device can store the first device in the filtering list. For example, it can store the device ID of the first device in the filtering list. Subsequently, when the second device receives the first heartbeat discovery broadcast broadcast by the first device again, the second device can not respond to the first heartbeat discovery broadcast, so that the misidentification only causes a first misawakening to the first device, effectively reducing the misawakening of the first device and reducing the invalid response broadcasts, thus enhancing the user experience.
[0017] That is to say, after the second device receives the first heartbeat discovery broadcast broadcast by the first device, it can first determine whether the first device is in the filtering list. Among them, when the first device is in the filtering list, the second device can not respond to the first heartbeat discovery broadcast. For example, it can discard the first heartbeat discovery broadcast, that is, not wake up the first device. When the first device is not in the filtering list, the second device can respond to the first heartbeat discovery broadcast, that is, it can wake up the second device to perform networking processes such as connecting, authenticating, and exchanging information with the first device.
[0018] In some 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.
[0019] In the communication system provided by this implementation manner, to increase the number of devices in the ad-hoc network and improve the user experience, the first device can compress one or more of the group ID, account ID, and trusted device ID 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, reducing the storage space occupied by the group ID, account ID, or trusted device ID, improving the capacity of the eigenvalue that can be carried in the payload of the first heartbeat discovery broadcast, so that the first heartbeat discovery broadcast can have a large carrying capacity to meet the ad-hoc network requirements in multi-account or multi-device scenarios.
[0020] Exemplarily, the first device can compress the group ID to obtain the compressed data corresponding to the group ID (such as 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, the first device can compress the account ID to obtain the compressed data corresponding to the account ID (such as 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, the first device can compress the trusted device ID to obtain the compressed data corresponding to the trusted device ID (such as 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.
[0021] In one example, the first device 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 (such as hash value A), the hash value corresponding to the account ID (such as hash value B), or the hash value corresponding to the trusted device ID (such as hash value C), so that the final group ID, final account ID, or final trusted device ID can be obtained according to hash value A, hash value B, or hash value C.
[0022] 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.
[0023] In another example, the first device can compress the group ID, account ID, or trusted device ID through a Bloom filter to obtain the compressed data A corresponding to the group ID, the compressed data B corresponding to the account ID, or the 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 according to the compressed data A, compressed data B, or compressed data C.
[0024] For example, the last M1 bits of the compressed data A can be intercepted as the final group ID. For example, the last M2 bits of the compressed data B can be intercepted as the final account ID. For example, the last M3 bits of the compressed data C can be intercepted as the final trusted device ID.
[0025] In some implementations of the first aspect, the communication system further includes a third device;
[0026] 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;
[0027] 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.
[0028] In the communication system provided by this implementation, the first device can perform service-level self-networking with the third device according to the service running on itself, starting from the service at the demand side, networking on demand, and can remove the power consumption caused by a large number of invalid device-level heartbeat discovery broadcasts. The time for the third device to participate in networking can be determined according to the service time of the 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 service, and does not need to periodically broadcast the service status, 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 self-networking, and can expand the types of devices participating in self-networking. In addition, the third device can actively report the service status to the first device according to the status response time interval within the service time of the service, which can effectively solve the problem of false online.
[0029] Wherein, the service can refer to the application program running on the first device. The service time of the service can refer to the running time of the application program. The survival time of the service indicated in the second heartbeat discovery broadcast can be determined by the first device according to the running service. For example, it can be determined as any value such as 60 seconds, 100 seconds, or 120 seconds.
[0030] In some implementations of the first aspect, the communication system further includes a fourth device;
[0031] The fourth device is used to broadcast a third heartbeat discovery broadcast, where 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 fourth device belongs. The seventh identifier is used to indicate the account of the fourth device. The eighth identifier is used to indicate the trusted device corresponding to the fourth device;
[0032] 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 first heartbeat discovery broadcast.
[0033] In a second aspect, an embodiment of the present application provides a networking method, including:
[0034] 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. 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. The third identifier is used to indicate the trusted device corresponding to the first device;
[0035] The first device broadcasts the first heartbeat discovery broadcast.
[0036] 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 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 according to the first matching result. That is, devices can be matched through any one of the group, account, or device ID to determine whether to perform self-networking, which can effectively increase the number of devices for self-networking, meet the self-networking requirements in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public devices, and improve the user experience.
[0037] In some implementation manners of the second aspect, the method further includes:
[0038] 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;
[0039] The first device intercepts the content of the last M1 bits of the first compressed data as the first identifier.
[0040] In certain implementations of the second aspect, the method further includes:
[0041] The first device obtains the account ID of the first device, compresses the account ID of the first device, and obtains second compressed data;
[0042] The first device intercepts the content of the last M2 bits of the second compressed data as the second identifier.
[0043] In certain implementations of the second aspect, the method further includes:
[0044] The first device obtains the device ID of the trusted device corresponding to the first device, compresses the device ID of the trusted device, and obtains third compressed data;
[0045] The first device intercepts the content of the last M3 bits of the third compressed data as the third identifier.
[0046] 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 more group IDs, account IDs, or trusted device IDs can be carried in the first heartbeat discovery broadcast, 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 requirements in multi-account or multi-device scenarios, and enhancing the user experience.
[0047] In certain implementations of the second aspect, the method further includes:
[0048] 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.
[0049] In a third aspect, an embodiment of the present application provides a networking method, including:
[0050] The second device receives a 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 of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device;
[0051] 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 the group to which the second device belongs, the account of the second device, and the device ID of the second device;
[0052] When the second device determines that the fourth identifier matches the first identifier, the second device sends a connection request to the first device, and the connection request is used to request to establish a connection with the first device.
[0053] In the networking method provided above, when networking is required, the first device may 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 a trusted device corresponding to the first device, so that after the second device receives the first 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 according to the first matching result. That is, devices can match through any one of the group, account, or device ID to determine whether to perform self-networking, which can effectively increase the number of devices for self-networking, meet the self-networking requirements in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public devices, and improve the user experience.
[0054] In some implementation manners of the third aspect, the method further includes:
[0055] The second device receives an authentication request sent by the first device and performs authentication with the first device, where 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;
[0056] 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.
[0057] In some implementation manners of the third aspect, the method further includes:
[0058] 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;
[0059] 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.
[0060] 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 can be an identifier obtained by compressing and truncating the group ID to which the second device belongs, so as to accurately perform the fourth identifier and the first identifier to ensure the matching effect.
[0061] In the embodiments of this application, the fourth identifier obtained by compressing the group ID to which the second device belongs can be obtained by the second device. Alternatively, the cloud can compress the group ID to which the second device belongs and send the final 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 by the cloud and then sent to the second device.
[0062] Among them, the method of obtaining the fourth identifier by compressing the group ID to which the second device belongs is the same as the method of compressing the group ID to which the first device belongs described above. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs through hash method A, the second device or the cloud can also obtain the fourth identifier by compressing the group ID to which the second device belongs through hash method A. For example, when the first identifier is obtained by compressing the group ID to which the first device belongs through Bloom filter A, the second device or the cloud can also obtain the fourth identifier by compressing the group ID to which the second device belongs through Bloom filter A.
[0063] In some implementations of the third aspect, the second device determines the fourth identifier according to the compressed data, including:
[0064] The second device intercepts the content of the last N bits of the compressed data as the fourth identifier.
[0065] Among them, when the fourth identifier is used to indicate the group to which the second device belongs, N and the aforementioned M1 can be the same or different. When the fourth identifier is used to indicate the account of the second device, N and the aforementioned M2 can be the same or different. When the fourth identifier is used to indicate the device ID of the second device, N and the aforementioned M3 can be the same or different.
[0066] In one example, when N is different from the aforementioned M1, the second device can use the backward matching algorithm to match the first identifier and the fourth identifier according to the minimum length. Among them, the minimum length can be understood as the minimum length of the length of the first identifier and the length of the fourth identifier, that is, the smaller value of N and M1.
[0067] For example, when N > M1, the second device may match the content of 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 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.
[0068] In some implementations of the third aspect, the method further includes:
[0069] 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;
[0070] During 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.
[0071] In some implementations of the third aspect, the method further includes:
[0072] The second device receives a third heartbeat discovery broadcast from a third device, and 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 number of the third device, and the eighth identifier is used to indicate the trusted device corresponding to the third device;
[0073] The second device matches at least one of the sixth identifier, the seventh identifier, and the eighth identifier with the fourth identifier;
[0074] 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.
[0075] In a fourth aspect, an embodiment of the present application provides a networking device, including:
[0076] A processing module, configured to generate a first heartbeat discovery broadcast, where 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;
[0077] A transceiver module, configured to broadcast the first heartbeat discovery broadcast.
[0078] In some implementations of the fourth aspect, the processing module is further configured to obtain the group ID to which the first device belongs, compress the group ID to which the first device belongs, and obtain first compressed data; intercept the content of the last M1 bits of the first compressed data as the first identifier.
[0079] In some implementations of the fourth aspect, the processing module is further configured to obtain the account ID of the first device, compress the account ID of the first device, and obtain second compressed data; intercept the content of the last M2 bits of the second compressed data as the second identifier.
[0080] In some implementations of the fourth aspect, the processing module is further configured to obtain the device ID of the trusted device corresponding to the first device, compress the device ID of the trusted device, and obtain third compressed data; intercept the content of the last M3 bits of the third compressed data as the third identifier.
[0081] In some implementations of the fourth aspect, the processing module is further configured to determine the survival time of the service, a 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.
[0082] In a fifth aspect, an embodiment of the present application provides a networking device, including:
[0083] A transceiver module, configured to receive a first heartbeat discovery broadcast from a first device, where 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 of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device;
[0084] A processing module, configured 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 a second device belongs, the account 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.
[0085] In the networking method provided above, when networking is required, the first device may 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 may 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 process the first heartbeat discovery broadcast according to the first matching result. That is, devices can match through any one of the group, account, or device ID to determine whether to perform self-networking, which can effectively increase the number of devices for self-networking and meet the self-networking requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices, improving the user experience.
[0086] In some implementation manners 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 establishing a connection with the second device based on the connection request;
[0087] The processing module is configured to authenticate with the first device; 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.
[0088] In some implementation manners of the fifth aspect, the processing module is further configured 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 according to the compressed data.
[0089] In some implementation manners of the fifth aspect, the processing module is further configured to intercept the content of the last N bits of the compressed data as the fourth identifier.
[0090] In some implementation manners of the fifth aspect, the transceiver module is further configured to receive a second heartbeat discovery broadcast from the first 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 running on the first device and the status response time interval corresponding to the second device;
[0091] 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.
[0092] In some 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. 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.
[0093] The processing module is further configured 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.
[0094] In a sixth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the networking method according to any one of the above second aspects, or implements the networking method according to any one of the above third aspects.
[0095] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed by a computer, causes the computer to implement the networking method according to any one of the above second aspects, or implement the networking method according to any one of the above third aspects.
[0096] In an eighth aspect, an embodiment of the present application provides a computer program product, which when running on an electronic device, causes the electronic device to execute the networking method according to any one of the above second aspects, or implement the networking method according to any one of the above third aspects.
[0097] It can be understood that the beneficial effects of the above second aspect to the eighth aspect can be referred to the relevant descriptions in the above first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] Figure 1 is an example diagram of a heartbeat discovery broadcast;
[0099] Figure 2 is a schematic structural diagram of a mobile phone to which the networking method provided by the embodiment of the present application is applicable;
[0100] Figure 3 is a schematic software architecture diagram to which the networking method provided by the embodiment of the present application is applicable;
[0101] Figure 4It is a schematic structural diagram of a communication system applicable to personal scenarios provided by an embodiment of the present application;
[0102] Figure 5 It is a schematic structural diagram of a communication system applicable to home scenarios provided by an embodiment of the present application;
[0103] Figure 6 It is a schematic structural diagram of a communication system applicable to industrial scenarios provided by an embodiment of the present application;
[0104] Figure 7 It is an example diagram of a network topology structure obtained by self - networking;
[0105] Figure 8 It is a schematic flowchart of a networking method provided by an embodiment of the present application;
[0106] Figure 9 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0107] Figure 10 It is a schematic flowchart of a service - level self - networking method provided by an embodiment of the present application. Detailed implementation manners
[0108] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0109] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0110] As used in the specification and appended claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining" or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if detecting [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detecting [the described condition or event]" or "in response to detecting [the described condition or event]" according to the context.
[0111] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0112] References to "one embodiment" or "some embodiments" etc. described in the specification of the present application mean that specific features, structures, or characteristics described in connection with that embodiment are included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but rather mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.
[0113] In addition, "a plurality" mentioned in the embodiments of the present application should be construed as two or more.
[0114] The steps involved in the networking method provided in the embodiments of the present application are merely examples, and not all steps are necessarily steps to be executed, or not all the content in each piece of information or message is mandatory. During use, it can be increased or decreased as needed. The same step or steps with the same function or messages in different embodiments of the present application can be referenced and borrowed from each other.
[0115] The service scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the network architecture and the emergence of new service scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0116] An ad hoc network generally includes stages such as discovery, connection, authentication, and information exchange.
[0117] In the discovery stage, the sending end can broadcast a heartbeat discovery broadcast. For example, as Figure 1 shown, the heartbeat discovery broadcast can carry the account ID of the sending end (i.e., Figure 1 the local account ID shown) and the trusted device ID. Among them, when there are multiple trusted devices, the trusted device ID carried in the heartbeat discovery broadcast can be a list of trusted device IDs. In addition, the heartbeat discovery broadcast can also include the device ID of the sending end (i.e., Figure 1 the local device ID shown).
[0118] After the receiving end receives the heartbeat discovery broadcast, it can match its own account ID with the account ID in the heartbeat discovery broadcast to determine whether to perform an ad-hoc network with the receiving end, that is, perform an ad-hoc network with the same account. Alternatively, the receiving end can match its own device ID with the trusted device ID in the heartbeat discovery broadcast to determine whether to perform an ad-hoc network with the receiving end, that is, perform an ad-hoc network with a different account.
[0119] When the account ID of the receiving end itself matches the account ID in the heartbeat discovery broadcast, or when the device ID of the receiving end itself matches the trusted device ID in the heartbeat discovery broadcast, the receiving end will perform subsequent ad-hoc network processes with the sending end, such as connecting, authenticating, and exchanging information with the sending end.
[0120] That is to say, the above ad-hoc network method only supports ad-hoc networks based on the same account or based on trusted device IDs. With the continuous development of multi-device collaboration technology, more and more devices need to form ad-hoc networks, and the scenarios where ad-hoc networks are required are becoming more and more complex. This ad-hoc network method that only supports ad-hoc networks based on the same account or trusted device IDs cannot meet the ad-hoc network requirements in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public devices, resulting in a poor user experience.
[0121] To solve the above problems, the embodiments of the present application provide a communication system, an ad-hoc network method, an electronic device, and a computer-readable storage medium. The communication system includes a first device and a second device. When ad-hoc networking is required, the first device can broadcast a heartbeat discovery broadcast, which 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 a fourth identifier to obtain a first matching result, and process the first heartbeat discovery broadcast according to 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 match through any one of the group, account, or device ID to determine whether to perform an ad-hoc network, which can effectively increase the number of devices in the ad-hoc network and meet the ad-hoc network requirements in multi-account or multi-device scenarios such as home, industry, multi-person collaboration, and public devices, improving the user experience.
[0122] The first device or the second device involved in the embodiments of the present application may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted 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 types of the first device or the second device.
[0123] Next, taking both the first device and the second device as mobile phones as an example, the first device or the second device involved in the embodiments of the present application will be exemplarily described. Please refer to Figure 2 , Figure 2 which shows a schematic structural diagram of the mobile phone 200.
[0124] 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, a headphone interface 270D, a sensor module 280, and a display screen 290, etc.
[0125] Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, a barometric 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.
[0126] It can be understood that the structure schematically shown in the embodiments of the present application does 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 those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0127] 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), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0128] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0129] A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory may save the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0130] 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, etc.
[0131] The USB interface 230 is an interface that complies with the USB standard specification. Specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 230 can be used to connect a charger to charge the mobile phone 200, and can also be used to transfer data between the mobile phone 200 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other mobile phones, such as AR devices, etc.
[0132] It can be understood that the interface connection relationships shown in the embodiments of this application are only illustrative and do not constitute a structural limitation on the mobile phone 200. In other embodiments of this application, the mobile phone 200 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0133] The charging management module 240 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 240 can receive the charging input of the wired charger through the USB interface 230. In some embodiments of wireless charging, the charging management module 240 can receive the wireless charging input through the wireless charging coil of the mobile phone 200. While charging the battery 242, the charging management module 240 can also supply power to the mobile phone 200 through the power management module 241.
[0134] 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 the inputs of the battery 242 and / or the charging management module 240 and supplies power to the processor 210, the internal memory 221, the display screen 290, the wireless communication module 260, etc. The power management module 241 can also be used to monitor parameters such as the battery capacity, the number of battery charge cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 241 can also be disposed in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be disposed in the same device.
[0135] The wireless communication function of the mobile phone 200 can be implemented through antenna 1, antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, and the baseband processor, etc.
[0136] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: Antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0137] The mobile communication module 250 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the mobile phone 200. The mobile communication module 250 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves through the antenna 1, filter, amplify, and process the received electromagnetic waves, and then 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 through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 250 can be provided in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 can be provided in the same device.
[0138] The modulation and demodulation processor can include a modulator and a demodulator. Among them, 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. Subsequently, the demodulator 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 transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, receiver 270B, etc.), or displays an image or video through the display screen 290. In some embodiments, the modulation and demodulation processor can be an independent device. In other embodiments, the modulation and demodulation processor can be independent of the processor 210 and be provided in the same device as the mobile communication module 250 or other functional modules.
[0139] The wireless communication module 260 can provide solutions for wireless communications applied to the mobile phone 200, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and so on. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signals to be sent from the processor 210, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0140] 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, enabling the mobile phone 200 to 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, etc. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0141] The mobile phone 200 realizes the display function through the GPU, the display screen 290, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 290 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change the display information.
[0142] The display screen 290 is used to display images, videos, etc. The display screen 290 includes a display panel. The display panel can be made of materials such as liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), Miniled, Microled, Micro-oled, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the mobile phone 200 may include 1 or N display screens 290, where N is a positive integer greater than 1.
[0143] 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 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0144] The video codec is used to compress or decompress digital videos. The mobile phone 200 can support one or more video codecs. In this way, the mobile phone 200 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0145] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the mobile phone 200 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.
[0146] 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 through the external memory interface 220 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0147] The internal memory 221 can be used to store computer-executable program codes, and the executable program codes include instructions. The internal memory 221 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the mobile phone 200 (such as audio data, phone book, etc.). In addition, the internal memory 221 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic 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 the instructions stored in the internal memory 221, and / or the instructions stored in the memory provided in the processor.
[0148] The mobile phone 200 can implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor, etc. Such as music playback, recording, etc.
[0149] The audio module 270 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 270 can also be used for encoding and decoding 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.
[0150] The speaker 270A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The mobile phone 200 can listen to music or hands-free calls through the speaker 270A.
[0151] The receiver 270B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the mobile phone 200 answers a call or a voice message, the voice can be listened to by placing the receiver 270B close to the human ear.
[0152] The microphone 270C, also known as the "microphone", "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the 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 some other embodiments, the mobile phone 200 can be provided with two microphones 270C, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the mobile phone 200 can also be provided with three, four or more microphones 270C to implement sound signal collection, noise reduction, and can also identify the sound source to implement a directional recording function, etc.
[0153] The headphone jack 270D is used to connect a wired headphone. The headphone jack 270D 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.
[0154] The software system of the mobile phone 200 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. For example, the software system of the mobile phone 200 can adopt a layered Android operating system (OS), Harmony OS, or IOS, etc. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the mobile phone 200.
[0155] Figure 3 It is a software structure block diagram of the mobile phone 200 in the embodiments of this application.
[0156] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom are the application layer, the application framework layer, the Android runtime and the system libraries, and the kernel layer.
[0157] The application layer may include a series of application packages.
[0158] As Figure 3 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, etc.
[0159] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0160] As Figure 3 shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0161] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0162] The content provider is used to store and obtain data, and make this data accessible to application programs. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc.
[0163] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
[0164] The phone manager is used to provide the communication functions of the mobile phone 200. For example, the management of call status (including answering, hanging up, etc.).
[0165] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, etc.
[0166] The notification manager enables application programs to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt tone, the mobile phone vibrates, the indicator light flashes, etc.
[0167] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0168] The core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.
[0169] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0170] The system library may include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.
[0171] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0172] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0173] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0174] The 2D graphics engine is a graphics engine for 2D drawing.
[0175] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0176] The networking method provided by the embodiments of the present application can be applied to personal scenarios, family scenarios, and industrial scenarios.
[0177] The communication system applicable to the networking method provided by the embodiments of the present application will be described below in combination with different scenarios.
[0178] Please refer to Figure 4 , Figure 4 which shows a schematic structural diagram of the communication system applicable to the personal scenario provided by the embodiments of the present application.
[0179] As Figure 4 shown, the communication system 400 may include a core network device 410, at least one access network device 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. Among them, the electronic device can be communicatively connected to the access network device 420 directly or indirectly. The access network device 420 can be communicatively connected to the core network device 410 directly or indirectly to connect the electronic device to the network.
[0180] The embodiments of the present application do not specifically limit 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.
[0181] Similarly, the embodiments of the present application do not specifically limit the communication method between the electronic device and the access network device 420.
[0182] In some embodiments, the electronic device can directly establish a wireless link with the access network device 420.
[0183] For example, as Figure 4 shown, the mobile phone 431 can 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.
[0184] In other embodiments, the electronic device can establish a wireless link with the access network device 420 through a router 440 and a firewall 450, etc.
[0185] For example, as Figure 4 shown, the mobile phone 431, the smart TV 432, the tablet computer 433, the laptop computer 434, and the tablet computer 437 can establish a wireless link with the access network device 420 through the router 440 and the firewall 450.
[0186] The embodiments of the present application do not specifically limit the communication method between the mobile phone 431, the smart TV 432, the tablet computer 433, the laptop computer 434, and the tablet computer 437 and the router 440. For example, the mobile phone 431, the smart TV 432, the tablet computer 433, the laptop computer 434, and the tablet computer 437 can communicate with the router 440 through a Wi-Fi network respectively.
[0187] In other embodiments, the electronic device can establish a wireless link with the access network device 420 through an intermediate device.
[0188] For example, as Figure 4 shown, the tablet computer 433, the smart watch 435, and the smart earphone 436 can establish a wireless link with the access network device 420 through the mobile phone 431.
[0189] The embodiments of the present application do not specifically limit the communication method between the tablet computer 433, the smart watch 435, and the smart earphone 436 and the mobile phone 431. For example, the tablet computer 433 can communicate with the mobile phone 431 through Wi-Fi direct connection (Wi-Fi peer-to-peer, Wi-Fi p2p), and the smart watch 435 and the smart earphone 436 can communicate with the mobile phone 431 through BT respectively.
[0190] Exemplarily, the communication system 400 may further include at least one data center 460. In the embodiments of the present application, the data center 460 may be communicatively connected to the access network device 420 to connect the data center 460 to the network. Among them, the data center 460 may be used for receiving and transmitting, storing, or processing data, etc.
[0191] The embodiments of the present application do not specifically limit the communication method between the data center 460 and the access network device 420. For example, the data center 460 may establish a wireless link with the access network device 420 through the router 440 and the firewall 450.
[0192] The embodiments of the present application do not specifically limit the communication method between the data center 460 and the router 440. For example, the data center 460 may communicate with the router 440 through a local area network (LAN).
[0193] Please refer to Figure 5 , Figure 5 which shows a schematic structural diagram of a communication system applicable to a home scenario provided by the embodiments of the present application.
[0194] As Figure 5 shown, the communication system 500 may include a core network device 510, at least one access network device 520, and at least one electronic device, the mobile phone 531, smart watch 532, and tablet computer 533 of user A, the mobile phone 541, laptop computer 542, and smart earphones 543 of user B, and the smart TV 551 and air purifier 552 shared by the family. Among them, the electronic device may be communicatively connected to the access network device 520 directly or indirectly. The access network device 520 may be communicatively connected to the core network device 510 directly or indirectly to connect the electronic device to the network.
[0195] The embodiments of the present application do not limit the communication method between the access network device 520 and the core network device 510. For example, the access network device 520 may establish a wireless link with the core network device 510 through the gateway 511, or the access network device 520 may directly establish a wireless link with the core network device 510.
[0196] Similarly, the embodiments of the present application do not specifically limit the communication method between the electronic device and the access network device 520.
[0197] For example, as Figure 5As shown, the mobile phone 531 of user A and the mobile phone 541 of user B can directly establish a wireless link with the access network device 520. For example, the mobile phone 541 of user B, the laptop 542 of user B, the smart TV 551, and the air purifier 552 can establish a wireless link with the access network device 520 through the router 540 and the firewall 550.
[0198] The embodiments of the present application do not specifically limit the communication methods between the mobile phone 541 of user B, the laptop 542, the smart TV 551, and the air purifier 552 and the router 540. For example, the mobile phone 541 of user B, the laptop 542, the smart TV 551, and the air purifier 552 can communicate with the router 540 through Wi-Fi networks respectively.
[0199] For example, as Figure 5 shown, the tablet computer 533 and the smart watch 532 of user A can establish a wireless link with the access network device 520 through the mobile phone 531 of user A. The laptop 542 and the smart earphone 543 of user B can establish a wireless link with the access network device 520 through the mobile phone 541 of user B.
[0200] The embodiments of the present application do not specifically limit the communication methods between the tablet computer 533 and the smart watch 532 and the mobile phone 531. For example, the tablet computer 533 can communicate with the mobile phone 531 through Wi-Fi p2p, and the smart watch 532 can communicate with the mobile phone 531 through BT. Similarly, the laptop 542 can communicate with the mobile phone 541 through Wi-Fi p2p, and the smart earphone 543 can communicate with the mobile phone 541 through BT.
[0201] Exemplarily, the communication system 500 may further include at least one data center 560. In the embodiments of the present application, the data center 560 can be communicatively connected to the access network device 520 to connect the data center 560 to the network. Among them, the data center 560 can be used for data transmission, storage, processing, etc.
[0202] The embodiments of the present application do not specifically limit the communication methods 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.
[0203] The embodiments of the present application do not specifically limit the communication methods between the data center 560 and the router 540. For example, the data center 560 can communicate with the router 540 through LAN.
[0204] Please refer to Figure 6 , Figure 6The structural schematic diagram of the communication system applicable to industrial scenarios provided by the embodiments of the present application is shown.
[0205] As Figure 6 shown, the communication system 600 may include an industrial intranet. Among them, the industrial intranet can be used for networking electronic devices in the industrial production environment (hereinafter, the electronic devices in the industrial production environment can 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 further 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 communicatively connected to the access network device 620 directly or indirectly. The access network device 620 can be communicatively connected to the core network device 610 directly or indirectly to connect the industrial device to the industrial intranet.
[0206] The embodiments of the present application do not make specific restrictions on the type of industrial device. For example, the industrial device may include a coal mining machine, a machine tool, a mechanical device, or an instrument, etc.
[0207] The embodiments of the present application do 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.
[0208] Similarly, the embodiments of the present application do not make specific restrictions on the communication method between the industrial device and the access network device 620.
[0209] For example, as Figure 6 shown, the industrial device 631 and the industrial device 632 can establish a wireless link with the access network device 620 through the router 640, the core router 650, and the firewall 660.
[0210] For example, as Figure 6 shown, the industrial device 632 and the industrial device 633 can establish a wireless link with the access network device 620 through the core router 650 and the firewall 660.
[0211] The embodiments of the present application do not specifically limit the communication methods 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 through a Wi-Fi network respectively. Similarly, the embodiments of the present application do not specifically limit the communication methods 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 a ZigBee technology.
[0212] Exemplarily, the communication system 600 may further include at least one data center 670. In the embodiments 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. Among them, the data center 670 may be used for receiving and sending, storing, or processing data, etc.
[0213] The embodiments of the present application do not specifically limit the communication method between the data center 670 and the access network device 620. For example, the data center 670 may establish a wireless link with the access network device 620 through the core router 650 and the firewall 660.
[0214] The embodiments of the present application do not specifically limit 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 through a LAN.
[0215] In some embodiments, the communication system 600 may further include at least one electronic device not for industrial production (hereinafter may be referred to as a non-industrial device). For example, as Figure 6 shown in the notebook computer 680, the tablet computer 681, the mobile phone 682, and the smart watch 683.
[0216] The embodiments of the present application do not specifically limit the networking method of non-industrial devices.
[0217] Exemplarily, the non-industrial device may be connected to the industrial intranet. The embodiments of the present application do not specifically limit the manner in which the non-industrial device is connected to the industrial intranet.
[0218] For example, as Figure 6As shown, the laptop 680, the tablet computer 681, and the mobile phone 682 can establish a wireless link with the access network device 620 through the router 640, the core router 650, and the firewall 660 to connect the laptop 680, the tablet computer 681, and the mobile phone 682 to the industrial intranet respectively.
[0219] The embodiments of the present application do not specifically limit the communication method between the laptop 680, the tablet computer 681, and the mobile phone 682 and the router 640. For example, the laptop 680, the tablet computer 681, and the mobile phone can communicate with the router 640 through the Wi-Fi network respectively.
[0220] For example, as Figure 6 shown, the mobile phone 682 can directly establish a wireless link with the access network device 620 to connect the mobile phone 682 to the industrial intranet. For example, the smart watch 683 can indirectly establish a wireless link with the access network device 620 through the mobile phone 682 to connect the smart watch 683 to the industrial intranet. The embodiments of the present application do not specifically limit the communication method between the smart watch 683 and the mobile phone 682. For example, the smart watch 683 can communicate with the mobile phone 682 through BT.
[0221] Exemplarily, non-industrial devices can also be connected to the industrial external network. For example, the mobile phone 682 can be connected to the industrial external network. The embodiments of the present application do not specifically limit the way for non-industrial devices to be connected to the industrial external network.
[0222] It should be noted that Figure 6 the classification of the industrial devices and non-industrial devices is only for exemplary explanation and should not be construed as a limitation to the embodiments of the present application.
[0223] Figures 4 to 6 The shown access network device can be any device with wireless transceiver functions. For example, the access network device can include but is not limited to: base station (BS), evolved NodeB (eNodeB), transmission reception point (TRP), next generation NodeB (gNB) in the 5G mobile communication system, next generation base station in the 6th generation (6G) mobile communication system, base station in the future mobile communication system, or access node in the WiFi system, and so on.
[0224] It should be understood that in Figure 4 the shown communication system 400, Figure 5 the shown communication system 500 or Figure 6In the communication system 600 shown, the electronic devices can form an ad-hoc network among themselves to achieve communication between the electronic devices through the ad-hoc network. That is to say, after the ad-hoc network is formed, the electronic devices can directly communicate with each other.
[0225] For example, in Figure 4 the communication system 400 shown, the mobile phone 431, the smart TV 432, the tablet computer 433, the laptop 434, and the tablet computer 437 can form an ad-hoc network among themselves to obtain the Figure 7 network topology shown. After the ad-hoc network is formed, 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 Figure 7 shown, the mobile phone 431 can directly communicate with any one of the smart TV 432, the tablet computer 433, the laptop 434, and the tablet computer 437, and the smart TV 432 can also directly communicate with any one of the mobile phone 431, the tablet computer 433, the laptop 434, and the tablet computer 437. The tablet computer 433 can also directly communicate with any one of the mobile phone 431, the smart TV 432, the laptop 434, and the tablet computer 437, and so on.
[0226] Among them, the ad-hoc network generally includes stages such as discovery, connection, authentication, and information exchange. In the discovery stage, the sending end can broadcast a heartbeat discovery broadcast. The heartbeat discovery broadcast can carry the account ID and the trusted device ID of the sending end (for the sake of easy understanding, the heartbeat discovery broadcast carrying the account ID and the trusted device ID can be hereinafter referred to as heartbeat discovery broadcast A). For example, the data field area (such as payload) of the heartbeat discovery broadcast A can be filled with the account ID and the trusted device ID of the sending end. The account ID and the trusted device ID carried in the heartbeat discovery broadcast A can be called characteristic values.
[0227] After receiving the heartbeat discovery broadcast A, the receiving end can match the account ID of the receiving end itself with the account ID in the heartbeat discovery broadcast A, or can match the device ID of the receiving end itself with the trusted device ID in the heartbeat discovery broadcast A to determine whether to form an ad-hoc network with the sending end. When the account ID of the receiving end itself matches the account ID in the heartbeat discovery broadcast A, or the device ID of the receiving end itself matches the trusted device ID in the heartbeat discovery broadcast A, the receiving end will perform subsequent ad-hoc network processes with the sending end, such as connecting, authenticating, and exchanging information with the sending end.
[0228] That is to say, devices can form an ad-hoc network based on the same account or based on a trusted device ID. With the continuous development of multi-device collaboration technology, more and more devices need to form ad-hoc networks, and the scenarios for ad-hoc networking are becoming more and more complex. The ad-hoc networking based on the same account or trusted device ID cannot meet the ad-hoc networking requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices, resulting in a poor user experience.
[0229] To meet the ad-hoc networking requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices and improve the user experience, the embodiments of the present application provide a new heartbeat discovery broadcast structure. This new heartbeat discovery broadcast (hereinafter referred to as heartbeat discovery broadcast B) can carry an identifier (such as identifier A) indicating the group to which the device belongs, an identifier (such as identifier B) indicating the account of the device, and an identifier (such as identifier C) indicating the trusted device, enabling devices to match through any one of the group, account, or trusted device to determine whether to form a network. Moreover, when forming an ad-hoc network based on the same group or the same account, there is no limit to the number of devices belonging to the same group or the number of devices logging in to the same account, which can greatly increase the number of devices forming ad-hoc networks, meet the ad-hoc networking requirements in multi-account or multi-device scenarios such as home, industrial, multi-person collaboration, and public devices, and improve the user experience.
[0230] That is to say, when forming an ad-hoc network, after a device broadcasts heartbeat discovery broadcast B (hereinafter, the device that broadcasts heartbeat discovery broadcast B can be referred to as device A), the device that receives heartbeat discovery broadcast B (such as device B) can match the identifier A in heartbeat discovery broadcast B with the group to which device B itself belongs to determine whether to form a network with device A according to the matching result. Alternatively, device B can match the identifier B in heartbeat discovery broadcast B with the account of device B itself to determine whether to form a network with device A according to the matching result. Alternatively, device B can match the identifier C in heartbeat discovery broadcast B with the device ID of device B itself to determine whether to form a network with device A according to the matching result.
[0231] It should be understood that the matching result can include matching and non-matching. Matching can 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. Non-matching can 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.
[0232] Exemplarily, when the group to which device B belongs matches the identifier A in the 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. That is to say, when the group to which device B belongs is the same group as the group to which device A belongs, regardless of whether the account of device B is the same as the account of device A, device A can network with device B. Additionally, 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 ad-hoc networking, and can facilitate the subsequent expansion of ad-hoc networking devices, meeting the ad-hoc networking requirements in multi-account or multi-device scenarios and enhancing the user experience.
[0233] Exemplarily, 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 as the account logged in by device A, device A and device B can proceed with the subsequent ad-hoc networking process, and the embodiments of the present application do not limit the number of devices logged in to the same account, which can effectively increase the number of devices that can participate in ad-hoc networking, meeting the ad-hoc networking requirements in multi-device scenarios and enhancing the user experience.
[0234] First, the structure of the heartbeat discovery broadcast B provided by the embodiments of the present application will be described in detail below.
[0235] In some embodiments, the heartbeat discovery broadcast B may include identifier A, identifier B, and identifier C.
[0236] 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.
[0237] The embodiments of the present application do not impose any restrictions on the specific content of identifier A, identifier B, and identifier C, which can be specifically determined according to the actual scenario. For example, it can be determined that identifier A is the group ID, identifier B is the account ID, and identifier C is the trusted device ID, that is, the device ID of the trusted device. The following will take identifier A as the group ID, identifier B as the account ID, and identifier C as the trusted device ID as an example for exemplary illustration.
[0238] The embodiments of the present application do not limit the arrangement order of identifier A, identifier B, and identifier C in the heartbeat discovery broadcast B, which 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.
[0239] In the embodiments of the present application, a trusted device refers to a device that has completed authentication with each other. For example, when device A and device B have completed authentication with each other, device A and device B can be trusted devices for each other. That is to say, device A can be a trusted device of device B, and device B can be a trusted device of device A.
[0240] It should be noted that the embodiments of the present application do not specifically limit the authentication methods between devices. For example, devices can be authenticated through the same account. For example, devices can be authenticated without an account. For example, devices can be authenticated across accounts. Among them, when authenticating across accounts, for example, when authenticating through account A and account B, account A and account B are mutually bound accounts.
[0241] It should be understood that the embodiments of the present application do not impose any restrictions on the grouping method of groups and the generation method of group IDs, and can be specifically determined according to the actual scenario.
[0242] Exemplarily, groups can be divided based on accounts, that is, a group can include one or more accounts. For example, the user can divide different accounts into groups according to actual needs.
[0243] For example, a smart life application (APP) can be installed in device A or device B. The user can divide or create different accounts into groups on the smart life APP according to actual needs. The smart life APP can communicate with the cloud. The cloud can, according to the user's division or creation, assign different accounts to the corresponding groups, generate group IDs for each group, and send the group IDs of each group to device A or device B. Among them, for each group, the group ID of the group can be an identification of the group relationship among the members within the group.
[0244] Exemplarily, the 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 specifically limit the method for the user to view the group to which the device belongs and the members within the group on the device. For example, the 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 specifically limit the form in which the members within the group to which the device belongs are presented on the device. For example, the members within the group to which the device belongs can be presented in the form of device names on the device.
[0245] In one example, device A can broadcast a heartbeat discovery broadcast B based on Bluetooth Low Energy (BLE) or User Datagram Protocol (UDP). Among them, when broadcasting the heartbeat discovery broadcast B based on BLE or UDP, there can be at most 31 bytes of payload in the heartbeat discovery broadcast B for carrying feature values, that is, there can be at most 31 bytes of payload in the heartbeat discovery broadcast B for carrying group IDs, account IDs, and trusted device IDs.
[0246] When the number of groups, accounts, and trusted devices exceeds a certain number, it will cause the payload to be unable to carry all group IDs, account IDs, or trusted device IDs, thus restricting the number of ad-hoc network devices and unable to meet the ad-hoc network requirements in multi-account or multi-device scenarios, resulting in a poor user experience.
[0247] To increase the number of ad-hoc network devices 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, reduce the storage space occupied by the group ID, account ID, or trusted device ID, and increase the capacity of the feature 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 ad-hoc network requirements in multi-account or multi-device scenarios.
[0248] Exemplarily, device A can compress the group ID to obtain the compressed data corresponding to the group ID (such as 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. Or, device A can compress the account ID to obtain the compressed data corresponding to the account ID (such as 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. Or, device A can compress the trusted device ID to obtain the compressed data corresponding to the trusted device ID (such as 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.
[0249] Exemplarily, device A can compress the group ID and the account ID respectively to obtain the compressed data A corresponding to the group ID and the compressed data B corresponding to the account ID, and can intercept the last M1 bits of the compressed data A as the final group ID and intercept the last M2 bits of the compressed data B as the final account ID, reducing the storage space occupied by the group ID and the account ID. Alternatively, device A can compress the group ID and the trusted device ID respectively to obtain the compressed data A corresponding to the group ID and the 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 and intercept the last M3 bits of the compressed data C as the final trusted device ID, reducing the storage space occupied by the group ID and the trusted device ID. Alternatively, device A can compress the account ID and the trusted device ID respectively to obtain the compressed data B corresponding to the account ID and the compressed data C corresponding to the trusted device ID, and can intercept the last M2 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, reducing the storage space occupied by the account ID and the trusted device ID.
[0250] Exemplarily, device A can compress the group ID, the account ID, and the trusted device ID respectively to obtain the compressed data A corresponding to the group ID, the compressed data B corresponding to the account ID, and the 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, reducing the storage space occupied by the group ID, the account ID, and the trusted device ID, so that the heartbeat discovery broadcast B can have a larger carrying capacity.
[0251] It should be noted that M1, M2, and M3 can 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, and can be determined according to the actual scenario. For example, it can be determined according to the actual scenario that M1, M2, and M3 are all 8 bits (bit). For example, it can be determined according to the actual scenario that M1 and M2 are both 8 bit and M3 is 10 bit. For example, it can be determined according to the actual scenario that M1 is 6 bit, M2 is 8 bit, and M3 is 10 bit.
[0252] When there are multiple groups to which device A belongs, for each group, device A can compress the group ID of the group to obtain the 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.
[0253] 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 the account ID. Subsequently, Device A can intercept the last M2 bits of the compressed data corresponding to the account ID as the final account ID of that account.
[0254] Similarly, when there are multiple trusted devices of Device A, for each trusted device, Device A can compress the device ID of that trusted device to obtain the compressed data corresponding to the device ID of that trusted device. Subsequently, Device A can intercept the last M3 bits of the compressed data corresponding to the device ID of that trusted device as the final device ID of that trusted device.
[0255] That is to say, the group ID indicated in Identifier A can include one or more. The account ID indicated in Identifier B can include one or more. The trusted device ID indicated in Identifier C can include one or more.
[0256] The embodiments of the present application do not impose any restrictions on the compression method of the group ID, account ID, or trusted device ID, and can be specifically determined according to the actual scenario.
[0257] 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, final account ID, or final trusted device ID can be obtained according to hash value A, hash value B, or hash value C.
[0258] 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.
[0259] It should be noted that the embodiments of the present application do not specifically limit the specific calculation method of the hash operation, and can be specifically determined according to the actual scenario.
[0260] In another example, Device A can compress the group ID, account ID, or trusted device ID through a Bloom filter to obtain the compressed data A corresponding to the group ID, the compressed data B corresponding to the account ID, or the 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 according to the compressed data A, compressed data B, or compressed data C.
[0261] For example, the last M1 bits of the compressed data A can be intercepted as the final group ID. For example, the last M2 bits of the compressed data B can be intercepted as the final account ID. For example, the last M3 bits of the compressed data C can be intercepted as the final trusted device ID.
[0262] As can be seen from the above, by compressing and truncating at least one of the group ID, the account ID, or the 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 more group IDs, account IDs, or trusted device IDs can be carried in the heartbeat discovery broadcast B, thereby improving the carrying capacity of the heartbeat discovery broadcast B, ensuring that more devices can participate in the ad-hoc network, increasing the number of devices in the ad-hoc network, meeting the networking requirements in multi-account or multi-device scenarios, and enhancing the user experience.
[0263] When the number of trusted devices is relatively large, when obtaining the trusted device IDs included in the heartbeat discovery broadcast B through compression and truncation, conflicts of trusted device IDs may occur, that is, different devices may correspond to the same device ID, which may lead to misidentification of devices, that is, misidentifying a device that does not belong to a trusted device as a trusted device, resulting in misawakening of the device and reducing the user experience.
[0264] Exemplarily, a filtering list for the heartbeat discovery broadcast B can be set in the device (i.e., device B) that receives the heartbeat discovery broadcast B. When it is determined that there is misidentification, device B can store the device (i.e., device A) that broadcasts the heartbeat discovery broadcast B in the filtering list. For example, the device ID of device A can be stored in the filtering list. Subsequently, when device B receives the heartbeat discovery broadcast B broadcast by device A again, device B can not respond to the heartbeat discovery broadcast B, so that the misidentification only causes the first misawakening to device B, effectively reducing the misawakening of device B and reducing the invalid response broadcasts, thereby enhancing the user experience.
[0265] It should be noted that the filtering list can be a list for the heartbeat discovery broadcast B. That is, when device B receives a broadcast from device A (such as broadcast C), but the broadcast C is not the heartbeat discovery broadcast B, device B can respond to the broadcast C. Among them, when the authentication between device B and device A is successful, device B can delete device A from the filtering list.
[0266] That is to say, when device B receives the heartbeat discovery broadcast B broadcast by device A, it can first determine whether device A is on the filtering list. When device A is on the filtering list, device B can not respond to the heartbeat discovery broadcast B, that is, it does not wake up device B. When device A is not on the filtering list, device B can respond to the heartbeat discovery broadcast B, that is, it can wake up device B to perform networking processes such as connecting with device A, authenticating, and exchanging information.
[0267] In the 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 establishing the connection, device A can send an authentication request to device B to perform authentication 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 (that is, the complete device ID before compression) and perform matching of the full strings of the device IDs. 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 trusted device saved locally (hereinafter referred to as full string B). If no full string B identical to full string A is found, device A can confirm that the authentication fails. 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 trusted device saved locally (hereinafter referred to as full string D). If no full string D identical to full string C is found, device B can confirm that the authentication fails.
[0268] Among them, misidentification may lead to connection and authentication between devices. However, since the misidentified device does not belong to the trusted device, the authentication will fail during the device - to - device authentication. Therefore, device B can determine whether there is misidentification based on whether the authentication between device B and device A is successful. When the authentication between device B and device A fails, device B can determine that there is misidentification. At this time, device B can add the device ID of device A to the filtering list. Subsequently, when device B receives the heartbeat discovery broadcast B broadcast by device A again, device B can not respond to the heartbeat discovery broadcast B, which can avoid accidentally waking up device B again and improve the user experience.
[0269] Similarly, when the number of groups is large or the number of accounts is large, conflicts may occur in the group IDs or account IDs included in the heartbeat discovery broadcast B obtained by compression and truncation. That is, it is possible that different groups correspond to the same group ID, or different accounts correspond to the same account ID, which may lead to misidentification of devices and cause accidental wake-up of devices. When it is determined that there is misidentification, device B can store the device ID of device A in the filtering list. Subsequently, when device B receives the heartbeat discovery broadcast B broadcast by device A again, device B can not respond to this heartbeat discovery broadcast B, reducing the accidental wake-up of device B and improving the user experience.
[0270] The networking method provided by the embodiments of the present application will be described in detail below. The 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 one of the above Figure 4 or Figure 5 electronic devices. For example, the first device and / or the second device can be any one of the above Figure 6 industrial devices or non-industrial devices.
[0271] Please refer to Figure 8 , Figure 8 which shows a schematic flowchart of a networking method provided by the embodiments of the present application. As Figure 8 shown, the method may include:
[0272] S801. The first device broadcasts a first heartbeat discovery broadcast.
[0273] When self-networking is required, the first device can 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 can be used to indicate the group to which the first device belongs. The second identifier can be used to indicate the account of the first device. The third identifier can be used to indicate the trusted device of the first device. That is, the structure of the first heartbeat discovery broadcast can be the same as the structure of the heartbeat discovery broadcast B described above. The content of the first heartbeat discovery broadcast can be referred to the description in the above heartbeat discovery broadcast B and will not be elaborated here.
[0274] Exemplarily, the first identifier can be the aforementioned identifier A, that is, the first identifier can be the group ID to which the first device belongs. The second identifier can be the aforementioned identifier B, that is, the second identifier can be the account ID of the first device. The third identifier can be the aforementioned identifier C, that is, the third identifier can be the trusted device ID.
[0275] The specific content of the first identifier, the second identifier, and the third identifier may refer to the relevant content of identifier A, identifier B, and identifier C described above, and will not be elaborated here.
[0276] For example, the first identifier can be obtained by compressing and truncating the group ID, reducing the storage space occupied by each group ID, and improving the carrying capacity of the first heartbeat discovery broadcast.
[0277] For example, the second identifier can be obtained by compressing and truncating the account ID, reducing the storage space occupied by each account ID, and improving the carrying capacity of the first heartbeat discovery broadcast.
[0278] For example, the third identifier can be obtained by compressing and truncating the trusted device ID, reducing the storage space occupied by each trusted device ID, and improving the carrying capacity of the first heartbeat discovery broadcast.
[0279] Among them, the specific content of compressing and truncating the group ID, compressing and truncating the account ID, and compressing and truncating the trusted device ID can refer to the foregoing description and will not be elaborated here.
[0280] Exemplarily, the first device can broadcast the first heartbeat discovery broadcast via Bluetooth, such as BLE. Alternatively, the first device can broadcast the first heartbeat discovery broadcast via UDP. The embodiments of the present application do not specifically limit the sending method of the first heartbeat discovery broadcast, which can be specifically determined according to the actual scenario.
[0281] 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.
[0282] The second device can be any device whose distance from the first device is less than or equal to a preset distance threshold. Among them, the preset distance threshold can be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any restrictions thereon. For example, the preset distance threshold can be determined according to the way the first device broadcasts the first heartbeat discovery broadcast.
[0283] For example, when the first device broadcasts the first heartbeat discovery broadcast via Bluetooth, the preset distance threshold can be determined according to the farthest 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 can be determined according to the farthest connection distance of the Wi-Fi network.
[0284] Among them, the fourth identifier can be 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.
[0285] For example, the fourth identifier may be used to indicate the group to which the second device belongs. In this case, the second device may match the first identifier (i.e., the group to which the first device belongs) in the first heartbeat discovery broadcast with the fourth identifier. When the first identifier is the same as the fourth identifier, 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 is different from the fourth identifier, 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.
[0286] For example, the fourth identifier may be used to indicate the account of the second device. In this case, the second device may 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.
[0287] For example, the fourth identifier may be used to indicate the device ID of the second device. In this case, the second device may match the third identifier (i.e., the trusted device of the first device) in the first heartbeat discovery broadcast with the fourth identifier. When any one of the third identifier and the fourth identifier is the same, 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 there is no device ID in the trusted device IDs that is the same 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.
[0288] Exemplarily, when the fourth identifier is used to indicate multiple of the group to which the second device belongs, the account of the second device, or the device ID of the second device, the second device may respectively match each indicated by the fourth identifier with the first identifier, the second identifier, or the third identifier. When there is one of the multiple indicated by the fourth identifier that 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.
[0289] 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.
[0290] For example, when the fourth identifier is used to indicate the group to which the second device belongs, the account of the second device, and the device ID 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, 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 ID 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.
[0291] In one example, when the fourth identifier is used to indicate multiple of the group to which the second device belongs, the account of the second device, or the device ID of the second device, the second device may perform matching according to a preset matching order. Among them, after the matching result of a certain time is a match, the second device may not need to perform subsequent matching, improving the matching efficiency.
[0292] The preset matching order may be determined according to the actual scenario, and the embodiments of the present application do not make specific limitations thereto. For example, it may be determined according to the actual scenario that the preset matching order is: group - account - device ID. For example, it may be determined according to the actual scenario that the preset matching order is: account - group - device ID, and so on.
[0293] For example, when the fourth identifier is used to indicate the group to which the second device belongs, the account of the second device, and the device ID of the second device, the second device may 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 may directly determine that the first matching result is a match without further matching the account and the device ID. If the group ID indicated by the fourth identifier does not match the first identifier, the second device may 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 may 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 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 matches 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.
[0294] 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 may be an identifier obtained by compressing the group ID to which the second device belongs, or may be an identifier obtained by compressing and truncating the group ID to which the second device belongs.
[0295] In the embodiment of the present application, the fourth identifier can be obtained by compressing the group ID to which the second device belongs by the second device. Alternatively, the group ID to which the second device belongs can be compressed by the cloud, and the final group ID obtained by compression can be sent to the second device. Similarly, the truncation of the compressed data corresponding to the group ID to which the second device belongs can be executed by the second device, or it can be executed by the cloud and then sent to the second device.
[0296] Among them, the method of compressing the group ID to which the second device belongs to obtain the fourth identifier is the same as the aforementioned method of compressing the group ID to which the first device belongs. For example, when the group ID to which the first device belongs is compressed by hash method A to obtain the first identifier, the second device or the cloud can also compress the group ID to which the second device belongs by hash method A to obtain the fourth identifier. For example, when the group ID to which the first device belongs is compressed by Bloom filter A to obtain the first identifier, the second device or the cloud can also compress the group ID to which the second device belongs by Bloom filter A to obtain the fourth identifier.
[0297] 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.
[0298] 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.
[0299] In another example, when the length of the first identifier is different from the length of the fourth identifier, the second device can use a backward matching algorithm to match the first identifier with the fourth identifier according to the minimum length, where the minimum length can be understood as the minimum length of the first identifier and the fourth identifier.
[0300] 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 can match the content of 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 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.
[0301] 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 the back to the 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 the back to the front.
[0302] 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 can match the content of the last 8 bits of the first identifier with the content of the fourth identifier.
[0303] 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 can be an identifier obtained by compressing and truncating the account ID of the second device. Among them, the method of obtaining the fourth identifier by compressing the account ID of the second device 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, which will not be elaborated here.
[0304] When the third identifier is an identifier obtained by compressing and truncating the trusted device ID, and the fourth identifier is used to represent the device ID of the second device, the fourth identifier can be an identifier obtained by compressing the device ID of the second device, or can be an identifier obtained by compressing and truncating the device ID of the second device. Among them, the method of obtaining the fourth identifier by compressing the device ID of the second device is the same as the method of compressing the trusted device ID of the first device described above. The matching of the third identifier and the fourth identifier can refer to the matching of the first identifier and the fourth identifier described above, which will not be elaborated here.
[0305] Among them, the first matching result includes matching and non - matching.
[0306] When the fourth identifier is used to represent the group to which the second device belongs, matching means that the first identifier is the same as the fourth identifier, that is, the group to which the first device belongs is the same as the group to which the second device belongs. Non - matching means that the first identifier is not the same as the fourth identifier, that is, the group to which the first device belongs is not the same as the group to which the second device belongs.
[0307] When the fourth identifier is used to represent the account of the second device, matching means that the second identifier is the same as the fourth identifier, that is, the account logged in by the first device is the same as the account logged in by the second device. Non - matching means that the second identifier is not the same as the fourth identifier, that is, the account logged in by the first device is not the same as the account logged in by the second device.
[0308] When the fourth identifier is used to represent the device ID of the second device, matching means that there is an identifier in the second identifier that is the same as the fourth identifier, that is, the second device is one of the trusted devices indicated by the second identifier. Non - matching means that there is no identifier in the second identifier that is the same as the fourth identifier, that is, the second device is not a trusted device indicated by the second identifier.
[0309] In one example, a filtering list for heartbeat discovery broadcasts may be set in the second device. Among them, misidentified device IDs may be saved in the filtering list. After receiving the first heartbeat discovery broadcast sent by the first device, the second device may determine whether the device ID of the first device is in the filtering list. When it is determined that the device ID of the first device is in the filtering list, the second device may not respond to the first heartbeat discovery broadcast to avoid misawakening the second device. When the device ID of the first device is not in the filtering list, the second device may respond to the first heartbeat discovery broadcast, that is, the second device can be awakened at this time. After the second device is awakened, it may send a connection request to the first device to request to establish a connection with the first device.
[0310] For the content of the filtering list, reference may be made to the relevant description of the foregoing filtering list, which will not be elaborated here.
[0311] S803. The second device processes the first heartbeat discovery broadcast according to the first matching result.
[0312] When the first matching result is a match, the second device may determine to form a network with the first device. At this time, the second device may 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 may discard the first heartbeat discovery broadcast.
[0313] Exemplarily, after a connection is established between the first device and the second device, authentication may also be performed between the first device and the second device. For example, the first device may 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 may save the first device (such as the device ID of the first device) to the filtering list, so that when the first heartbeat discovery broadcast sent by the first device is received again later, it may be determined whether to respond to the first heartbeat discovery broadcast sent by the first device according to the filtering list. That is, when the first device is in the filtering list, the second device may directly discard the first heartbeat discovery broadcast to avoid misawakening the second device and improve the user experience. When the first device is not in the filtering list, the second device may respond to the first heartbeat discovery broadcast to form a network with the first device.
[0314] It should be understood that the authentication between the first device and the second device may refer to the authentication between device A and device B described above, which will not be elaborated here.
[0315] Next, the networking method provided by the embodiments of the present application will be exemplarily described in combination with specific application scenarios. Please refer to Figure 9 , Figure 9The figure shows a schematic diagram of an application scenario provided by an embodiment of the present application. Taking the device that broadcasts the first heartbeat discovery broadcast as Device 1, and the devices that can receive the first heartbeat discovery broadcast including Device 2, Device 3, Device 4, Device 5, Device 6, and Device 7 as an example for exemplary illustration. 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 home group, and the group ID of the home group is GRP01. In addition, the group members in the home group may include Account A and Account B. The devices logged in to Account A include Device 1 and Device 2, and the devices logged 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.
[0316] As Figure 9 shown, when Device 1 wants to form an ad-hoc network, Device 1 can 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 Account A of Device 1. The second identifier may be used to indicate the group ID (i.e., GRP01) to which Device 1 belongs. The third identifier may be used to indicate the trusted device ID of Device 1 (i.e., 005).
[0317] It should be understood that the first identifier may be an identifier obtained by compressing Account A and intercepting the last M1 bits of the compressed data. The second identifier may be an identifier obtained by compressing the group ID (i.e., GRP01) and intercepting the last M2 bits of the compressed data. The third identifier may be an identifier obtained by compressing the trusted device ID (i.e., 005) and intercepting the last M3 bits of the compressed data.
[0318] After receiving the first heartbeat discovery broadcast broadcast by 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 in the same way of compression and truncation, and can match the account ID obtained by compression and truncation 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 time, Device 2 can respond to the first heartbeat discovery broadcast, that is, it can perform networking processes such as connection and authentication with Device 1.
[0319] After receiving the first heartbeat discovery broadcast broadcast by 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 in the same compression and truncation manner, and can match the group ID obtained by compression and truncation with the first identifier. Since the groups to which device 3 and device 1 belong are both home groups (GRP01). Therefore, the first matching result obtained by device 3 is a match. At this time, device 3 can respond to the first heartbeat discovery broadcast, that is, it can perform networking processes such as connection and authentication with device 1.
[0320] After receiving the first heartbeat discovery broadcast broadcast by 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 in the same compression and truncation manner, and can match the group ID obtained by compression and truncation with the first identifier. Since the groups to which device 4 and device 1 belong are both home groups (GRP01). Therefore, the first matching result obtained by device 4 is a match. At this time, device 4 can respond to the first heartbeat discovery broadcast, that is, it can perform networking processes such as connection and authentication with device 1.
[0321] After receiving the first heartbeat discovery broadcast broadcast by device 1, device 5 can match the device ID of device 5 with the third identifier in the first heartbeat discovery broadcast. For example, device 5 can compress and truncate the device ID of device 5 in the same compression and truncation manner, and can match the device ID obtained by compression and truncation with the third identifier. Since device 5 is a trusted device of device 1. Therefore, the first matching result obtained by device 5 is a match. At this time, device 5 can respond to the first heartbeat discovery broadcast, that is, it can perform networking processes such as connection and authentication with device 1.
[0322] After device 6 receives the first heartbeat discovery broadcast broadcast by device 1, it can match the device ID of device 6 with the third identifier in the first heartbeat discovery broadcast. For example, device 6 can compress and truncate the device ID of device 6 in the same compressed and truncated manner, and can match the device ID obtained by compression and truncation (assuming it is the same as the trusted device ID) with the third identifier. Since the device ID obtained by compressing and truncating the device ID of device 6 is the same as the trusted device ID, that is, there is misidentification. Therefore, the first matching result obtained by device 6 is a match. At this time, device 6 can respond to the first heartbeat discovery broadcast, that is, connect and authenticate with device 1. Since device 6 is not a trusted device of device 1, the authentication between device 6 and device 1 will fail. After the authentication fails, device 6 can add device 1 to the filtering list in device 6. Subsequently, when device 6 receives the first heartbeat discovery broadcast broadcast by device 1 again, device 6 can determine that device 1 is in the filtering list. Therefore, device 6 can not respond to the first heartbeat discovery broadcast broadcast by device 1 again, so as to avoid waking up device 6 by mistake again.
[0323] After device 7 receives the first heartbeat discovery broadcast broadcast by device 1, it can match the device ID of device 7 with the third identifier in the first heartbeat discovery broadcast. For example, device 7 can compress and truncate the device ID of device 7 in the same compressed and truncated manner, and can match the device ID obtained by compression and truncation with the third identifier. Since device 7 is not a trusted device of device 1. Therefore, when there is no misidentification, the first matching result obtained by device 7 is a mismatch. At this time, device 7 can not respond to the first heartbeat discovery broadcast.
[0324] The ad-hoc network described above can be understood as a device-level ad-hoc network. After the network is successfully formed, 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, resulting in low-power devices being unable to participate in the ad-hoc network. In addition, to avoid excessive power consumption of the devices, after the network is successfully formed, the broadcast period of the devices is generally not set to be particularly short, such as set to 5 minutes, 7 minutes or 10 minutes, etc. That is to say, in the device-level ad-hoc network, the time interval for devices to broadcast their own status is generally relatively long. When a certain device is in the offline state within this time interval, other devices can only learn the offline state of this device based on the next broadcast. Before that, other devices will all think that this device is in the online state of the network, that is, there may be a problem of false online.
[0325] In some embodiments, the first device may perform service-level ad hoc networking according to the services running on the first device. That is, the first device may determine the devices participating in the ad hoc networking (hereinafter referred to as the third devices) according to the services running on the first device, and send a heartbeat discovery broadcast (hereinafter referred to as the second heartbeat discovery broadcast) to the third devices to establish communication with the third devices through the second heartbeat discovery broadcast. In addition, the first device may also determine the time to live (TTL) of the network, and determine the status response interval (SRI) or payload frequency level (PFL) corresponding to the third devices according to the time required for the services, and carry the TTL and SRI in the second heartbeat discovery broadcast, or carry the TTL and PFL in the second heartbeat discovery broadcast.
[0326] After receiving the second heartbeat discovery broadcast sent by the first device, the third device may determine whether to form a network with the first device according to the second heartbeat discovery broadcast. If it is determined to form a network with the first device, after forming a network with the first device, the third device may actively update its service status to the first device according to the TTL and SRI in the second heartbeat discovery broadcast, or actively update its service status to the first device according to the TTL and PFL in the second heartbeat discovery broadcast. That is, the third device may actively update its service status to the first device according to the time interval of the SRI or PFL within the time of the TTL.
[0327] That is to say, the first device may perform service-level ad hoc networking with the third devices according to the services running on itself, starting from the services at the demand side to form a network as needed, which can eliminate the power consumption caused by a large number of invalid device-level heartbeat discovery broadcasts. The time for the third device to participate in the networking may be determined according to the service time of the services in the first device, that is, the third device only needs to report (i.e., broadcast) its service status during the service time of the services, rather than periodically broadcasting its service status, 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 ad hoc networking, and the types of devices participating in the ad hoc networking can be expanded. In addition, the third device may actively report its service status to the first device according to the SRI or PFL during the service time of the services, which can effectively solve the problem of false online status.
[0328] In the embodiments of the present application, the service status of the device may include online and offline in the network. The service may refer to the application program running on the first device. The service time of the service may refer to the running time of the application program.
[0329] Among them, the structure of the second heartbeat discovery broadcast may be different from that of the first heartbeat discovery broadcast. For example, the second heartbeat discovery broadcast may be a multicast domain name system (mDNS). mDNS may adopt 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.
[0330] It should be understood that the embodiments of the present application do not limit the specific values of the TTL and PFL, which can be specifically determined by the first device according to the services it runs. Among them, the TTL may be default set in the first device. For example, the TTL may be default set to 60s. When the TTL is not determined according to the services it runs, the first device may determine the TTL according to the default setting.
[0331] The following will take the case where the TTL and PFL are carried in the second heartbeat discovery broadcast as an example for illustrative description. Among them, the data structure of the TTL may be TLV, and the TLV may include three fields: type (such as TTL), length, and value. The PFL may also include three fields: type (such as PFL), length, and value.
[0332] Exemplarily, the value of the value in the TTL can be determined by the first device according to the services it runs. For example, it can be determined to be any value such as 60 seconds, 100 seconds, or 120 seconds.
[0333] For example, the value of the value in the PFL may be 00, 01, 10, or 11.
[0334] When value = 00, it means that the service status is not reported. When value = 01, it means that the service status is reported at an interval of TLV / 2. When value = 10, it means that the service status is reported at an interval of TLV / 3. When value = 11, it means that the service status is reported at an interval of TLV / 5. Among them, when the reporting period of the device for the service status is shorter, the performance is higher, but the power consumption is higher. When the reporting period of the device for the service status is longer, the performance is worse, but the power consumption is lower.
[0335] For example, when the TLV is: type = TTL, length = 8bit, value = 60s, and the 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.
[0336] For example, when TLV is: type = TTL, length = 8 bit, value = 60 s, and PFL is: type = TTL, length = 8 bit, value = 10, it means that the survival time of the service running on 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.
[0337] For example, when TLV is: type = TTL, length = 8 bit, value = 60 s, and PFL is: type = TTL, length = 8 bit, value = 11, it means that the survival time of the service running on 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.
[0338] In one example, the first device can also update the TTL according to the running 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 the service state, the first device can update the TTL. After receiving the updated TTL, the third device can continue to actively report the service status of the third device to the first device within the updated TTL, so that the third device can continue to maintain the networking state with the first device during the operation of the service on the first device.
[0339] In another example, when the first device monitors that the service is closed, the first device can update the TTL to 0, so that the third device can stop reporting the service status.
[0340] The embodiments of the present application do not limit the way for the first device to monitor whether the service is closed, which can be specifically determined according to the actual scenario.
[0341] In another example, when the third device detects that the TTL has expired, the third device can stop reporting the service status, that is, it no longer reports its own service status to the first device.
[0342] Please refer to Figure 10 , Figure 10 which shows a schematic flowchart of a service-level self-organizing network method provided by the embodiments of the present application. In this schematic diagram, the third device is taken as an example of a low-power device for exemplary illustration.
[0343] As Figure 10 shown, the service-level self-organizing network method may include:
[0344] S1001. The first device broadcasts a second heartbeat discovery broadcast.
[0345] When the service running on the first device requires the cooperation of the third device, the first device can perform service-level self-organizing networking according to the running service. That is, the first device can broadcast a second heartbeat discovery broadcast to the third device. Among them, the second heartbeat discovery broadcast can carry TTL and PFL.
[0346] S1002. The third device responds to the second heartbeat discovery broadcast.
[0347] The third device can receive the second heartbeat discovery broadcast and can respond to the second heartbeat discovery broadcast. For example, it can form a network with the first device.
[0348] S1003. The third device actively updates its own service status.
[0349] Among them, after successful networking, the third device can actively update its own service status to the first device according to the PFL in the second heartbeat discovery broadcast.
[0350] S1004. The first device updates the TTL.
[0351] When the first device detects that the TTL is about to expire and the service on the first device is still in the service state, that is, when the service on the first device still requires the cooperation of the third device, the first device can update the TTL to the third device.
[0352] S1005. The third device updates the TTL.
[0353] After the third device receives the updated TTL from the first device, it can update the TTL saved in the third device. That is, the third device can update the TTL it saves to the updated TTL.
[0354] S1006. The third device actively updates its own service status.
[0355] Among them, after the third device updates the TTL it saves, within the updated TTL, it can continue to actively report its own service status to the first device according to the PFL, so that the third device can continue to maintain the networking state with the first device during the operation of the service on the first device.
[0356] S1007. The first device updates the TTL to 0.
[0357] 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, and the updated TTL is 0, so that the third device can stop reporting the service status.
[0358] S1008. The third device stops reporting its own service status.
[0359] After the third device receives the TTL updated to 0 by the first device, or when the third device detects that the TTL has timed out, the third device may no longer report its own service status to the first device.
[0360] In the embodiments of the present application, the power of the low-power device is relatively low. To avoid power consumption, the low-power device generally does not respond to periodic device-level self-organizing networks. Therefore, when the first device broadcasts the first heartbeat discovery broadcast, that is, when the first device performs device-level self-organizing network, the third device may not respond to the first heartbeat discovery broadcast. Additionally, to avoid power consumption, the third device will not initiate a self-organizing network actively, that is, the third device will not broadcast the first heartbeat discovery broadcast either.
[0361] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution is prior or posterior. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0362] Corresponding to the networking method described in the above embodiments, the embodiments of the present application further provide a networking device, and each module of the device can correspondingly implement each step of the networking method.
[0363] It should be noted that the information interaction, execution process, etc. between the above device / units, due to being based on the same concept as the method embodiments of the present application, for its specific functions and the technical effects brought, please refer to the method embodiment part specifically, and will not be elaborated here.
[0364] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units. Additionally, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here.
[0365] An embodiment of the present application also provides an electronic device, which includes 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 in any of the above method embodiments. Exemplarily, the structure of the electronic device may be as shown in Figure 2 shown.
[0366] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, causes the computer to implement the steps in any of the above method embodiments.
[0367] An embodiment of the present application provides a computer program product, which, when running on an electronic device, causes the electronic device to implement the steps in any of the above method embodiments.
[0368] 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, all or part of the processes in the above embodiment methods of the present application can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device capable of carrying the computer program code to the device / electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable storage medium may not be an electrical carrier signal and a telecommunication signal.
[0369] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0370] Those of ordinary skill in the art will realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
[0371] In the embodiments provided in this 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 illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0372] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0373] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A communication system, characterized in that, The communication system includes a first device and a second device; The first device is used for broadcasting a first heartbeat discovery broadcast, where 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 of the first device, and the third identifier is used to indicate the trusted device corresponding to the first device; The second device is used for receiving the first heartbeat discovery broadcast and matching at least one of the first identifier, the second identifier, and the third identifier with a fourth identifier. 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 used for, after establishing a connection with the second device based on the connection request, sending an authentication request to the second device, where the authentication request is used for authentication between the first device and the second device; The second device is further used for, when determining that the authentication between the first device and the second device fails, saving the device ID of the first device to a filtering list.
3. The system according to claim 1 or 2, characterized in that, 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 used for, according to the service running on the first device, determining the survival time of the service, the third device, and the status response time interval corresponding to the third device, and sending 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 used for receiving the second heartbeat discovery broadcast and, after networking with the first device according to the second heartbeat discovery broadcast, reporting 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 used for broadcasting a third heartbeat discovery broadcast, where 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 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 first 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 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 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 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, wherein 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 determining the fourth identifier based on the compressed data includes: 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. During 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.
Citation Information
Patent Citations
Method of transmitting / receiving signal in proximity network and electronic device thereof
CN107005830A
Wireless communication method and terminal equipment
CN114339709A
Communication method and device
CN115515176A
Managing connections for data communications using heartbeat messaging
US20170302557A1
Selective reporting of tracking area identity to core network in non-terrestrial networks
WO2022208452A1