Multi-hop networking method, device, electronic device and computer-readable storage medium
By adopting a multi-hop networking method in wireless communication and updating the device discovery duration and cycle duration, the problem of rapid device power consumption is solved, the efficiency of device discovery and power usage are improved, and timely access is ensured when a suitable GO is found. .
Patent Information
- Application Number
- CN202310781405.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-06-29
AI Technical Summary
In wireless communication technology, when a device continuously performs device discovery and service discovery in a fixed period, it is unable to find a suitable GO (Group Owner) for a long time, resulting in rapid power consumption.
Using a multi-hop networking method, the initialization duration and cycle duration, and the update duration are multiplied by the predetermined value when no accessible device or device that meets the service conditions is found, and the device discovery process is re-executed until the point-to-point P2P group is accessed.
It reduces the frequency of device discovery and service discovery, reduces the power consumption speed and signaling overhead of the device, and ensures that the P2P group can be accessed in time when a suitable GO is found.
Smart Images

Figure CN116600364B_ABST
Abstract
Description
Background Art
[0002] In the field of wireless communication technology, a P2P (Point To Point) group may be constructed through WiFi direct (Wireless Fidelity direct) technology, so that devices supporting wireless networks can access the network through the P2P group.
[0003] In the related art, a device continuously performs device discovery and service discovery at a fixed period until a GO (Group Owner) that can provide services is found, and then the device is connected to the P2P group where the GO is located.
[0004] However, when a suitable GO cannot be found for a long time, continuously performing device discovery and service discovery at a fixed period will cause the device to consume power quickly.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The present disclosure provides a multi-hop networking method, device, electronic device and computer-readable storage medium, which at least to a certain extent overcome the problem of fast power consumption of terminals in the related art.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to one aspect of the present disclosure, a multi-hop networking method is provided, including: initializing a first duration; executing a device discovery process, updating the first duration when no accessible device is found, and re-executing the device discovery process after a periodic duration, wherein the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the periodic duration is the smallest duration between a predetermined duration and a calculated duration, and the calculated duration is determined based on the first duration; when an accessible device is found, executing a service discovery process, and when no device satisfying a predetermined service condition is found, re-executing the device discovery process after the periodic duration until access is made to the point-to-point P2P group.
[0009] In one embodiment of the present disclosure, before executing the device discovery process, it also includes: initializing a second duration; when no device satisfying the predetermined service condition is found, re-executing the device discovery process after the period duration, including: when no device satisfying the predetermined service condition is found, updating the second duration, and re-executing the device discovery process after the period duration, wherein the updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the largest duration between the first duration and the second duration.
[0010] In one embodiment of the present disclosure, executing the service discovery process when an accessible device is discovered includes: initializing a first duration and executing the service discovery process when an accessible device is discovered.
[0011] In one embodiment of the present disclosure, the method further includes: when a device satisfying the predetermined service condition is found, accessing a first P2P group where the device satisfying the predetermined service condition is located to communicate.
[0012] In one embodiment of the present disclosure, after accessing the first P2P group where the device meeting the predetermined service condition is located, the method further includes: establishing a second P2P group and becoming a group administrator GO.
[0013] According to another aspect of the present disclosure, a jump networking method is provided, including: initializing a second duration; executing a device discovery process, and when no accessible device is found, re-executing the device discovery process after a periodic duration, wherein the periodic duration is the minimum duration between a predetermined duration and a calculated duration, and the calculated duration is determined based on the second duration; when an accessible device is found, executing a service discovery process, and when no device satisfying a predetermined service condition is found, updating the second duration, and re-executing the device discovery process after the periodic duration until access to a point-to-point P2P group, wherein the updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
[0014] According to another aspect of the present disclosure, a multi-hop networking device is provided, including: a first initialization module, used to initialize a first duration; a first execution module, used to execute a device discovery process, update the first duration when no accessible device is found, and re-execute the device discovery process after a periodic duration, wherein the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the periodic duration is the smallest duration between a predetermined duration and a calculated duration, and the calculated duration is determined based on the first duration; the first execution module is also used to execute a service discovery process when an accessible device is found, and re-execute the device discovery process after the periodic duration when no device satisfying the predetermined service condition is found, until access to the point-to-point P2P group is achieved.
[0015] In one embodiment of the present disclosure, the first initialization module is also used to initialize the second duration; the first execution module is used to update the second duration when no device satisfying the predetermined service condition is found, and to re-execute the device discovery process after the periodic duration, wherein the updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the largest duration between the first duration and the second duration.
[0016] In one embodiment of the present disclosure, the first execution module is used to initialize a first duration and execute a service discovery process when an accessible device is discovered.
[0017] In one embodiment of the present disclosure, the apparatus further includes: an access module, configured to access a first P2P group where the device meeting the predetermined service condition is located to communicate when the device meeting the predetermined service condition is found.
[0018] In one embodiment of the present disclosure, the device further includes: a creation module, configured to establish a second P2P group and become a group administrator GO.
[0019] According to another aspect of the present disclosure, a multi-hop networking device is provided, including: a second initialization module, used to initialize a second duration; a second execution module, used to execute a device discovery process, and when no accessible device is found, re-execute the device discovery process after a periodic duration, wherein the periodic duration is the smallest duration between a predetermined duration and a calculated duration, and the calculated duration is determined based on the second duration; the second execution module is also used to execute a service discovery process when an accessible device is found, and when no device satisfying a predetermined service condition is found, update the second duration, and re-execute the device discovery process after the periodic duration until access is made to a point-to-point P2P group, wherein the updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
[0020] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the multi-hop networking methods described above by executing the executable instructions.
[0021] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any of the multi-hop networking methods described above is implemented.
[0022] According to another aspect of the present disclosure, a computer program product is provided, wherein the computer program product includes a computer program or computer instructions, and the computer program or the computer instructions are loaded and executed by a processor to enable a computer to implement any of the multi-hop networking methods described above.
[0023] The technical solution provided by the embodiments of the present disclosure includes at least the following beneficial effects:
[0024] The technical solution provided by the embodiments of the present disclosure updates the first duration after the device discovery fails, thereby completing the update of the cycle duration. Since the value of the updated first duration has been increased, when the calculated duration determined according to the first duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculated duration, has also been increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device discovery and service discovery when the device continues to be unable to discover an accessible P2P group, which can reduce the power consumption rate of the device compared to performing service discovery and device discovery at a fixed period.
[0025] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device discovery and service discovery. Compared with device discovery and service discovery in a fixed period, it can also reduce the number of times the device performs useless device discovery and service discovery, thereby reducing the signaling overhead of the device.
[0026] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device discovery and service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0029] Figure 1 A flow chart of a multi-hop networking method in one embodiment of the present disclosure is shown;
[0030] Figure 2A flow chart of a multi-hop networking method in another embodiment of the present disclosure is shown;
[0031] Figure 3 A flow chart of a multi-hop networking method in another embodiment of the present disclosure is shown;
[0032] Figure 4 A flow chart of a multi-hop networking method in another embodiment of the present disclosure is shown;
[0033] Figure 5 A flow chart of a multi-hop networking method in another embodiment of the present disclosure is shown;
[0034] Figure 6 A flow chart of a multi-hop networking method in another embodiment of the present disclosure is shown;
[0035] Figure 7 A schematic diagram of a multi-hop networking device in one embodiment of the present disclosure is shown;
[0036] Figure 8 A schematic diagram of a multi-hop networking device in another embodiment of the present disclosure is shown;
[0037] Fig. 9 A structural block diagram of an electronic device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0039] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0040] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0041] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0042] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0043] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.
[0044] The embodiment of the present disclosure provides a multi-hop networking method, which can be executed by any electronic device with computing and processing capabilities. For example, the electronic device is a device that supports wireless networks and WiFi direct connections.
[0045] Figure 1 A flow chart of a multi-hop networking method in one embodiment of the present disclosure is shown as follows: Figure 1 As shown, the multi-hop networking method provided in the embodiment of the present disclosure includes the following S101 to S103.
[0046] S101, initializing a first duration.
[0047] The specific value of the first duration after initialization is not limited in the embodiments of the present disclosure. For example, the first duration after initialization is 500 ms (milliseconds), or 1 s (seconds), or 10 s, etc.
[0048] In one embodiment, when the device is networking, it is necessary to determine the size relationship between the current network signal strength of the device and the signal strength threshold. When the current network signal strength of the device is less than the signal strength threshold, the first duration is initialized. When the current network signal strength of the device is not less than the signal strength threshold, the device can create a P2P group and become a GO. Afterwards, the device can respond to device discovery requests and service discovery requests (hereinafter referred to as device / service discovery requests) from other devices, and periodically broadcast Beacon (beacon frames) so that other devices can discover the device after receiving the Beacon.
[0049] S102, executing a device discovery process, when no accessible device is found, updating the first duration, and re-executing the device discovery process after a period of time.
[0050] Among them, the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the cycle duration is the smallest duration between the predetermined duration and the calculated duration, and the calculated duration is determined based on the first duration.
[0051] The embodiment of the present disclosure does not limit the specific value of the first predetermined value. For example, the first predetermined value is 1.2, or 1.5, or 2, etc.
[0052] In one embodiment, the calculated duration may be equal to the first duration.
[0053] In another embodiment, the calculation duration can be obtained by performing mathematical operations on the first duration. The present disclosure does not limit how to perform mathematical operations on the first duration. It should be noted that the calculation duration remains unchanged or increases as the first duration increases.
[0054] In one embodiment, the predetermined duration is greater than the first duration after initialization. The embodiment of the present disclosure does not limit the specific value of the predetermined duration, and it can be set based on experience. After the device discovery fails multiple times, the cycle duration is equal to the predetermined duration, and thereafter, the cycle duration no longer increases with the device discovery failure, so the predetermined duration can be used to ensure the minimum frequency of device discovery and service discovery (hereinafter referred to as device / service discovery) of the device.
[0055] The device discovery process may include: sending a Probe Request for device discovery, scanning all channels of the device, and checking whether a Probe Response or Beacon is received. If a Probe Response or Beacon is received, an accessible device is found. On the contrary, if no Probe Response or Beacon is received, no accessible device is found, that is, the device discovery fails.
[0056] The service discovery process may include: sending an SD Query (Service Discovery Query, service discovery request) to an accessible device, receiving an SD Response (Service Discovery Response, service discovery response); and selecting a device that meets the predetermined service conditions based on the GO service information carried in the SD Response.
[0057] S103, when an accessible device is found, a service discovery process is executed. When no device meeting the predetermined service condition is found, the device discovery process is re-executed after a period of time until the point-to-point P2P group is accessed.
[0058] The embodiments of the present disclosure do not limit the specific conditions of the predetermined service conditions, and they can be set based on experience.
[0059] When no device meeting the predetermined service condition is found, the device discovery process is re-executed after a period of time, where the period of time is the period of time mentioned in S102.
[0060] In one embodiment, when a device that meets the predetermined service condition is found, the first P2P group where the device that meets the predetermined service condition is located is accessed to perform communication.
[0061] In one embodiment, after accessing the first P2P group where the device that meets the predetermined service conditions is located, it may also include: establishing a second P2P group and becoming a GO. After that, the device can respond to the device / service discovery request of other devices, and periodically broadcast Beacon, so that other devices can find the device after receiving the Beacon. After accessing the first P2P group, the second P2P group is established as a GO, thereby allowing other devices to access the second P2P group, which increases the flexibility of networking and facilitates flexible expansion and dynamic adjustment of the network.
[0062] After the device discovery is successful, it is considered that there is an accessible device, so the frequency of device discovery can be increased, thereby improving the efficiency of finding a suitable GO from the accessible devices to access the P2P group where the GO is located.
[0063] In one embodiment, when an accessible device is discovered, executing the service discovery process may include: when an accessible device is discovered, initializing a first duration and executing the service discovery process. By initializing the first duration after successful device discovery, it is beneficial to perform service discovery more frequently, so that a suitable GO can be discovered more timely and the network where the GO is located can be accessed, thereby improving the efficiency of the network.
[0064] The technical solution provided by the embodiments of the present disclosure updates the first duration after the device discovery fails, thereby completing the update of the cycle duration. Since the value of the updated first duration has been increased, when the calculated duration determined according to the first duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculated duration, has also been increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device discovery and service discovery when the device continues to be unable to discover an accessible P2P group, which can reduce the power consumption rate of the device compared to performing service discovery and device discovery at a fixed period.
[0065] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device / service discovery. Compared with device / service discovery in a fixed period, it can also reduce the number of times the device performs useless device / service discovery and reduce the signaling overhead of the device.
[0066] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device / service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0067] The following example takes the first time length as T1, the predetermined time length as Tmax, the first predetermined value as C1, the calculation time length as f(T1), and the cycle time length as T as an example, and combines Figure 2 To illustrate the multi-hop networking method in another embodiment of the present disclosure. Figure 2 As shown, the multi-hop networking method provided in the embodiment of the present disclosure includes the following S201 to S209.
[0068] S201, initialize T1.
[0069] S202, perform device discovery (scan all channels and send Probe Request).
[0070] S203, determine whether a Probe Response or Beacon is received. If a Probe Response or Beacon is not received, execute S204; if a Probe Response or Beacon is received, execute S206.
[0071] S204, update T1, T1=C1×T1.
[0072] S205, re-execute S202 after T, wherein T = min{Tmax,f(T1)}, and min{,} is a minimum value function.
[0073] S206, perform service discovery (send SD Query, receive SD Response).
[0074] S207, weighting the performance of the GO based on the GO service information carried in the SD Response to determine a performance score of the GO.
[0075] S208, judging whether there is a GO suitable for access (determining whether there is a GO whose performance score meets the preset conditions according to the performance score of the GO). If there is a GO suitable for access, execute S209; if there is no GO suitable for access, execute S205.
[0076] S209, access the P2P group where the appropriate GO is located.
[0077] In one embodiment, S209 may further include S210: creating a P2P group, becoming a GO, responding to device / service discovery requests, and periodically broadcasting Beacons.
[0078] In one embodiment, S206 includes S2061 and S2062, wherein S2061: initialize T1; S2062: perform service discovery (send SD Query, receive SD Response).
[0079] For the specific implementation of S201 to S209, please refer to Figure 1 The corresponding embodiments will not be described in detail here.
[0080] In one embodiment, in the above Figure 1 Before S102 of the corresponding embodiment, it may also include: initializing the second duration; S103 includes: when no device meeting the predetermined service conditions is found, re-executing the device discovery process after the periodic duration, which may include: when no device meeting the predetermined service conditions is found, updating the second duration, and re-executing the device discovery process after the periodic duration.
[0081] The updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the largest duration between the first duration and the second duration.
[0082] Accordingly, if Figure 3 As shown, the multi-hop networking method provided in another embodiment of the present disclosure may include S301 to S303. It should be noted that the specific implementation of S303 to S303 can refer to Figure 1 and Figure 2 The corresponding embodiments.
[0083] S301, initializing a first duration and a second duration.
[0084] The specific value of the second time length after initialization is not limited in the embodiment of the present disclosure. For example, the second time length after initialization is 500 ms (milliseconds), or 1 s (seconds), or 10 s, etc.
[0085] The embodiment of the present disclosure does not limit the relationship between the first duration after initialization and the second duration after initialization. For example, the first duration after initialization is equal to the second duration after initialization, or the first duration after initialization is greater than the second duration after initialization, or the first duration after initialization is less than the second duration after initialization.
[0086] S302, executing a device discovery process, when no accessible device is found, updating the first duration, and re-executing the device discovery process after a period of time.
[0087] Among them, the updated first duration is the first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the cycle duration is the smallest duration between the predetermined duration and the calculated duration, and the calculated duration is the largest duration between the first duration and the second duration.
[0088] S303, when an accessible device is found, a service discovery process is executed. When no device meeting the predetermined service condition is found, the second duration is updated, and the device discovery process is re-executed after the period duration until the point-to-point P2P group is accessed.
[0089] The updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1. The embodiment of the present disclosure does not limit the specific value of the second predetermined value. For example, the second predetermined value is 1.2, or 1.5, or 2, etc.
[0090] When no device satisfying the predetermined service condition is found, the second duration is updated, and the device discovery process is re-executed after the period duration, which is the period duration mentioned in S302.
[0091] In one embodiment, when a device that meets the predetermined service condition is found, the first P2P group where the device that meets the predetermined service condition is located is accessed to perform communication.
[0092] In one embodiment, after accessing the first P2P group where the device meeting the predetermined service condition is located, the method may further include: establishing a second P2P group to become a GO.
[0093] In one embodiment, when an accessible device is discovered, executing a service discovery process may include: when an accessible device is discovered, initializing a first duration and executing the service discovery process.
[0094] The technical solution provided by the embodiments of the present disclosure is to update the first duration after the device discovery fails, and to update the second duration after the service discovery fails, and then complete the update of the cycle duration according to the updated first duration and the second duration. Since the values of the updated first duration and the second duration are increased, the corresponding calculation duration value is also increased accordingly. When the calculation duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculation duration, is also increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device / service discovery when the device continues to be unable to discover an accessible P2P group, and can reduce the power consumption rate of the device compared to performing service / device discovery at a fixed period.
[0095] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device / service discovery. Compared with device / service discovery in a fixed period, it can also reduce the number of times the device performs useless device / service discovery and reduce the signaling overhead of the device.
[0096] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device / service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0097] The following example takes the first duration as T1, the second duration as T2, the predetermined duration as Tmax, the first predetermined value as C1, the second predetermined value as C2, the calculation duration as max{T1,T2}, and the cycle duration as T as an example, and combines Figure 4 To illustrate a multi-hop networking method in another embodiment of the present disclosure. Wherein, max{,} is a maximum value function. Figure 4 As shown, the multi-hop networking method provided in the embodiment of the present disclosure includes the following S401 to S410.
[0098] S401, initialize T1 and T2.
[0099] S402, perform device discovery (scan all channels and send Probe Request).
[0100] S403, determine whether a Probe Response or Beacon is received. If a Probe Response or Beacon is not received, execute S404; if a Probe Response or Beacon is received, execute S406.
[0101] S404, update T1, T1 = C1 × T1.
[0102] S405, re-execute S402 after T, wherein T = min{Tmax, max{T1, T2}}, and min{,} is a minimum value function.
[0103] S406, perform service discovery (send SD Query, receive SD Response).
[0104] S407, weighting the performance of the GO based on the GO service information carried in the SD Response to determine a performance score of the GO.
[0105] S408, judging whether there is a GO suitable for access (determining whether there is a GO whose performance score meets a preset condition according to the performance score of the GO). If there is a GO suitable for access, executing S409; if there is no GO suitable for access, executing S410.
[0106] S409, access the P2P group where the appropriate GO is located.
[0107] S410, update T2, and execute S405. The method of updating T2 is: T2 = C2 × T2.
[0108] In one embodiment, after S409, S4091 may also be included: creating a P2P group, becoming a GO, responding to device / service discovery requests, and periodically broadcasting Beacons.
[0109] In one embodiment, S406 includes S4061 and S4062, wherein S4061: initialize T1; S4062: perform service discovery (send SD Query, receive SD Response).
[0110] For the specific implementation of S401 to S410, please refer to Figure 3 The corresponding embodiments will not be described in detail here.
[0111] In one embodiment, Figure 5 As shown, the multi-hop networking method provided in another embodiment of the present disclosure includes the following S501 to S503. It should be noted that the specific implementation of S501 to S503 can be found in Figure 1-Figure 4 The corresponding embodiment, about Figure 5 For the understanding of the nouns involved in the corresponding embodiments, please refer to Figure 1-Figure 4 The corresponding embodiments will not be described in detail here.
[0112] S501, initializing the second duration.
[0113] S502, executing a device discovery process, and when no accessible device is found, re-executing the device discovery process after a period of time.
[0114] The cycle duration is the smallest duration between the predetermined duration and the calculated duration, and the calculated duration is determined based on the second duration.
[0115] In one embodiment, the calculation duration may be equal to the second duration.
[0116] In another embodiment, the calculation duration can be obtained by performing mathematical operations on the second duration. The present disclosure does not limit how to perform mathematical operations on the second duration. It should be noted that the calculation duration remains unchanged or increases as the second duration increases.
[0117] S503, when an accessible device is found, a service discovery process is executed. When no device that meets the predetermined service condition is found, the second duration is updated, and the device discovery process is re-executed after the period duration until the point-to-point P2P group is accessed.
[0118] The updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
[0119] When no device meeting the predetermined service condition is found, the device discovery process is re-executed after a period of time, where the period of time is the period of time mentioned in S502.
[0120] In one embodiment, when a device that meets the predetermined service condition is found, the first P2P group where the device that meets the predetermined service condition is located is accessed to perform communication.
[0121] In one embodiment, after accessing the first P2P group where the device meeting the predetermined service condition is located, the method may further include: establishing a second P2P group and becoming a group administrator GO.
[0122] The technical solution provided by the embodiments of the present disclosure updates the second duration after the service discovery fails, thereby completing the update of the cycle duration. Since the value of the updated second duration has been increased, when the calculated duration determined according to the second duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculated duration, has also been increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device / service discovery when the device continues to be unable to discover an accessible P2P group, which can reduce the power consumption of the device compared to performing service discovery and device discovery at a fixed period.
[0123] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device / service discovery. Compared with device / service discovery in a fixed period, it can also reduce the number of times the device performs useless device / service discovery and reduce the signaling overhead of the device.
[0124] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device / service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0125] The following example takes the second time length as T2, the predetermined time length as Tmax, the second predetermined value as C2, the calculation time length as f(T2), and the cycle time length as T as an example, and combines Figure 6 To illustrate a multi-hop networking method in another embodiment of the present disclosure. Figure 6 As shown, the multi-hop networking method provided in the embodiment of the present disclosure includes the following S601 to S609.
[0126] S601, initialize T2.
[0127] S602, perform device discovery (scan all channels and send Probe Request).
[0128] S603, determine whether a Probe Response or Beacon is received. If no Probe Response or Beacon is received, execute S604; if a Probe Response or Beacon is received, execute S605.
[0129] S604, re-execute S602 after T, where T = min{Tmax,f(T2)}, and min{,} is a minimum value function.
[0130] S605, perform service discovery (send SD Query, receive SD Response).
[0131] S606: Weight the performance of the GO based on the GO service information carried in the SD Response to determine a performance score of the GO.
[0132] S607, determine whether there is a GO suitable for access (determine whether there is a GO whose performance score meets the preset conditions according to the performance score of the GO). If there is a GO suitable for access, execute S608; if there is no GO suitable for access, execute S609.
[0133] S608: Access the P2P group where the appropriate GO is located.
[0134] S609, update T2, and execute S604. The method of updating T2 is: T2 = C2 × T2.
[0135] In one embodiment, S608 may further include S6081: creating a P2P group, becoming a GO, responding to device / service discovery requests, and periodically broadcasting Beacons.
[0136] For the specific implementation of S601 to S609, please refer to Figure 5 The corresponding embodiments will not be described in detail here.
[0137] Based on the same inventive concept, the present disclosure also provides two multi-hop devices, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0138] Figure 7 A schematic diagram of a multi-hop networking device in one embodiment of the present disclosure is shown. Figure 7As shown, the device includes: a first initialization module 701, used to initialize the first duration; a first execution module 702, used to execute the device discovery process, when no accessible device is found, update the first duration, and re-execute the device discovery process after a periodic duration, wherein the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the periodic duration is the minimum duration between the predetermined duration and the calculated duration, and the calculated duration is determined based on the first duration; the first execution module 702 is also used to execute the service discovery process when an accessible device is found, and when no device meeting the predetermined service conditions is found, re-execute the device discovery process after a periodic duration until access is made to the point-to-point P2P group.
[0139] In one embodiment of the present disclosure, the first initialization module 701 is also used to initialize the second duration; the first execution module 702 is used to update the second duration when no device satisfying the predetermined service condition is found, and to re-execute the device discovery process after a periodic period, wherein the updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the largest duration between the first duration and the second duration.
[0140] In one embodiment of the present disclosure, the first execution module 702 is used to initialize a first duration and execute a service discovery process when an accessible device is discovered.
[0141] In one embodiment of the present disclosure, the apparatus further includes: an access module 703, configured to access a first P2P group where the device meeting the predetermined service condition is located to communicate when the device meeting the predetermined service condition is found.
[0142] In one embodiment of the present disclosure, the apparatus further includes: a creation module 704, configured to establish a second P2P group and become a group administrator GO.
[0143] The technical solution provided by the embodiments of the present disclosure updates the first duration after the device discovery fails, thereby completing the update of the cycle duration. Since the value of the updated first duration has been increased, when the calculated duration determined according to the first duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculated duration, has also been increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device discovery and service discovery when the device continues to be unable to discover an accessible P2P group, which can reduce the power consumption rate of the device compared to performing service discovery and device discovery at a fixed period.
[0144] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device / service discovery. Compared with device / service discovery in a fixed period, it can also reduce the number of times the device performs useless device / service discovery and reduce the signaling overhead of the device.
[0145] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device / service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0146] Figure 8 A schematic diagram of a multi-hop networking device in another embodiment of the present disclosure is shown. Figure 8 As shown, the device includes: a second initialization module 801, used to initialize the second duration; a second execution module 802, used to execute the device discovery process, and when no accessible device is found, re-execute the device discovery process after the periodic duration, wherein the periodic duration is the minimum duration between the predetermined duration and the calculated duration, and the calculated duration is determined based on the second duration; the second execution module 802 is also used to execute the service discovery process when an accessible device is found, and when no device satisfying the predetermined service condition is found, update the second duration, and re-execute the device discovery process after the periodic duration until access to the point-to-point P2P group, wherein the updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
[0147] The technical solution provided by the embodiments of the present disclosure updates the second duration after the service discovery fails, thereby completing the update of the cycle duration. Since the value of the updated second duration has been increased, when the calculated duration determined according to the second duration is less than the predetermined duration, the cycle duration, which is the smallest duration between the predetermined duration and the calculated duration, has also been increased accordingly. Therefore, after the device discovery or service discovery fails, the method of waiting for the cycle duration before the next device discovery can reduce the frequency of device / service discovery when the device continues to be unable to discover an accessible P2P group, which can reduce the power consumption of the device compared to performing service discovery and device discovery at a fixed period.
[0148] Furthermore, when device discovery or service discovery fails, it can be considered that there is no suitable GO in the current environment, reducing the frequency of device / service discovery. Compared with device / service discovery in a fixed period, it can also reduce the number of times the device performs useless device / service discovery and reduce the signaling overhead of the device.
[0149] Furthermore, by limiting the maximum value of the cycle duration by a predetermined duration, the minimum frequency of device / service discovery by the device can be ensured, thereby ensuring that after a suitable GO appears, the device can promptly access the P2P group where the GO is located.
[0150] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0151] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0152] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0153] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Specific Implementation Methods” section of this specification.
[0154] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .
[0155] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0156] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0157] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 900, and / or any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 960. Fig. 9 As shown, the network adapter 960 communicates with other modules of the electronic device 900 via the bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0158] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0159] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above-mentioned method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Specific Implementation Methods” section of this specification.
[0160] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0161] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0162] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0163] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0164] In an exemplary embodiment of the present disclosure, a computer program product is also provided, which includes a computer program or computer instructions, and the computer program or computer instructions are loaded and executed by a processor to enable a computer to implement the steps of various exemplary embodiments of the present disclosure described in the above "Specific Implementation" section of this specification.
[0165] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0166] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0167] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0168] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be regarded as exemplary only, and the true scope of the present disclosure is indicated by the appended claims.
Claims
1. A multi-hop networking method, characterized in that: include: Initialize the first duration; Execute a device discovery process, and when no accessible device is found, update the first duration, and re-execute the device discovery process after the periodic duration, wherein the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the periodic duration is the smallest duration between the predetermined duration and the calculated duration, and the calculated duration is determined according to the updated first duration; the calculated duration remains unchanged or increases as the updated first duration increases; the predetermined duration is greater than the first duration after initialization; When an accessible device is found, a service discovery process is executed. When no device meeting the predetermined service condition is found, the device discovery process is re-executed after the period time until the point-to-point P2P group is accessed.
2. The method according to claim 1, characterized in that Before executing the device discovery process, the process also includes: Initialize the second duration; When no device meeting the predetermined service condition is found, re-execute the device discovery process after the period, including: When no device satisfying the predetermined service condition is found, the second duration is updated, and the device discovery process is re-executed after the period duration, wherein the updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the maximum duration between the first duration and the second duration.
3. The method according to claim 1 or 2, characterized in that: When discovering an accessible device, executing a service discovery process includes: When an accessible device is discovered, the first duration is initialized and the service discovery process is executed.
4. The method according to claim 1 or 2, characterized in that: Also includes: When a device that meets the predetermined service condition is found, a first P2P group where the device that meets the predetermined service condition is located is accessed to perform communication.
5. The method according to claim 4, characterized in that After accessing the first P2P group where the device meeting the predetermined service condition is located, the method further includes: Create a second P2P group and become the group administrator GO.
6. A multi-hop networking method, characterized in that: include: Initialize the second duration; Execute a device discovery process, and when no accessible device is found, re-execute the device discovery process after a period, wherein the period is the shorter of a predetermined period and a calculated period, the calculated period is determined according to a second period; the calculated period remains unchanged or increases as the second period increases; the predetermined period is greater than the second period after initialization; When an accessible device is discovered, a service discovery process is executed. When no device satisfying the predetermined service conditions is discovered, the second duration is updated, and the device discovery process is re-executed after the periodic duration until the point-to-point P2P group is accessed, wherein the updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
7. A multi-hop networking device, characterized in that: include: A first initialization module, used to initialize a first duration; A first execution module is used to execute a device discovery process, and when no accessible device is found, the first duration is updated, and the device discovery process is re-executed after a periodic duration, wherein the updated first duration is a first predetermined value times the first duration before the update, the first predetermined value is greater than 1, the periodic duration is the smallest duration between the predetermined duration and the calculated duration, and the calculated duration is determined according to the updated first duration; the calculated duration remains unchanged or increases as the updated first duration increases; the predetermined duration is greater than the first duration after initialization; The first execution module is further used to execute the service discovery process when an accessible device is found, and to re-execute the device discovery process after the period when no device meeting the predetermined service condition is found, until the point-to-point P2P group is accessed.
8. The device according to claim 7, characterized in that The first initialization module is further used to initialize the second duration; The first execution module is used to update the second duration when no device satisfying the predetermined service condition is found, and to re-execute the device discovery process after the periodic duration, wherein the updated second duration is a second predetermined value times the second duration before the update, the second predetermined value is greater than 1, and the calculated duration is the maximum duration between the first duration and the second duration.
9. A multi-hop networking device, characterized in that: include: A second initialization module, used to initialize the second duration; A second execution module is used to execute a device discovery process, and when no accessible device is found, the device discovery process is re-executed after a period of time, wherein the period of time is the minimum of a predetermined time and a calculated time, and the calculated time is determined according to the second time; the calculated time remains unchanged or increases with the increase of the updated first time; the predetermined time is greater than the second time after initialization; The second execution module is also used to execute the service discovery process when an accessible device is found, update the second duration when no device meeting the predetermined service conditions is found, and re-execute the device discovery process after the periodic duration until the point-to-point P2P group is accessed, wherein the updated second duration is a second predetermined value times the second duration before the update, and the second predetermined value is greater than 1.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the multi-hop networking method according to any one of claims 1 to 6 by executing the executable instructions.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-hop networking method according to any one of claims 1 to 6 is implemented.
