A communication method, device, equipment and storage medium
By sending scanning information to the second device in BLE Mesh technology, the first device initiates the scanning function within a specified time period, solving the problem of high dependence of low-power consumption devices in the prior art in networking, and realizing low-power packet scanning.
Patent Information
- Application Number
- CN202011232428.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2040-11-06
AI Technical Summary
The existing BLE Mesh technology cannot effectively solve the high dependence problems of low-power devices in terms of hardware computing capabilities, clock accuracy, protocol stack and software efficiency in networking, resulting in the inability to truly achieve low-power consumption requirements.
By sending information including the scan opening time and the scanning window duration to the second device, the first device starts the scanning function within a specified time period and scans data packets sent by the second device within that time period, thereby optimizing the opening time of the scanning function.
It is realized that while ensuring data packet scanning, the scanning function opening time of the first device is significantly shortened, thereby reducing the power consumption of the device.
Smart Images

Figure CN112702718B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to but is not limited to the field of communication technology, and in particular to a communication method, apparatus, device and storage medium. Background Art
[0002] With the continuous development of Internet of Things technology, Bluetooth technology has gradually become one of the most important short-distance communication methods; Bluetooth low energy (BLE) technology has quickly become the main communication technology in the field of Internet of Things. As the most important feature of Bluetooth technology, Bluetooth low energy technology has always been at the core of Bluetooth applications.
[0003] Although the existing BLE Mesh technology provides a low-power solution based on friendly nodes and low-power nodes, this solution is highly dependent on the hardware computing power, clock accuracy, protocol stack, software efficiency, and roles between devices of low-power devices, and cannot truly solve the problem of low-power requirements of devices in the network. Summary of the invention
[0004] The present disclosure provides a communication method, apparatus, device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a communication method is provided, which is applied to a first device, and the method includes:
[0006] Sending first information to the second device, wherein the first information at least includes: scanning information; the scanning information includes a scanning start time and a scanning window duration;
[0007] Starting a scanning function of the first device at the scanning start time according to the scanning information;
[0008] Scanning the data packet sent by the second device within the scanning window duration after the scanning start time according to the scanning information;
[0009] After the scan start time exceeds the scan window duration or after the data packet is received, the scan function is turned off.
[0010] In the above solution, the sending the first information to the second device includes:
[0011] The first information is sent to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0012] In the above scheme, the method further includes one of the following:
[0013] Determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized;
[0014] The first information is determined based on a dynamic configuration parameter, wherein the dynamic configuration parameter is sent by any device that is networked with the first device.
[0015] In the above solution, the first information also includes transmission information; the transmission information includes at least one of the following:
[0016] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0017] Repeat count information, indicating the number of times a data packet is transmitted;
[0018] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0019] In the above scheme, the method further comprises:
[0020] After receiving the data packet, transmission feedback indicating successful reception of the data packet is sent to the second device.
[0021] In the above scheme, the method further comprises:
[0022] If the data packet is not received, scan the data packet retransmitted by the second device based on the transmission information.
[0023] In the above scheme, the method further comprises:
[0024] If a conflict occurs in data packet transmission between a plurality of the first devices and the second device, re-determine the scanning start time;
[0025] The first information carrying the re-determined scanning on time is retransmitted to the second device.
[0026] In the above solution, starting the scanning function of the first device at the scanning start time according to the scanning information includes:
[0027] Starting a scanning function at the re-determined scanning start time according to the scanning information;
[0028] The step of scanning the data packet sent by the second device within the scanning window duration after the scanning start time according to the scanning information includes:
[0029] Scanning the data packets sent by the second device within the scanning window duration after the re-determined scanning is started according to the scanning information;
[0030] The step of disabling the scanning function after the scanning start time exceeds the scanning window duration or after the data packet is received includes:
[0031] After the scan start time that is re-determined according to the scan information exceeds the scan window duration or after the data packet is received, the scan function is turned off.
[0032] In the above solution, the re-determining the scanning start time includes:
[0033] The scan-on time is re-determined based on the scan-on time before re-determination and the random delay time.
[0034] According to a second aspect of an embodiment of the present disclosure, a communication method is provided, which is applied to a second device, and the method includes:
[0035] Receiving first information sent by at least one first device, wherein the first information at least includes scanning information; the scanning information includes: scanning start time and scanning window duration;
[0036] According to the scanning information, a data packet is sent to the first device within the scanning window duration after the scanning start time is reached.
[0037] In the above solution, the receiving the first information sent by at least one of the first devices includes:
[0038] The first information is received which is sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0039] In the above scheme, the method further comprises:
[0040] Recording a timestamp of receiving the first information;
[0041] The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes:
[0042] If the timestamp is earlier than the scan start time, a data packet is sent to the first device within the scan window duration after the scan start time is reached.
[0043] In the above solution, sending a data packet to the first device within the scanning window duration after reaching the scanning start time includes:
[0044] If the timestamp is later than the scan start time, delaying at least one of the scan cycles based on the scan start time to determine the next scan start time;
[0045] The data packet is sent to the first device within the scanning window duration after the next scanning start time is reached.
[0046] In the above solution, the first information includes: transmission information; the transmission information includes at least one of the following:
[0047] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0048] Repeat count information, indicating the number of times a data packet is transmitted;
[0049] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0050] In the above scheme, the method further comprises:
[0051] Receive transmission feedback sent by the first device indicating that the data packet is successfully received.
[0052] In the above scheme, the method further comprises:
[0053] If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted.
[0054] In the above solution, if no transmission feedback indicating that the data packet is successfully received is received, retransmitting the data packet includes:
[0055] If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted based on the transmission information.
[0056] In the above solution, if no transmission feedback indicating that the data packet is successfully received is received, retransmitting the data packet based on the transmission information includes:
[0057] If no transmission feedback indicating that the data packet is successfully received is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information, the data packet is retransmitted.
[0058] In the above solution, the retransmitting the data packet includes:
[0059] Delaying the scan start time of the last retransmission or sending of the data packet by at least one of the scan cycles to determine the next scan start time;
[0060] The data packet is retransmitted within the scanning window duration after the next scanning start time.
[0061] In the above scheme, the method further includes:
[0062] receiving the first information retransmitted by the second device and carrying the re-determined scanning start time;
[0063] The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes:
[0064] The data packet is sent to the first device within the scanning window duration after the scanning start time is re-determined.
[0065] In the above solution, the re-determined scan-on time is determined based on the scan-on time before re-determination and the random delay time.
[0066] In the above scheme, the method further includes:
[0067] storing time information of preparing to send data packets to the plurality of first devices in a time queue;
[0068] The sending a data packet to the first device within the scanning window duration after the scanning start time includes:
[0069] If conflicts occur in data packet transmission between a plurality of the first devices and the second device, data packets are sent to the first devices within the scanning window duration after the scanning start time based on the time information of each of the first devices in the time queue.
[0070] In the above solution, the sending of a data packet to the first device within the window duration after the scan start duration is reached based on the time information of the first device in the time queue includes:
[0071] Based on the order of the time information of the first devices in the time queue, the data packet is sent to the first devices at the front of the time information within the scan window duration after the scan start time of the first devices at the front of the time information.
[0072] According to a third aspect of an embodiment of the present disclosure, a communication apparatus is provided, applied to a first device, the apparatus comprising:
[0073] A first sending module is used to send first information to a second device, wherein the first information at least includes: scanning information; the scanning information includes a scanning start time and a scanning window duration;
[0074] A first processing module, configured to start a scanning function of the first device at the scanning start time according to the scanning information;
[0075] A scanning module, configured to scan a data packet sent by the second device within a scanning window duration after the scanning start time according to the scanning information;
[0076] The first processing module is used to turn off the scanning function after the scanning start time exceeds the scanning window time or after receiving the data packet.
[0077] In the above solution, the first sending module is used to send the first information to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0078] In the above solution, the device further includes: a first determining module; wherein,
[0079] The first determination module is used to determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized;
[0080] or,
[0081] The first determination module is used to determine the first information based on a dynamic configuration parameter; wherein the dynamic configuration parameter is sent by any device networked with the first device.
[0082] In the above solution, the first information also includes transmission information; the transmission information includes at least one of the following:
[0083] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0084] Repeat count information, indicating the number of times a data packet is transmitted;
[0085] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0086] In the above solution, the first sending module is used to send transmission feedback indicating successful reception of the data packet to the second device after receiving the data packet.
[0087] In the above solution, the scanning module is used to scan the data packet retransmitted by the second device based on the transmission information if the data packet is not received.
[0088] In the above solution, the first determination module is used to re-determine the scanning start time if a conflict occurs in the data packet transmission between a plurality of the first devices and the second device;
[0089] The first sending module is used to retransmit the first information carrying the re-determined scanning start time to the second device.
[0090] In the above solution, the first processing module is used to start the scanning function at the re-determined scanning start time according to the scanning information;
[0091] The scanning module is used to scan the data packets sent by the second device within the scanning window duration after the re-determined scanning is started according to the scanning information;
[0092] The first processing module is further configured to disable the scanning function after the re-determined scanning start time exceeds the scanning window duration or after the data packet is received according to the scanning information.
[0093] In the above solution, the first determination module is further used to redetermine the scan start time based on the scan start time and the random delay time before redetermining.
[0094] According to a fourth aspect of an embodiment of the present disclosure, a communication apparatus is provided, which is applied to a second device, and the apparatus includes:
[0095] A second receiving module is used to receive first information sent by at least one first device, wherein the first information at least includes scanning information; the scanning information includes: scanning start time and scanning window duration;
[0096] The second sending module is used to send a data packet to the first device within the scanning window duration after the scanning start time is reached according to the scanning information.
[0097] In the above solution, the second receiving module is used to receive the first information sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0098] In the above scheme, the device also includes:
[0099] A recording module, used for recording a timestamp of receiving the first information;
[0100] The second sending module is used to send a data packet to the first device within the scanning window duration after reaching the scanning start time if the timestamp is earlier than the scanning start time.
[0101] In the above scheme, the device comprises:
[0102] A second determination module, configured to, if the timestamp is later than the scan start time, delay the scan start time by at least one scan cycle to determine the next scan start time;
[0103] The second sending module is used to send the data packet to the first device within the scanning window duration after the next scanning start time is reached.
[0104] In the above solution, the first information includes: transmission information; the transmission information includes at least one of the following:
[0105] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0106] Repeat count information, indicating the number of times a data packet is transmitted;
[0107] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0108] In the above scheme, the device also includes:
[0109] The second receiving module is used to receive transmission feedback sent by the first device indicating that the data packet is successfully received.
[0110] In the above scheme, the device also includes:
[0111] The second processing module is configured to retransmit the data packet if no transmission feedback indicating successful reception of the data packet is received.
[0112] In the above solution, the second processing module is used to retransmit the data packet based on the transmission information if no transmission feedback indicating that the data packet is successfully received is received.
[0113] In the above scheme, the second processing module is used to retransmit the data packet if no transmission feedback indicating that the data packet is successfully received is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information.
[0114] In the above scheme, the second processing module is used to delay at least one of the scanning cycles on the scanning start time of the last retransmission or sending of the data packet, determine the next scanning start time; and retransmit the data packet within the scanning window duration after the next scanning start time.
[0115] In the above solution, the device further comprises:
[0116] The second receiving module is used to receive the first information retransmitted by the second device and carrying the re-determined scanning start time;
[0117] The second sending module is used to send the data packet to the first device within the scanning window duration after the scanning start time is re-determined.
[0118] In the above solution, the re-determined scan-on time is determined based on the scan-on time before re-determination and the random delay time.
[0119] In the above solution, the device further comprises:
[0120] The second processing module is used to store time information of preparing to send data packets to the plurality of first devices in a time queue;
[0121] The second sending module is used to send data packets to the first devices within the scanning window duration after the scanning start time based on the time information of each first device in the time queue if a conflict occurs in the data packet transmission of multiple first devices and the second device.
[0122] In the above scheme, the second sending module is used to send the data packet to the first device at the front of the time information within the scanning window duration after the scanning start time of the first device at the front of the time information based on the order of the time information of the first device in the time queue.
[0123] According to a fifth aspect of an embodiment of the present disclosure, a device is provided, including:
[0124] processor;
[0125] a memory for storing processor-executable instructions;
[0126] The processor is configured to: implement the communication method described in any embodiment of the present disclosure when executing the executable instructions.
[0127] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the communication method described in any embodiment of the present disclosure.
[0128] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0129] In an embodiment of the present disclosure, the first device sends first information to the second device, wherein the first information at least includes scanning information of the scanning start time and the scanning window duration, so as to inform the second device that it can send scanning information within the scanning window duration after the scanning start time; in this way, the first device can receive data packets within the scanning window duration after the scanning start time. In this way, the first device can only turn on the scanning function at the scanning start time, and turn off the scanning function when the scanning start time passes the scanning window duration or before the scanning window duration ends, that is, the first device can turn on the scanning function at most within the scanning window duration. In this way, the embodiment of the present disclosure can greatly shorten the time when the scanning function is turned on, while being able to scan data packets, thereby greatly reducing the power consumption of the first device.
[0130] 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
[0131] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0132] Figure 1 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0133] Figure 2 The diagram is a schematic diagram showing a format of a fixed configuration parameter according to an exemplary embodiment.
[0134] Figure 3 The diagram is a schematic diagram showing a format of a fixed configuration parameter according to an exemplary embodiment.
[0135] Figure 4 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0136] Figure 5The figure is a flowchart of a communication method according to an exemplary embodiment.
[0137] Figure 6 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0138] Figure 7 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0139] Figure 8 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0140] Fig. 9 The figure is a flowchart of a communication method according to an exemplary embodiment.
[0141] Fig.10 It is a block diagram of a communication device according to an exemplary embodiment.
[0142] Fig.11 It is a block diagram of a communication device according to an exemplary embodiment.
[0143] Fig.12 It is a block diagram of a communication device according to an exemplary embodiment. DETAILED DESCRIPTION
[0144] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0145] Figure 1 is a block diagram of a communication method according to an exemplary embodiment. Figure 1 As shown, the communication method includes:
[0146] Step S11: Sending first information to the second device, wherein the first information at least includes: scanning information; the scanning information includes scanning start time and scanning window duration;
[0147] Step S12: starting the scanning function of the first device at the scanning start time according to the scanning information;
[0148] Step S13: scanning the data packet sent by the second device within the scanning window duration after the scanning start time according to the scanning information;
[0149] Step S14: after the scanning start time exceeds the scanning window duration or after the data packet is received, turning off the scanning function.
[0150] The method described in the embodiments of the present disclosure is applied to the first device. The first device and the second device may be mobile devices or fixed devices; for example, the first device and the second device may be mobile phones, computers, servers, tablet computers, etc.; or the first device and the device may be wearable devices.
[0151] For example, the first device is a mobile phone and the second device is a speaker; for another example, the first device is a mobile phone and the second device is a mobile phone; for another example, the first device is a notebook and the second device is a wearable watch; and so on.
[0152] Here, the first device and the second device may establish a Bluetooth connection, or the first device and the second device may also establish a wireless network connection.
[0153] In one embodiment, the first device and the second device are devices in a Bluetooth network.
[0154] In one embodiment, the first device is in a Bluetooth Low Energy (BLE) state. In the BLE state, the first device has a scanning function and / or a broadcasting function.
[0155] The sending of the first information here may also be broadcasting of the first information.
[0156] The first information here includes: scanning information; or the first information here includes scanning information and transmission information.
[0157] The scanning information here includes but is not limited to at least one of the following: scanning start time, scanning window duration and period information of the scanning cycle.
[0158] The transmission information herein includes but is not limited to at least one of the following: transmission mode information, repetition number information, and transmission status confirmation method information.
[0159] The first information here may also include, but is not limited to, at least one of the following: a device identifier, a low power identifier, and custom data. The device identifier here is used to uniquely identify the device. The low power identifier here is used to identify whether the device is in a low power state. The custom data here is used to identify the device attributes and / or device capabilities of the first device.
[0160] The sending of the first information here may also be sending the first information via other communication methods. For example, in some embodiments, the sending of the first information includes: sending the first information based on cellular mobile communication or WiFi; wherein the first information is also used to trigger the Bluetooth activation of the second device.
[0161] The scanning information here may include at least one of a start scanning time and a scanning window duration.
[0162] For example, the scanning information is: the scanning start time is the 10th second, and the scanning window duration is 10 milliseconds; then the first device starts the scanning function at the 10th second, and scans from the 10th second to the 10.01th second.
[0163] For another example, the scanning information is: for the first scan, the scanning time is the 10th second, and the corresponding scanning window duration is 10 milliseconds; for the second scan, the scanning time is the 11th second, and the corresponding scanning window duration is 20 milliseconds. Then the first device turns on the scanning function at the 10th second, and scans from the 10th second to the 10.01st second; and turns on the scanning function at the 11th second, and scans from the 11th second to the 11.02nd second.
[0164] One implementation of step S14 is: after the scan start time exceeds the scan window duration, the scan function is turned off.
[0165] Another implementation of step S14 is: if the data packet is received within the scanning window duration after the scanning start time, the scanning function is turned off. In this example, since in step S13, the data packet sent by the second device is scanned within the scanning window duration after the scanning start time; the received data packet in step S14 is within the scanning duration after the scanning start time. For example, the scanning start time is 20 seconds, and the scanning window duration is 10 milliseconds, then the duration of receiving the data packet is between the 20th second and the 20.01th second. In this way, in the disclosed embodiment, the data packet can also be scanned in advance, that is, the scanning function can be turned off within the scanning window duration after the scanning start time; in this way, the operating time of the scanning function can be further shortened, thereby reducing the power consumption of the first device.
[0166] In an embodiment of the present disclosure, the first device sends first information to the second device, wherein the first information at least includes scanning information of the scanning start time and the scanning window duration, so as to inform the second device that it can send scanning information within the scanning window duration after the scanning start time; in this way, the first device can receive data packets within the scanning window duration after the scanning start time. In this way, the first device can only turn on the scanning function at the scanning start time, and turn off the scanning function when the scanning start time passes the scanning window duration or before the scanning window duration ends, that is, the first device can turn on the scanning function at most within the scanning window duration. In this way, the embodiment of the present disclosure can greatly shorten the time when the scanning function is turned on, while being able to scan data packets, thereby greatly reducing the power consumption of the first device.
[0167] It is understandable that in the prior art, the broadcast function of the device with a Bluetooth module is started suddenly, that is, the broadcast function can be started when sending a data packet and turned off after sending the data packet. The power consumption of the device consumed by the broadcast function is relatively small. The running time of the scanning function needs to be much longer than the running time of the broadcast function to confirm the reception of the data packet; thus, the power consumption of the device consumed by the scanning function in the prior art is relatively large. In addition, the power consumption of the scanning function when it is turned on in a single time is much greater than that of the broadcast function; therefore, in the prior art, the power consumption of the device with a Bluetooth module mainly comes from the consumption of the scanning function of the device.
[0168] In the embodiment of the present disclosure, the first information is sent to the second device to inform the second device in which time period the data packet should be sent; thus, the first device can turn on the scanning function only in the time period to scan the data packet; thereby, the activation time of the scanning function can be greatly reduced, thereby reducing the power consumption of the first device.
[0169] In the embodiment of the present disclosure, the sending the first information to the second device includes:
[0170] The first information is sent to the second device at a preset time interval.
[0171] The preset time interval here may be a scanning period.
[0172] In some embodiments, sending the first information to the second device includes:
[0173] The first information is sent to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0174] The period information here is greater than or equal to the scanning window duration. For example, the period information indicating the scanning period is 500 milliseconds, and the scanning window duration is less than or equal to 500 milliseconds.
[0175] The scanning periods of the respective scans may be the same or different, and accordingly, the period information indicating the scanning periods may be the same or different.
[0176] The scan window durations of each scan may also be the same or different.
[0177] In the embodiment of the present disclosure, the first device can periodically send the first information and the first information also includes periodic information indicating the scanning period, so as to inform the second device that it can periodically send the data packet within the scanning window duration after the scanning start time, so that the first device can scan the data packet within the scanning window duration after the scanning start time. In this way, the embodiment of the present disclosure can periodically scan the data packet, which can greatly reduce the problem of high power consumption caused by the first device's scanning function being always on.
[0178] Furthermore, in the disclosed embodiment, the scanning period of the first device can be adjusted dynamically, for example, the previous scanning period can be different from or the same as the next scanning period; or the scanning window duration corresponding to each scanning period of the first device can also be adjusted dynamically, for example, the scanning window duration of the previous scanning period can be the same as or different from the scanning window duration of the next scanning period. In this way, the disclosed embodiment can be adapted to more application scenarios that shorten the operating time of the scanning function, improve the ease of use and versatility of the communication method, and can greatly reduce the power consumption of the first device.
[0179] Of course, in other embodiments, the step S11 may also be: sending the first information less than the predetermined number of times to the second device, wherein the first information includes: scanning information; the scanning information includes the scanning start time, the scanning window duration and the cycle information.
[0180] In one embodiment, the predetermined number of times is 2. Thus, in this example, the first device may send the first information only once.
[0181] For example, in an application scenario, the first device sends the first information to the second device, wherein the first information includes: the scan start time is the 10th second, the scan window duration is 20 milliseconds, and the cycle information is 1 second. Then the first device can scan from the 10th second to the 10.02nd second, from the 11th second to the 11.02nd second, from the 12th second to the 12.02nd second, and so on. Thus, in this example, when the first device scans the next scan, the start time of the next scan can be determined based on the scan start time of the previous scan; for example, the next scan start time can be delayed by one cycle information (for example, delayed by 1 second) on the scan start time of the previous scan; and the scan window duration of each scan can be determined to be 20 milliseconds.
[0182] Thus, in the embodiment of the present disclosure, the first device may scan data packets only under the premise of sending the first information less than a predetermined number of times, which can reduce the transmission of signaling and shorten the time for the first device to send the first information, thereby reducing the power consumption of the first device in sending the first information.
[0183] In some embodiments, the method further comprises one of the following:
[0184] Determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized;
[0185] The first information is determined based on a dynamic configuration parameter, wherein the dynamic configuration parameter is sent by any device that is networked with the first device.
[0186] In the disclosed embodiment, a configuration module may be provided in the first device, and the configuration module may determine the first information based on fixed configuration parameters or dynamic configuration parameters. The configuration module may share a physical unit with the Bluetooth module in the first device, or the configuration module may be a physical unit independent of the Bluetooth module.
[0187] The configuration module here can control the first device to be converted into a low-power node based on fixed configuration parameters or dynamic configuration parameters. The low-power node here is relative to the ordinary node in the network, and the ordinary node is a node with a scanning function that is always on. Any device in the first device network here is any ordinary node in the network, or other low-power nodes in the network.
[0188] The networking here can be Bluetooth networking.
[0189] The configuration module here controls the first device to be converted into a low-power node based on fixed configuration parameters or dynamic configuration parameters in the following implementation manner:
[0190] If the first device does not receive the dynamic configuration parameter, the configuration module controls the first device to be converted into a low-power node based on the fixed configuration parameter;
[0191] If the first device receives the dynamic configuration parameter, the configuration module controls the first device to be converted into a low-power node based on the dynamic configuration parameter.
[0192] For example, in an application scenario, when the first device is initialized, fixed configuration parameters are configured on the configuration module; after the first device is powered on, the first device reads the fixed configuration parameters and determines that the first device is a low-power node; and based on the fixed configuration parameters, determines the first information.
[0193] For example, in another application scenario, the first device receives a dynamic control parameter sent by a common node in the network; and determines the first information based on the dynamic control parameter.
[0194] The contents of the fixed configuration parameters or dynamic configuration parameters here may be the same or different.
[0195] like Figure 2 As shown, a format of fixed configuration parameters is disclosed; the fixed configuration parameters include: cycle information, scan start time, scan window duration, and custom data.
[0196] like Figure 3 As shown, a format of fixed configuration parameters is also disclosed: the fixed configuration parameters include: low power consumption role, cycle information, scan start time, scan window duration, and transmission mode information.
[0197] The low power consumption role here is used to identify whether the first device is a common node or a low power consumption node.
[0198] The transmission mode information here is used to indicate whether the transmission mode of the data packet is a reliable transmission mode, wherein the reliable transmission mode is a mode that requires retransmission of the data packet.
[0199] In the embodiment of the present disclosure, the first device can be converted from a common node (i.e., a device with a scanning function always on) to a low-power node through fixed configuration parameters or dynamic configuration parameters, thereby greatly reducing the power consumption of the first device.
[0200] Moreover, in the disclosed embodiment, when the conversion of the first device into a low-power node is configured by software or based on a physical unit shared by the Bluetooth module, no additional modules need to be added, which can reduce the design cost. When the conversion of the first device into a low-power node is configured by an additional module, multiple implementation methods can also be provided.
[0201] Furthermore, in the embodiment of the present disclosure, the first device can configure the role of the first device in real time according to the dynamic configuration parameters sent by other devices in the network, thereby achieving flexible configuration.
[0202] In some embodiments, the first information further includes transmission information; the transmission information includes at least one of the following:
[0203] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0204] Repeat count information, indicating the number of times a data packet is transmitted;
[0205] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0206] In one embodiment, the transmission mode includes: a first transmission mode and a second transmission mode; wherein the first transmission mode is used to indicate that the number of repeated transmissions of a data packet is 0 times; and the second transmission mode is used to indicate that the number of repeated transmissions of a data packet is less than or equal to a first predetermined number.
[0207] In this example, if the communication quality between the first device and the second device is relatively good, for example, the distance between the first device and the second device is relatively short, or the data packets between the first device and the second device are not very important, the first transmission mode can be used to transmit the data packets.
[0208] If the communication quality between the first device and the second device is not very good or the importance of the data packets between the first device and the second device is relatively high, the second transmission mode can be used to transmit the data packets; thereby improving the reliability of data packet transmission.
[0209] In the above embodiment, the transmission mode also includes: a third transmission mode; wherein the third transmission mode is used to indicate that the number of repeated transmissions of a data packet is greater than the first predetermined number and less than or equal to the second predetermined number; wherein the first predetermined number is less than the second predetermined number.
[0210] Thus, in this example, the probability of the data packet being successfully received by the first device can be ensured by setting a higher number of transmission times of the data packet.
[0211] In one embodiment, the transmission status confirmation method includes: a first confirmation method. The first confirmation method here is: when the first device receives a data packet, it sends a transmission feedback of successful reception; when the first device does not receive a data packet, it sends a transmission feedback of failed reception.
[0212] In another embodiment, the transmission status confirmation method includes: a second confirmation method. The second confirmation method here is: when the first device receives the data packet, it sends a transmission feedback of successful reception; when the first device does not receive the data packet, it does not send a transmission feedback.
[0213] Thus, in the disclosed embodiment, the first device also sends the first information including transmission information to the second device to inform the second device of the transmission mode, the number of transmission times of the data packet that needs to be retransmitted and / or the transmission status mode indication, etc.; this can improve the stability and reliability of the data packet transmission between the first device and the second device, etc.
[0214] like Figure 4 As shown, in some embodiments, the method further includes:
[0215] Step S15: After receiving the data packet, sending a transmission feedback indicating successful reception of the data packet to the second device.
[0216] Thus, in the embodiment of the present disclosure, when the first device receives a data packet, transmission feedback indicating that the data packet has been successfully received can be sent to the second device; thereby informing the second device that there is no need to retransmit the data packet, thereby saving the overhead of transmitting the data packet between the second device and the first device, and saving the scanning power consumption of the first device scanning the data packet, etc.
[0217] Furthermore, in the embodiment of the present disclosure, if transmission feedback is sent to the second device only when the first device receives a data packet, and no transmission feedback is sent when the first device does not receive a data packet, the overhead of sending transmission feedback can be further saved.
[0218] Of course, in other embodiments, the method may further include: if the data packet is not received within the scanning window duration from the scanning start time, sending a transmission feedback indicating that the data packet reception failed to the second device. In this way, the reliability of data packet transmission between the first device and the second device can be further ensured.
[0219] In some embodiments, the method further comprises:
[0220] If the data packet is not received, scan the data packet retransmitted by the second device based on the transmission information.
[0221] Here, one implementation of scanning the data packet retransmitted by the second device based on the transmission information is:
[0222] Based on the repeated transmission information in the transmission information, scan the data packet retransmitted by the second device.
[0223] Here, one implementation manner of scanning the data packet retransmitted by the second device based on the repeated transmission information in the transmission information is:
[0224] If the number of times the data packet is retransmitted by the second device currently received is less than or equal to the number of transmissions indicated by the repeated transmission information, scan the data packet retransmitted by the second device.
[0225] For example, if the number of repeated transmissions is 5 times, and the first device does not receive a data packet during the first scan, it can receive the data packet retransmitted by the second device within the scan window duration after the scan start time of the second scan; if the retransmitted data packet is received, a transmission feedback of successful reception is sent to the second device; if the retransmitted data packet is not received, it can receive the data packet retransmitted by the second device within the scan window duration after the scan start time of the third scan; and so on, until the retransmitted data packet from the second device is received within the scan window duration after the scan start time of the sixth scan (i.e., the second device has retransmitted 5 times), the scan is terminated.
[0226] In an embodiment of the present disclosure, when the first device does not receive a data packet, it can also scan the data packet retransmitted by the second device based on the number of transmissions indicated in the repeated transmission information in the transmission information; thereby, the probability of scanning the data packet can be greatly improved, and the reliability of data packet transmission between the first device and the second device can be improved.
[0227] In some embodiments, the method further comprises:
[0228] If a conflict occurs in data packet transmission between a plurality of the first devices and the second device, re-determine the scanning start time;
[0229] The first information carrying the re-determined scanning on time is retransmitted to the second device.
[0230] In other embodiments, the scanning start time may also be re-determined according to user settings.
[0231] Here, the conflict in data packet transmission between multiple first devices and second devices occurs when: the scanning time periods of at least two first devices overlap partially or completely. For example, the i-th first device needs to scan data packets from the 10th second to the 10.02th second, and the i+1-th first device needs to scan data packets from the 10th second to the 10.02th second. For another example, the i-th first device needs to scan data packets from the 10th second to the 10.03th second, and the i+1-th first device needs to scan data packets from the 10th second to the 10.02th second. For another example, the i-th first device needs to scan data packets from the 9.99th second to the 10.02th second, and the i+1-th first device needs to scan data packets from the 10th second to the 10.03th second. Here, i is an integer greater than 0.
[0232] The scan start time re-determined by the first device here is at least different from the scan start time of the first device when the conflict is sent. For example, if the scan start time of the i-th and i+1-th first devices is the 10th second, the i-th first device can determine the scan start time to be the 11th second.
[0233] In some embodiments, the re-determining the scanning start time includes:
[0234] The scan-on time is re-determined based on the scan-on time before re-determination and the random delay time.
[0235] For example, the scanning start time of the first device is the 10th second, and the random delay time is 0.5 seconds, then the re-determined scanning start time of the first device is the (10+0.5)th second, that is, the 10.5th second.
[0236] Of course, in other embodiments, the scan start time re-determined by the first device here can also be determined based on the cycle information. For example, if the scan start time of the next scan of the first device is the 10th second and the cycle information is 1 second, then it can be determined that the scan start time of the next scan is the (10+1)th second, that is, 11 seconds.
[0237] In some embodiments, if the data packet transmissions of the plurality of first devices conflict with the second devices, re-determining the scanning start time includes:
[0238] If a conflict occurs in the transmission of data packets between a plurality of the first devices and the second device, obtaining a time queue;
[0239] Based on the time queue, the scan-on time is re-determined.
[0240] The time queue here may be a time queue stored in the second device; the time queue indicates the sequence of start scanning times of a plurality of the first devices.
[0241] For example, in an application scenario, the i-th first device obtains a time queue, which includes: the scan start time of the i-th first device is the 10th second, and the scan start time of the i+1th first device is the 9.99th second. Among them, the scan window duration of the i-th first device is 20 milliseconds, and the scan window duration of the i+1th first device is 30 milliseconds; then the i-th first device scans the data packet from the 10th second to the 10.02th second, and the i+1th first device scans the data packet from the 9.99th second to the 10.02th second; the i-th first device and the i+1th first device will conflict with the data packet transmission of the second device. The i-th first device determines that the scan start time of the i+1th first device in the time queue is longer, and then re-determines the scan start time of the i-th first device to be a time after the 10.02th second. In this way, in this example, the conflict of data packet transmission and sending between multiple first devices and second devices can be reduced.
[0242] In the embodiment of the present disclosure, when there is a conflict in the transmission of data packets between multiple first devices and second devices, the first device will re-determine the scan start time; and send the re-determined scan start time to the second device to inform the second device to send a data packet within the scan window duration after the re-determined scan start time. In this way, the probability of data packet transmission conflicts between multiple first devices and second devices can be greatly reduced, thereby increasing the probability of scanning a data packet.
[0243] In the embodiment of the present disclosure, the re-determined scanning start time may be carried in the first information sent next time, and the first information sent next time also includes: the scanning window duration and period information indicating the scanning period.
[0244] Of course, in other embodiments, the re-determined scanning start time may not be carried in the first information, but directly sent to the second device. Thus, in this example, it is not necessary to resend the scanning window duration and the period information indicating the scanning period.
[0245] In some embodiments, the step S12 includes:
[0246] Starting a scanning function at the re-determined scanning start time according to the scanning information;
[0247] The step S13 comprises:
[0248] Scanning the data packets sent by the second device within the scanning window duration after the re-determined scanning is started according to the scanning information;
[0249] The step S14 comprises:
[0250] After the scan start time that is re-determined according to the scan information exceeds the scan window duration or after the data packet is received, the scan function is turned off.
[0251] Here, after the data packet is received, the data packet is received within the scanning duration after the re-determined scanning start time.
[0252] In the embodiment of the present disclosure, the first device can scan data within the scan on time after the re-determined scan on time, and turn on the scan function at the re-determined scan on time, and turn off the scan function before or after the scan on time passes the scan window time. In this way, the embodiment of the present disclosure can reduce the power consumption wasted due to the failure to actually receive the data packet when the scan function is turned on within the scan on time after the re-determined scan on time due to the occurrence of a conflict; thereby further ensuring that the power consumption generated by the scanning of the first device is reduced.
[0253] It should be noted here that the following description of a communication method applied to a second device corresponds to the above description of a communication method applied to a first device. For technical details not disclosed in the embodiment of the communication method applied to the second device in this disclosure, please refer to the description of the embodiment of the communication method applied to the first device in this disclosure, which will not be elaborated here.
[0254] Figure 5 is a block diagram of a communication method according to an exemplary embodiment. Figure 5 As shown, the communication method includes:
[0255] Step S21: receiving first information sent by at least one first device, wherein the first information at least includes scanning information; the scanning information includes: scanning start time and scanning window duration;
[0256] Step S22: according to the scanning information, within the scanning window duration after the scanning start time is reached, sending a data packet to the first device.
[0257] The method described in the embodiments of the present disclosure is applied to the second device. Wherein, the first device and the second device can be mobile devices or fixed devices; for example, the first device and the second device can be mobile phones, computers, servers, tablet computers, etc.; or, the first device and the device can also be wearable devices.
[0258] Here, the first device and the second device may establish a Bluetooth connection, or the first device and the second device may also establish a wireless network connection.
[0259] In one embodiment, the first device and the second device are devices in Bluetooth networking.
[0260] In one embodiment, the second device is in a Bluetooth Low Energy (BLE) state. In the BLE state, the second device has a scanning function and / or a broadcasting function.
[0261] In one embodiment, the scanning function of the second device is in a normally-on state.
[0262] In another embodiment, the scanning function of the second device is enabled only within a predetermined time range. In this case, the second device may be the first device in the above embodiment, or the second device may negotiate with multiple first devices about the preset time range for enabling the scanning function.
[0263] In the embodiment of the present disclosure, when the second device receives the first information sent by the first device, it will send a data packet within the scanning window duration after the scanning start time based on the first information; in this way, the first device can receive the data packet within the scanning start time after the scanning start time. In this way, the first device can only turn on the scanning function at the scanning start time, and turn off the scanning function when the scanning start time passes the scanning window duration or before the scanning window duration ends, that is, the first device can turn on the scanning function at most within the scanning window duration. In this way, under the premise that the data packet can be scanned, the embodiment of the present disclosure greatly shortens the time when the scanning function is turned on, thereby greatly reducing the power consumption of the first device.
[0264] In some embodiments, the receiving first information sent by at least one of the first devices includes:
[0265] The first information is received which is sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0266] like Figure 6 As shown, in some embodiments, the method further includes:
[0267] Step S23: Record the timestamp of receiving the first information;
[0268] The step S22 comprises:
[0269] Step S221: If the timestamp is earlier than the scan start time, a data packet is sent to the first device within the scan window duration after the scan start time is reached.
[0270] For example, in an application scenario, if the timestamp of the first information received is 9.99 seconds; the scan start time in the first information is 10 seconds and the scan window duration is 20 milliseconds. The second device determines that the timestamp 9.99 seconds is earlier than the scan start time 10 seconds; thus, the second device can send a data packet from 10 seconds to 10.02 seconds. Thus, in this example, the first device can scan data packets within the time period when the scan function is turned on, that is, from 10 seconds to 10.02 seconds.
[0271] like Figure 7 As shown, in another embodiment, the step S22 includes:
[0272] Step S2221: if the timestamp is later than the scan start time, delaying the scan start time by at least one scan cycle to determine the next scan start time;
[0273] Step S2222: Send the data packet to the first device within the scanning window duration after the next scanning start time is reached.
[0274] Here, delaying at least one of the scanning cycles includes delaying one or more period information indicating the scanning cycle. For example, if the period information indicating the scanning cycle is 10 milliseconds, then the delay may be 10 milliseconds, 20 milliseconds or 30 milliseconds, etc.
[0275] Here, the next scanning cycle start time can be the scanning start time of the next scanning or the scanning start time of the next scanning. For example, if the scanning cycle time is 10 seconds, if it is delayed by 10 milliseconds, it is the scanning start time of the next scanning; if it is delayed by 20 milliseconds, it is the scanning start time of the next scanning.
[0276] For example, in another application scenario, if the timestamp of the received first information is 10.01 seconds; the scan start time in the first information is 10 seconds and the scan window duration is 20 milliseconds. The second device determines that the timestamp 10.01 seconds is later than the scan start time 10 seconds. At this time, the second device can only send data packets after the current timestamp 10.01 seconds; and if the data packet is sent between the 10th and 10.01 seconds, the first device does not turn on the scan function and cannot scan the data packet. In this way, the second device sends a data packet within the scan window duration after the next scan start time; if the next scan start time is 11 seconds, the second device can send a data packet from the 11th to the 11.02th seconds. In this way, in this example, the first device can scan the data packet within the time period when the scan function is turned on, that is, from the 11th to the 11.02th seconds; thereby increasing the probability of successfully scanning the data packet.
[0277] Of course, in other embodiments, the next scan start time may also be a random delay time delayed from the current scan start time. For example, if the current scan start time is the 10th second, the random delay time may be delayed, such as 1 second, to determine that the next scan start time is the 11th second.
[0278] In the disclosed embodiment, the second device can determine whether to send a data packet during the scanning window duration after the current scanning start time or during the scanning window duration after the next scanning start time according to the relationship between the timestamp of the currently received first information and the start scanning time; thereby determining that the first device can always scan data packets when the scanning function is turned on. Thus, the probability of successfully scanning a data packet can be greatly increased.
[0279] In some embodiments, the first information includes: transmission information; the transmission information includes at least one of the following:
[0280] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0281] Repeat count information, indicating the number of times a data packet is transmitted;
[0282] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0283] In some embodiments:, the method further comprises:
[0284] Receive transmission feedback sent by the first device indicating that the data packet is successfully received.
[0285] In some other embodiments, the method further comprises:
[0286] Receive transmission feedback sent by the first device indicating that reception of the data packet failed.
[0287] In some embodiments, the method further comprises:
[0288] If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted.
[0289] In some embodiments, if transmission feedback indicating successful reception of the data packet is not received, retransmitting the data packet comprises:
[0290] If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted based on the transmission information.
[0291] In some embodiments, if transmission feedback indicating successful reception of the data packet is not received, retransmitting the data packet based on the transmission information comprises:
[0292] If no transmission feedback indicating that the data packet is successfully received is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information, the data packet is retransmitted.
[0293] In the disclosed embodiment, when the first device does not receive a data packet, it will receive a feedback message from the first device indicating that the data packet reception failed, so that the second device can retransmit the data packet, thereby greatly improving the probability of the first device scanning the data packet.
[0294] If the second device also receives a feedback message indicating successful reception of the data packet sent by the first device, the second device does not need to retransmit the data packet; thereby saving the transmission overhead of the data packets of the second device and the first device, and reducing the power consumption consumed by turning on the scanning function of the first device.
[0295] In the disclosed embodiment, the second device may also determine the maximum number of retransmissions required based on the repetition number information in the transmission information, and retransmit the data packet only when the number of retransmissions of the data packet is less than the transmission information in the retransmission number information. In this way, even if the first device does not receive the data packet, there is no need to repeatedly transmit the data packet indefinitely, which can save the overhead of transmitting the data packet between the first device and the second device.
[0296] In some embodiments, the retransmitting the data packet comprises:
[0297] Delaying at least one of the scanning cycles from the scanning start time of the last retransmission or sending of the data packet, and determining the next scanning start time;
[0298] The data packet is retransmitted within the scanning window duration after the next scanning start time.
[0299] In the disclosed embodiment, if the current is the first time that a data packet is retransmitted, the scan start time of the last sent data packet is delayed by at least one scan cycle, and the data packet is retransmitted after the next scan start time is determined; if the current is the second time or later that a data packet is retransmitted, the scan start time of the last retransmitted data packet can be delayed by at least one scan cycle, and the data packet is retransmitted after the next scan start time is determined.
[0300] In this way, in the embodiment of the present disclosure, it can be ensured that data is retransmitted when the scanning function of the first device is turned on, thereby increasing the probability that the first device successfully receives the data packet.
[0301] In some embodiments, the method further comprises:
[0302] receiving the first information retransmitted by the second device and carrying the re-determined scanning start time;
[0303] The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes:
[0304] The data packet is sent to the first device within the scanning window duration after the scanning start time is re-determined.
[0305] In some embodiments, the re-determined scan-on time is determined based on the scan-on time before re-determination and a random delay time.
[0306] In some embodiments, the method further comprises:
[0307] storing time information of preparing to send data packets to the plurality of first devices in a time queue;
[0308] The sending a data packet to the first device within the scanning window duration after the scanning start time includes:
[0309] If conflicts occur in data packet transmission between a plurality of the first devices and the second device, data packets are sent to the first devices within the scanning window duration after the scanning start time based on the time information of each of the first devices in the time queue.
[0310] The time for preparing to send a data packet to the first device here is the time when the first device receives the data packet for preparing to scan. The time for preparing to send a data packet to the first device here can be determined based on the scan start time and the scan window time included in the first information sent by the first device.
[0311] In some embodiments, the sending of a data packet to the first device within the window duration after the scan start duration is reached based on the time information of the first device in the time queue includes:
[0312] Based on the order of the time information of the first devices in the time queue, the data packet is sent to the first devices at the front of the time information within the scan window duration after the scan start time of the first devices at the front of the time information.
[0313] Here, sending the data packet to the first device at the front in the time information within the scanning window duration after the scanning start time of the first device at the front in the time information includes:
[0314] Sending the data packet to the first device at the front of the time information within the scan window duration after the scan start time of the first device at the front of the time information;
[0315] or,
[0316] The data packet is sent to the first device that is sequentially preceding in the time information within the scanning window duration after the scanning start time of the first device that is sequentially preceding in the time information.
[0317] Here, based on the time information of the first device in the time queue, the data packet to the first device within the window duration after the scan start duration is reached may also be:
[0318] Determine the order of sending data packets to each of the first devices based on the order of the time information of the first devices in the time queue;
[0319] And based on the sequence of sending the data packets to each of the first devices, it is determined that the data packet is sent within the scanning window duration after the scanning start time of the first device.
[0320] For example, in some application scenarios, the time sequence of each first device included in the time queue is: the i-th first device is the 9.99th second, the i+1-th first device is the 10th second, and the i+2-th first device is the 10.01th second; that is, the scan start time of the i-th first device is the 9.99th second, the scan start time of the i+1-th first device is the 10th second, and the scan start time of the i+2-th first device is the 10.01th second. Among them, the scan window duration of the i-th first device is 30 milliseconds, the scan window duration of the i+1-th first device is 20 milliseconds, and the scan window duration of the i+2-th first device is 20 milliseconds. Then the second device is ready to send a data packet to the i-th first device from the 9.99th second to the 10.2th second, to send a data packet to the i+1-th first device from the 10th second to the 10.2th second, and to send a data packet to the i+2-th first device from the 10.01th second to the 10.02th second. Thus, the data packet transmission of the i-th first device, the i+1-th first device and the i+2-th first device will conflict with the data packet transmission of the second device.
[0321] The second device determines the order of sending data packets to each first device according to the order of time information of each first device in the time queue: first send the data packet to the i-th first device, then send the data packet to the i+1-th first device, and finally send the data packet to the i+2-th first device.
[0322] Based on the scan start time of each of the above first devices, if the current timestamp is the 9.98th second, the second device can send a data packet to the i-th first device from the 9.99th second to the 10.02th second. Since the scan start time of the i+1th is the 10th second, it will conflict with the i-th first device, so it can be determined that the next scan start time of the i+1th first device will send a data packet; if the cycle information of the i+1th first device is 1 second, it is determined that the second device sends a data packet to the i+1th first device from the 11th second to the 11.02th second. Since the i+2th scan start time is the 10.01th second, it will also conflict with the i+2th first device; if the cycle information of the i+2th first device is also 1 second, if the next scan start time is determined to be the 11.01th second, it will conflict with the i+1th first device; then the next scan start time of the i+2th first device is determined to be delayed by at least two scan cycle times, such as a delay of 2 cycle information, then the next scan start time of the i+2th first device is the 12.01th second; then it is determined that the second device sends a data packet to the i+2th first device from 12.01 seconds to 12.03 seconds. If there are multiple first devices, the time range for the second device to send a data packet to the first device can be derived in sequence according to the method in this example.
[0323] Of course, in the above example, the next scanning start time for sending data packets to the i-th first device and the i+1-th first device can also be determined based on the current scanning start time and the random delay time. It is only necessary to ensure that there is no conflict in the data packet transmission between the i-th first device, the i+1-th first device and the i+2-th first device and the second device and that the data packet is sent within the time range when the scanning function of the i-th first device, the i+1-th first device and the i+2-th first device is turned on.
[0324] In an embodiment of the present disclosure, the second device determines a time when there is no conflict in the transmission of data packets between multiple first devices and second devices, and sends a data packet to each first device based on the time when there is no conflict. In this way, data packets can be sent within the time range when the scanning function of each first device is turned on, while minimizing the occurrence of conflicts in the transmission of data packets between multiple devices and second devices. This can greatly increase the probability of the first device successfully receiving the data packet and reduce the power consumption of the first device.
[0325] Two specific examples are provided below in combination with any of the above embodiments:
[0326] Example 1
[0327] In an application scenario, multiple first devices and second devices are networked; wherein, the first device in the network can be considered as a low-power node; and the second device in the network can be considered as a control node.
[0328] Figure 8 is a block diagram of a communication method according to an exemplary embodiment, wherein the communication method is applied to a first device. Figure 8 As shown, the communication method includes:
[0329] Step S301: Obtain dynamic configuration message;
[0330] In an optional embodiment, the first device receives a dynamic configuration message sent by other devices in the network.
[0331] The dynamic configuration message here includes but is not limited to at least one of the following: low power role, cycle information, scan start time, scan window duration and transmission mode. The dynamic configuration message here can be as follows Figure 3 shown.
[0332] In this example, based on the low power role in the dynamic configuration message configuration, it can be determined that the first device is a low power node in the network; the low power node only turns on the scanning function within a predetermined time range, and the scanning function is not always on.
[0333] Step S302: Determine first information based on the dynamic configuration message;
[0334] In an optional embodiment, the first device determines first information based on the dynamic configuration message; wherein the first information includes: cycle information, scan start time and scan window duration.
[0335] Of course, in other embodiments, the first information may also include transmission information and the like.
[0336] Step S303: Sending the first information to the second device;
[0337] In an optional example, the first device sends the first information to a second device.
[0338] Step S304: starting the scanning function of the first device at the scanning start time;
[0339] In an optional embodiment, the first device starts a scanning function of the first device at the scanning start time based on the first information.
[0340] Step S305: scanning data packets within the scanning window duration after the scanning start time;
[0341] In an optional embodiment, the first device scans data packets within the scanning window duration after the scanning start time based on the first information.
[0342] Step S306: when the scanning start time exceeds the scanning window duration, turning off the scanning function.
[0343] In an optional embodiment, the first device turns off the scanning function when the scanning start time exceeds the scanning window duration.
[0344] In another optional embodiment, the above step S306 may be: if a data packet is received within the scanning window duration after the scanning start time, after receiving the data packet, turning off the scanning function.
[0345] In the above step S305, if the data packet is received within the scanning window duration from the scanning start time, the procedure steps S307 to S310 may no longer be executed; if the data packet is not received within the scanning window duration from the scanning start time, the subsequent steps S307 to S310 are executed.
[0346] Step S307: sending the first information including the re-determined scanning start time;
[0347] In an optional embodiment, the first device redetermines the scan start time based on the period information in the first information and the scan start time; and sends the first information including the redetermined scan start time to the second device.
[0348] The scan start time re-determined here is the scan start time of the next scan.
[0349] In another optional embodiment, the communication method does not include the above step S308. At this time, the second device can also re-determine the scan start time based on the cycle information and the scan start time, and retransmit the data packet within the scan window duration after the re-determined scan start time.
[0350] Step S308: starting the scanning function of the first device at the re-determined scanning start time;
[0351] In an optional embodiment, the first device starts the scanning function of the first device at the re-determined scanning start time.
[0352] Step S309: scanning data packets within the scanning window duration after the re-determined scanning start time;
[0353] In an optional embodiment, the first device scans the data packet retransmitted by the second device within the scanning window duration after the re-determined scanning start time.
[0354] Step S310: when the re-determined scan start time exceeds the scan window duration, turning off the scan function.
[0355] In an optional embodiment, the first device turns off the scanning function when the re-determined scanning start time exceeds the scanning window duration.
[0356] In another optional embodiment, the above step S310 may be: if a data packet retransmitted by the second device is received within the scanning window duration after the re-determined scanning start time, the scanning function is turned off after receiving the data packet retransmitted by the second device.
[0357] In other examples, if the data packet retransmitted by the second device is not received in step S309, steps S307 to S310 may continue to be executed until a retransmitted data packet is received or it is determined that the number of times the second device retransmits the data packet reaches a predetermined value, and then the scan is terminated.
[0358] In the disclosed embodiment, the first device can be converted from a scanning function that is always on to being turned on only within the scanning window duration. In this way, the power consumption of the first device due to the scanning function being turned on can be greatly reduced. For example, if the scanning window duration is one-tenth of the periodic information, then the power consumption of the scanning function of the first device can be reduced to one-tenth of the time when the scanning function is always on. For another example, if a data packet can be sent out within 5 milliseconds, the scanning window duration of the first device can be set to 5 milliseconds. If the periodic information of the scanning function of the first device is 500 milliseconds, then the power consumption of the scanning function of the first device can be reduced to one percent of the time when the scanning function is always on.
[0359] Furthermore, the first device in the network whose scanning function is always on can be converted into a low-power node according to dynamic configuration information, such as flexible configuration of the scanning window duration, so that the power consumed by the scanning function of the first device can be flexibly and conveniently set.
[0360] Furthermore, if no data packet is received within a scanning window duration (ie, one scan), the data packet retransmitted by the second device can be received within the next one or several scanning window durations, thereby ensuring the success rate of data packet transmission.
[0361] Example 2
[0362] Fig. 9 is a block diagram of a communication method according to an exemplary embodiment, wherein the communication method is applied to a second device. Fig. 9 As shown, the communication method includes:
[0363] Step S400: Acquire device information of the first device;
[0364] In an optional embodiment, the second device obtains device information of the first device.
[0365] Step S401: Determine whether the first device is in the time queue; if so, execute step S402; if not, execute step S408;
[0366] In an optional embodiment, the second device determines whether the first device is in the time queue based on the device information of the first device; wherein the time queue includes: device information of at least one of the first devices and first information corresponding to the device information; wherein the first information includes: scanning information; the scanning information includes scanning start time, scanning window duration and cycle information; if so, execute step S402, if not, execute step S408.
[0367] The first information here also includes: transmission information; wherein the transmission information at least includes: repetition number information.
[0368] In another optional embodiment, the step S401 may also be: the second device receives the first information sent by the first device, and determines that a data packet needs to be sent to the first device; wherein, the first information includes: scanning information; the scanning information includes scanning start time, scanning window duration and period information.
[0369] Step S402: Obtain the scanning start time of the first device;
[0370] In an optional embodiment, the second device obtains the scanning start time of the first device from the time queue.
[0371] Step S403: Determine whether the current time is later than the scanning start time; if so, execute step S404; if not, execute step S405;
[0372] In an optional embodiment, the second device determines whether the current time is later than the scan start time obtained from the time queue; if so, execute step S404; if not, execute step S405.
[0373] Step S404: if the current time is later than the scanning start time, re-determine the scanning start time;
[0374] In an optional embodiment, if the second device determines that the current time is later than the scan start time, based on the scan start time and the time window length of the first device obtained from the time queue, the next scan start time is determined to be the re-determined scan start time.
[0375] Step S405: sending the data packet based on the re-determined scan start time;
[0376] In an optional embodiment, if the second device determines that the current time is later than the scan start time, it sends a data packet based on the next determined scan start time; if it determines that the current time is earlier than the scan start time, it sends a data packet based on the scan start time.
[0377] Step S406: Determine whether feedback information indicating successful reception of the data packet sent by the first device is received; if so, execute step S407; if not, execute step S409;
[0378] In an optional embodiment, the second device determines whether feedback information indicating successful reception of the data packet sent by the first device is received; if so, execute step S407; if not, execute step S409.
[0379] Step S407: Determine whether the number of transmission times of the data packet has been reached; if not, execute step S405; if so, execute step S409;
[0380] In an optional embodiment, the second device determines whether the data packet reaches the transmission times of the data packet indicated in the repetition times information; if so, execute step S405; if not, execute step S409.
[0381] Step S408: Scan the peripheral devices to see if the scan start time has timed out; if so, execute step S409; if not, execute step S401;
[0382] In an optional embodiment, the second device determines whether the scanning start time of the peripheral device is later than the current time; if so, execute step S409; if not, execute step S401. The peripheral device here is the device stored in the time queue except the first device.
[0383] Step S409: Delete the first device from the time queue.
[0384] In an optional embodiment, the second device deletes the device information of the first device and the first information corresponding to the device information from the time queue.
[0385] In the embodiment of the present disclosure, the first device to which the data packet needs to be sent can be determined based on the first information of each first device stored in the time queue, thereby reducing the occurrence of conflicts between data packets of multiple first devices and second devices; and further improving the success rate of data packet transmission and reducing the scanning power consumption of the first device.
[0386] Furthermore, based on the relationship between the current time and the scanning start time of the first device, it is determined whether to send the data packet during the scanning window duration after the current scanning start time or during the scanning window duration after the next scanning start time; thereby ensuring that the second device always sends the data packet during the valid time period, that is, ensuring that the first device can always scan the data packet during the time period when the scanning function is turned on. Thus, the probability of successfully scanning the data packet can be greatly improved.
[0387] Furthermore, if the second device does not receive feedback information from the first device indicating that the data packet has been successfully received, it will retransmit the data packet a predetermined number of times based on the repetition number information so that the first device can receive the data packet as much as possible, thereby greatly improving the success rate of data transmission.
[0388] like Fig.10 As shown, a communication device is provided, which is applied to a first device, and the device includes:
[0389] The first sending module 51 is used to send first information to the second device, wherein the first information at least includes: scanning information; the scanning information includes the scanning start time and the scanning window duration;
[0390] A first processing module 52, configured to start a scanning function of the first device at the scanning start time according to the scanning information;
[0391] A scanning module 53, configured to scan the data packet sent by the second device within a scanning window duration after the scanning start time according to the scanning information;
[0392] The first processing module 52 is configured to disable the scanning function after the scanning start time exceeds the scanning window duration or after the data packet is received.
[0393] In some embodiments, the first sending module 51 is used to send the first information to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0394] In some embodiments, the device further includes: a first determination module 54; wherein,
[0395] The first determination module 54 is used to determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized;
[0396] or,
[0397] The first determination module 54 is used to determine the first information based on a dynamic configuration parameter; wherein the dynamic configuration parameter is sent by any device networked with the first device.
[0398] In some embodiments, the first information further includes transmission information; the transmission information includes at least one of the following:
[0399] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0400] Repeat count information, indicating the number of times a data packet is transmitted;
[0401] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0402] In some embodiments, the first sending module 51 is used to send transmission feedback indicating successful reception of the data packet to the second device after receiving the data packet.
[0403] In some embodiments, the scanning module 53 is used to scan the data packet retransmitted by the second device based on the transmission information if the data packet is not received.
[0404] In some embodiments, the first determination module 54 is used to re-determine the scanning start time if a conflict occurs in the transmission of data packets from a plurality of the first devices to the second device;
[0405] The first sending module 51 is configured to retransmit the first information carrying the re-determined scanning start time to the second device.
[0406] In some embodiments, the first processing module 52 is used to start the scanning function at the re-determined scanning start time according to the scanning information;
[0407] The scanning module 53 is used to scan the data packets sent by the second device within the scanning window duration after the re-determined scanning is started according to the scanning information;
[0408] The first processing module 52 is further configured to disable the scanning function after the re-determined scanning start time exceeds the scanning window duration or after the data packet is received according to the scanning information.
[0409] In some embodiments, the first determination module 54 is further configured to redetermine the scan start time based on the scan start time and the random delay time before redetermination.
[0410] like Fig.11 As shown, a communication device is provided, which is applied to a second device, and the device includes:
[0411] The second receiving module 61 is used to receive first information sent by at least one first device, wherein the first information at least includes scanning information; the scanning information includes: scanning start time and scanning window duration;
[0412] The second sending module 62 is used to send a data packet to the first device within the scanning window duration after the scanning start time is reached according to the scanning information.
[0413] In some embodiments, the second receiving module 61 is used to receive the first information sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
[0414] In some embodiments, the apparatus further comprises:
[0415] A recording module 63, configured to record a timestamp of receiving the first information;
[0416] The second sending module 62 is configured to send a data packet to the first device within the scanning window duration after reaching the scanning start time if the timestamp is earlier than the scanning start time.
[0417] In some embodiments, the apparatus comprises:
[0418] A second determination module 64 is configured to, if the timestamp is later than the scan start time, determine the next scan start time based on delaying the scan start time by at least one of the scan cycles;
[0419] The second sending module 62 is used to send the data packet to the first device within the scanning window duration after the next scanning start time is reached.
[0420] In some embodiments, the first information includes: transmission information; the transmission information includes at least one of the following:
[0421] Transmission mode information, indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different;
[0422] Repeat count information, indicating the number of times a data packet is transmitted;
[0423] Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
[0424] In some embodiments, the apparatus further comprises:
[0425] The second receiving module 61 is configured to receive transmission feedback sent by the first device indicating that the data packet is received successfully.
[0426] In some embodiments, the apparatus further comprises:
[0427] The second processing module 65 is configured to retransmit the data packet if no transmission feedback indicating successful reception of the data packet is received.
[0428] In some embodiments, the second processing module 65 is configured to retransmit the data packet based on the transmission information if no transmission feedback indicating successful reception of the data packet is received.
[0429] In some embodiments, the second processing module 65 is configured to retransmit the data packet if no transmission feedback indicating successful reception of the data packet is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information.
[0430] In some embodiments, the second processing module 65 is used to delay at least one of the scanning cycles on the scanning start time of the last retransmission or sending of the data packet, determine the next scanning start time, and retransmit the data packet within the scanning window duration after the next scanning start time.
[0431] In some embodiments, the apparatus further comprises:
[0432] The second receiving module 61 is used to receive the first information retransmitted by the second device and carrying the re-determined scanning start time;
[0433] The second sending module 62 is configured to send the data packet to the first device within the scanning window duration after the scanning start time is re-determined.
[0434] In some embodiments, the re-determined scan-on time is determined based on the scan-on time before re-determination and a random delay time.
[0435] In some embodiments, the apparatus further comprises:
[0436] The second processing module 65 is used to store time information of preparing to send data packets to the plurality of first devices in a time queue;
[0437] The second sending module 62 is used to send data packets to the first devices within the scanning window duration after the scanning start time based on the time information of each first device in the time queue if a conflict occurs in the data packet transmission of multiple first devices and the second device.
[0438] In some embodiments, the second sending module 62 is used to send the data packet to the first device at the front of the time information within the scanning window duration after the scanning start time of the first device at the front of the time information based on the order of the time information of the first devices in the time queue.
[0439] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0440] The present disclosure also provides a device, including:
[0441] a memory for storing processor-executable instructions;
[0442] The processor is configured to: implement the communication method described in any embodiment of the present disclosure when executing the executable instructions.
[0443] The device here may be the first device or the second device in any of the above embodiments.
[0444] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.
[0445] The processor may be connected to the memory through a bus or the like, and is used to read the executable program stored in the memory, for example, to implement the following Figure 1 and Figure 4-9 At least one of the methods shown.
[0446] The present disclosure also provides a computer storage medium, wherein the computer storage medium stores a computer executable program, and when the executable program is executed by a processor, the communication method described in any embodiment of the present disclosure is implemented. Figure 1 and Figure 4-9 at least one of the methods.
[0447] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0448] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0449] Fig.12 8 is a block diagram of a device 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0450] Reference Fig.12 , device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0451] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0452] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0453] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0454] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0455] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0456] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0457] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0458] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0459] In an exemplary embodiment, the device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0460] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0461] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0462] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A communication method, characterized in that: Applied to a first device, the method includes: Sending first information to a second device, wherein the first information at least includes: scanning information and transmission information; the scanning information includes a scanning start time and a scanning window duration; the transmission information at least includes: transmission mode information indicating a transmission mode; wherein different transmission modes correspond to different numbers of repeated transmissions of a data packet; repetition number information indicating the number of transmissions of a data packet; and the scanning window durations of each scan are the same or different; Starting a scanning function of the first device at the scanning start time according to the scanning information; Scanning the data packet sent by the second device within the scanning window duration after the scanning start time according to the scanning information; After receiving the data packet within the scanning window duration, turning off the scanning function; If the data packet transmissions of the plurality of first devices conflict with the data packet transmissions of the second device, the scanning start time is re-determined; wherein, if the data packet transmissions of the plurality of first devices conflict with the data packet transmissions of the second device, the scanning start time is re-determined, including: if the data packet transmissions of the plurality of first devices conflict with the data packet transmissions of the second device, obtaining a time queue stored in the second device; and re-determining the scanning start time based on the time queue; The first information carrying the re-determined scanning on time is retransmitted to the second device.
2. The method according to claim 1, characterized in that The method further comprises: After the scan on time exceeds the scan window duration, the scan function is turned off.
3. The method according to claim 1, characterized in that The sending the first information to the second device includes: The first information is sent to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises one of the following: Determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized; wherein the fixed configuration parameters include at least one of the following: low power role, cycle information, scan start time, scan window duration, and transmission mode information; Determine the first information based on a dynamic configuration parameter; wherein the dynamic configuration parameter is sent by any device networked with the first device; The contents of the fixed configuration parameters or the dynamic configuration parameters are the same or different.
5. The method according to any one of claims 1 to 3, characterized in that The transmission information also includes: Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
6. The method according to claim 5, characterized in that The method further comprises: After receiving the data packet, transmission feedback indicating successful reception of the data packet is sent to the second device.
7. The method according to claim 5, characterized in that The method further comprises: If the data packet is not received, scan the data packet retransmitted by the second device based on the transmission information.
8. The method according to claim 1, characterized in that The starting a scanning function of the first device at the scanning start time according to the scanning information includes: Starting a scanning function at the re-determined scanning start time according to the scanning information; The step of scanning the data packet sent by the second device within the scanning window duration after the scanning start time according to the scanning information includes: Scanning the data packets sent by the second device within the scanning window duration after the re-determined scanning start time according to the scanning information; After receiving the data packet within the scanning window duration, shutting down the scanning function includes: After receiving the data packet within the re-determined scanning window duration according to the scanning information, the scanning function is turned off.
9. The method according to claim 1, characterized in that: The re-determining the scanning start time includes: The scan-on time is re-determined based on the scan-on time before re-determination and the random delay time.
10. A communication method, characterized in that: Applied to the second device, the method includes: Receive first information sent by at least one first device, wherein the first information includes at least scanning information and transmission information; the scanning information includes: scanning start time and scanning window duration; the transmission information includes at least: transmission mode information indicating the transmission mode; wherein different transmission modes correspond to different numbers of repeated transmissions of a data packet; the number of repetitions information indicates the number of transmissions of a data packet; the scanning window durations of each scan are the same or different; storing time information of preparing to send data packets to the plurality of first devices in a time queue; According to the scanning information, a data packet is sent to the first device within the scanning window duration after the scanning start time is reached, wherein the data packet is used for the first device to turn off the scanning function after receiving it within the scanning window duration; wherein, sending a data packet to the first device within the scanning window duration after the scanning start time includes: if a conflict occurs in the data packet transmission of multiple first devices and the second device, based on the time information of each first device in the time queue, sending a data packet to the first device within the scanning window duration after the scanning start time is reached.
11. The method according to claim 10, characterized in that The receiving first information sent by at least one of the first devices includes: The first information is received which is sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
12. The method according to claim 10 or 11, characterized in that: The method further comprises: Recording a timestamp of receiving the first information; The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes: If the timestamp is earlier than the scan start time, a data packet is sent to the first device within the scan window duration after the scan start time is reached.
13. The method according to claim 12, characterized in that The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes: If the timestamp is later than the scan start time, delaying the scan start time by at least one scan cycle to determine the next scan start time; The data packet is sent to the first device within the scanning window duration after the next scanning start time is reached.
14. The method according to claim 10, characterized in that The transmission information also includes: Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
15. The method according to claim 10 or 14, characterized in that The method further comprises: Receive transmission feedback sent by the first device indicating that the data packet is successfully received.
16. The method according to claim 10 or 14, characterized in that The method further comprises: If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted.
17. The method according to claim 16, characterized in that If no transmission feedback indicating that the data packet is successfully received is received, retransmitting the data packet, comprises: If no transmission feedback indicating successful reception of the data packet is received, the data packet is retransmitted based on the transmission information.
18. The method according to claim 17, characterized in that If no transmission feedback indicating that the data packet is successfully received is received, retransmitting the data packet based on the transmission information, comprises: If no transmission feedback indicating that the data packet is successfully received is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information, the data packet is retransmitted.
19. The method according to claim 16, characterized in that The retransmitting the data packet comprises: Delaying the scan start time of the last retransmission or sending of the data packet by at least one scan cycle to determine the next scan start time; The data packet is retransmitted within the scanning window duration after the next scanning start time.
20. The method according to claim 10 or 11, characterized in that The method further comprises: receiving the first information carrying the re-determined scanning start time retransmitted by the second device; The sending of the data packet to the first device within the scanning window duration after the scanning start time is reached includes: The data packet is sent to the first device within the scanning window duration after the re-determined scanning start time is reached.
21. The method according to claim 20, characterized in that The re-determined scan-on time is determined based on the scan-on time before re-determination and a random delay time.
22. The method according to claim 10, characterized in that The sending a data packet to the first device within the scanning window duration after reaching the scanning start time based on the time information of the first device in the time queue includes: Based on the order of the time information of the first devices in the time queue, the data packet is sent to the first devices at the front of the time information within the scan window duration after the scan start time of the first devices at the front of the time information.
23. A communication device, characterized in that: Applied to a first device, the apparatus comprises: A first sending module is used to send first information to a second device, wherein the first information at least includes: scanning information and transmission information; the scanning information includes a scanning start time and a scanning window duration; the transmission information at least includes: transmission mode information indicating a transmission mode; wherein different transmission modes correspond to different numbers of repeated transmissions of a data packet; repetition number information indicating the number of transmissions of a data packet; and the scanning window durations of each scan are the same or different; A first processing module, configured to start a scanning function of the first device at the scanning start time according to the scanning information; A scanning module, configured to scan a data packet sent by the second device within a scanning window duration after the scanning start time according to the scanning information; The first processing module is used to disable the scanning function after receiving the data packet within the scanning window duration; A first processing module, configured to re-determine the scanning start time if a conflict occurs between the data packet transmissions of the plurality of the first devices and the second device; wherein the first processing module is specifically configured to obtain a time queue stored in the second device if a conflict occurs between the data packet transmissions of the plurality of the first devices and the second device; and re-determine the scanning start time based on the time queue; The first sending module is used to retransmit the first information carrying the re-determined scanning start time to the second device.
24. The device according to claim 23, characterized in that The first processing module is further configured to disable the scanning function after the scanning start time exceeds the scanning window duration.
25. The device according to claim 23, characterized in that The first sending module is used to send the first information to the second device at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
26. The device according to any one of claims 23 to 25, characterized in that The device further includes: a first determining module; wherein, The first determination module is used to determine the first information based on fixed configuration parameters; wherein the fixed configuration parameters are set when the device is initialized; wherein the fixed configuration parameters include at least one of the following: low power role, cycle information, scan start time, scan window duration, and transmission mode information; or, The first determination module is used to determine the first information based on a dynamic configuration parameter; wherein the dynamic configuration parameter is sent by any device networked with the first device; The contents of the fixed configuration parameters or the dynamic configuration parameters are the same or different.
27. The device according to any one of claims 23 to 25, characterized in that The transmission information also includes: Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
28. The device according to claim 27, characterized in that The first sending module is used to send transmission feedback indicating that the data packet is successfully received to the second device after receiving the data packet.
29. The device according to claim 27, characterized in that The scanning module is used to scan the data packet retransmitted by the second device based on the transmission information if the data packet is not received.
30. The device according to claim 23, characterized in that The first processing module is used to start the scanning function at the re-determined scanning start time according to the scanning information; The scanning module is used to scan the data packet sent by the second device within the scanning window duration after the re-determined scanning start time according to the scanning information; The first processing module is further configured to disable the scanning function after the re-determined scanning start time exceeds the scanning window duration or after the data packet is received according to the scanning information.
31. The device according to claim 23, characterized in that The device also includes: The first determination module is further used to redetermine the scan start time based on the scan start time and the random delay time before redetermining.
32. A communication device, characterized in that: Applied to a second device, the apparatus comprises: A second receiving module is used to receive first information sent by at least one first device, wherein the first information includes at least scanning information and transmission information; the scanning information includes: scanning start time and scanning window duration; the transmission information includes at least: transmission mode information indicating the transmission mode; wherein the number of repeated transmissions of a data packet corresponding to different transmission modes is different; the repetition number information indicates the number of transmissions of a data packet; the scanning window durations of each scan are the same or different; A second processing module, used for storing time information of preparing to send data packets to the plurality of first devices in a time queue; A second sending module is used to send a data packet to the first device within the scanning window duration after the scanning start time is reached according to the scanning information; wherein, the data packet is used for the first device to turn off the scanning function after receiving it within the scanning window duration; the second sending module is specifically used to send a data packet to the first device within the scanning window duration after the scanning start time is reached based on the time information of each first device in the time queue if a conflict occurs in the data packet transmission between multiple first devices and the second device.
33. The device according to claim 32, characterized in that The second receiving module is used to receive the first information sent by at least one of the first devices at intervals of a scanning period, wherein the scanning information further includes: period information indicating the scanning period.
34. The device according to claim 32 or 33, characterized in that The device also includes: A recording module, used for recording a timestamp of receiving the first information; The second sending module is used to send a data packet to the first device within the scanning window duration after reaching the scanning start time if the timestamp is earlier than the scanning start time.
35. The device according to claim 34, characterized in that The device comprises: A second determination module, configured to determine the next scan start time based on delaying the scan start time by at least one scan cycle if the timestamp is later than the scan start time; The second sending module is used to send the data packet to the first device within the scanning window duration after the next scanning start time is reached.
36. The device according to claim 32, characterized in that The transmission information also includes: Transmission status confirmation mode information indicates whether to use a first confirmation mode or a second confirmation mode to determine the transmission status of the data packet; under the first confirmation mode, transmission feedback indicating whether the data packet is received successfully is sent; under the second confirmation mode, transmission feedback indicating that the data packet has failed to be received is sent when the transmission fails.
37. The device according to claim 32 or 36, characterized in that The device also includes: The second receiving module is used to receive transmission feedback sent by the first device indicating that the data packet is successfully received.
38. The device according to claim 32 or 36, characterized in that The device also includes: The second processing module is configured to retransmit the data packet if no transmission feedback indicating successful reception of the data packet is received.
39. The device according to claim 38, characterized in that The second processing module is configured to retransmit the data packet based on the transmission information if no transmission feedback indicating that the data packet is successfully received is received.
40. The device according to claim 39, characterized in that The second processing module is configured to retransmit the data packet if no transmission feedback indicating successful reception of the data packet is received and the number of retransmissions of the data packet is less than the number of transmissions indicated in the repetition number information.
41. The device according to claim 38, characterized in that The second processing module is used to delay the scan start time of the last retransmission or sending of the data packet by at least one scan cycle to determine the next scan start time; and retransmit the data packet within the scan window duration after the next scan start time.
42. The device according to claim 32 or 33, characterized in that The device also includes: The second receiving module is used to receive the first information carrying the re-determined scanning start time retransmitted by the second device; The second sending module is used to send the data packet to the first device within the scanning window duration after the re-determined scanning start time is reached.
43. The device according to claim 42, characterized in that The re-determined scan-on time is determined based on the scan-on time before re-determination and a random delay time.
44. The device according to claim 32, characterized in that The second sending module is used to send the data packet to the first device at the front of the time information within the scanning window duration after the scanning start time of the first device at the front of the time information based on the order of the time information of the first device in the time queue.
45. A communication device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: implement the communication method described in any one of claims 1 to 9 or claims 10 to 22 when executing the executable instructions.
46. A computer-readable storage medium, characterized in that The readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the communication method described in any one of claims 1 to 9 or claims 10 to 22.
Citation Information
Patent Citations
Method and apparatus for randomisation of periodic channel scans
CN101810038A
Data transmission method
CN104901724A