CN114584424A - Communication method, communication device, electronic equipment and computer-readable storage medium - Google Patents
Communication method, communication device, electronic equipment and computer-readable storage medium Download PDFInfo
- Publication number
- CN114584424A CN114584424A CN202011389569.3A CN202011389569A CN114584424A CN 114584424 A CN114584424 A CN 114584424A CN 202011389569 A CN202011389569 A CN 202011389569A CN 114584424 A CN114584424 A CN 114584424A
- Authority
- CN
- China
- Prior art keywords
- time slot
- channel
- unicast
- gateway
- reply
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004891 communication Methods 0.000 title claims abstract description 66
- 238000000034 method Methods 0.000 title claims abstract description 66
- 108010003272 Hyaluronate lyase Proteins 0.000 claims abstract description 62
- 238000011084 recovery Methods 0.000 claims abstract description 46
- 238000004590 computer program Methods 0.000 claims description 11
- 238000001228 spectrum Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 7
- 230000009471 action Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000007480 spreading Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- QVFWZNCVPCJQOP-UHFFFAOYSA-N chloralodol Chemical compound CC(O)(C)CC(C)OC(O)C(Cl)(Cl)Cl QVFWZNCVPCJQOP-UHFFFAOYSA-N 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000000779 smoke Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 239000002904 solvent Substances 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/2807—Exchanging configuration information on appliance services in a home automation network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2803—Home automation networks
- H04L12/283—Processing of data at an internetworking point of a home automation network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W72/00—Local resource management
- H04W72/04—Wireless resource allocation
- H04W72/044—Wireless resource allocation based on the type of the allocated resource
- H04W72/0446—Resources in time domain, e.g. slots or frames
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Computing Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
The embodiment of the application provides a communication method, a communication device, electronic equipment and a computer-readable storage medium, and relates to the field of communication. After the gateway allocates the channel to the home equipment requesting to access the network, the gateway allocates a time slot sequence number to the home equipment, and sends the channel and the time slot sequence number allocated to the home equipment, so that the home equipment can determine a first recovery delay time according to the spreading factor and the time slot sequence number of the channel, and further reply the non-unicast instruction according to the first recovery delay time under the condition of receiving the non-unicast instruction sent by the gateway. Different home devices on the same channel correspond to different time slot serial numbers, so that different home devices on the same channel can determine different first recovery delay times according to the spreading factor and the time slot serial number of the channel, and then reply to the non-unicast command according to the different first recovery delay times, the channel congestion situation is effectively reduced, collision among the home devices is not easy to occur, and the packet loss rate is reduced.
Description
Technical Field
The present application relates to the field of communications, and in particular, to a communication method, apparatus, electronic device, and computer-readable storage medium.
Background
In the existing star-shaped networking of the narrow-band personal area network, after a gateway sends a broadcast message or a multicast message, home devices need to reply to confirm, when the number of home devices accessed to the network or the number of home devices in the multicast group is large, channel congestion is easily generated when the home devices reply to the broadcast message or the multicast message, collision is easily generated among the devices, and the packet loss rate is high.
Disclosure of Invention
Embodiments of the present application provide a communication method, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve the problems in the prior art that channel congestion is easily generated when multiple home devices reply to a message broadcasted or multicasted by a gateway, and collision easily occurs between the devices, which results in a high packet loss rate.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, the present application provides a communication method applied to a gateway, where the method includes:
after a channel is allocated to the household equipment which requests to access the network, a time slot serial number is allocated to the household equipment; different household devices on the same channel correspond to different time slot serial numbers;
and sending the channel and the time slot sequence number allocated to the home equipment so that the home equipment determines a first recovery delay time according to the spreading factor of the channel and the time slot sequence number, and replying a non-unicast instruction according to the first recovery delay time under the condition of receiving the non-unicast instruction sent by the gateway.
In a second aspect, the present application provides a communication method, which is applied to a home device, where the home device communicates with a gateway, and the method includes:
receiving the channel and the time slot serial number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
determining a first return delay time according to the spreading factor of the channel and the time slot sequence number;
and under the condition of receiving a non-unicast instruction sent by the gateway, replying the non-unicast instruction according to the first reply delay time.
In a third aspect, the present application provides a communication apparatus applied to a gateway, the apparatus including:
the time slot allocation module is used for allocating a time slot serial number to the household equipment after allocating a channel to the household equipment which requests to access the network; different household devices on the same channel correspond to different time slot serial numbers;
and the information transceiving module is used for sending the channel and the time slot sequence number allocated to the home equipment so that the home equipment determines a first recovery delay time according to the spreading factor of the channel and the time slot sequence number, and replies the non-unicast instruction according to the first recovery delay time under the condition of receiving the non-unicast instruction sent by the gateway.
In a fourth aspect, the present application provides a communication apparatus, which is applied to a home device, where the home device communicates with a gateway, the apparatus includes:
the data receiving module is used for receiving the channel and the time slot serial number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
a delay time determining module, configured to determine a first recovery delay time according to the spreading factor of the channel and the timeslot number;
and the instruction reply module is used for replying the non-unicast instruction according to the first reply delay time under the condition of receiving the non-unicast instruction sent by the gateway.
In a fifth aspect, the present application provides an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the communication method according to any one of the preceding embodiments.
In a sixth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, which computer program, when executed by a processor, implements the steps of the communication method according to any of the preceding embodiments.
In the embodiment of the application, after allocating a channel to home equipment requesting network access, a gateway allocates a time slot sequence number to the home equipment, and sends the channel and the time slot sequence number allocated to the home equipment, so that the home equipment can determine a first recovery delay time according to a spreading factor and the time slot sequence number of the channel, and further reply a non-unicast instruction according to the first recovery delay time when receiving the non-unicast instruction sent by the gateway. Different home devices on the same channel correspond to different time slot serial numbers, so that different home devices on the same channel can determine different first recovery delay times according to the spreading factor and the time slot serial number of the channel, and then reply to the non-unicast command according to the different first recovery delay times, the channel congestion situation is effectively reduced, collision among the home devices is not easy to occur, and the packet loss rate is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a schematic diagram of an application environment suitable for use in embodiments of the present application;
fig. 2 is a schematic flowchart illustrating a communication method applied to a gateway according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating that a plurality of home devices reply to a non-unicast instruction after a gateway sends the non-unicast instruction;
fig. 4 is a schematic flow chart of a communication method applied to a gateway according to an embodiment of the present application;
fig. 5 is a schematic flowchart illustrating a communication method applied to a gateway according to an embodiment of the present application;
fig. 6 is a schematic flowchart illustrating a communication method applied to a gateway according to an embodiment of the present application;
fig. 7 is a schematic flowchart illustrating a communication method applied to a gateway according to an embodiment of the present application;
fig. 8 is a schematic flowchart illustrating a communication method applied to a gateway according to an embodiment of the present application;
fig. 9 is a flowchart illustrating a communication method applied to a home device according to an embodiment of the present application;
fig. 10 shows another flow chart of a communication method applied to a household device according to an embodiment of the present application;
fig. 11 is a functional block diagram of a communication apparatus applied to a gateway according to an embodiment of the present application;
fig. 12 is a functional block diagram of a communication device applied to a household appliance according to an embodiment of the present application;
fig. 13 shows a block diagram of an exemplary hardware structure of an electronic device that can implement a gateway and a home device according to an embodiment of the present application.
Icon: 10-an intelligent home system; 100-a gateway; 200-household equipment; 300-a server; 400-a terminal device; 500-a router; 111-a processor; 112-a storage medium; 113-a memory; 114-input-output interface; 115-wired or wireless network interface; 116-a power supply; 1121 — operating system; 1122-data; 1123-applications; 810-time slot allocation module; 820-information transceiver module; 910-a data receiving module; 920-a delay time determination module; 930-instruction reply Module.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic diagram of an application environment suitable for the embodiment of the present application. Fig. 1 provides an intelligent home system 10, where the intelligent home system 10 includes a gateway 100, a home device 200 connected to the gateway 100, and a server 300 connected to the gateway 100. The number of the gateways 100 may be at least one, and the number of the home devices 200 may be at least one. When the number of gateways 100 is large, communication connection between different gateways 100 is also possible.
In this embodiment, the gateway 100 may be an intelligent gateway controlled by an intelligent home, and may implement functions such as system information acquisition, information input, information output, centralized control, remote control, and coordinated control. The gateway 100 may be responsible for specific security alarm, appliance control, and power consumption information acquisition. The gateway 100 can also perform information interaction with products such as an intelligent interactive terminal in a wireless manner. The gateway 100 also has wireless routing function, excellent wireless performance, network security and coverage area.
The home device 200 may include various intelligent home devices, sensing devices, detection devices, and the like disposed in an indoor space, such as an intelligent television, an intelligent refrigerator, an intelligent air conditioner, a temperature and humidity sensor, a pressure sensor, a smoke sensor, a human body sensor, a door and window sensor, an intelligent switch, a socket, an electric lamp, an infrared emitting device, a camera device, and the like. The home devices 200 connected to the gateway 100 may interact with the gateway 100 for information and instructions. The gateway 100 and the home appliance 200 may be connected in a LoRa communication manner.
In this embodiment, the server 300 may be a server such as a local server or a cloud server, and a specific server type may not be limited in this embodiment of the application. The server 300 connected to the gateway 100 can wirelessly exchange information with the gateway 100. The gateways 100 disposed in different indoor spaces may be communicatively connected to the same server 300 through a network to perform information interaction between the server 300 and the gateways 100.
Optionally, the smart home system 10 may further include a terminal device 400. The terminal device 400 may include a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), and the like, which are not limited herein. The terminal device 400 may interact with the server 300 in a wireless manner such as 2G/3G/4G/5G/WiFi. Of course, the connection mode between the terminal device 400 and the server 300 may not be limited in the embodiment of the present application. In some embodiments, the terminal device 400 may also be used for interaction with a user, so that the user may communicate with the gateway 100 wirelessly through the terminal device 400 based on the router 500. In addition, the user can add an account information at the same time between the gateway 100 and the terminal device 400, and the information synchronization between the gateway 100 and the terminal device 400 is realized through the account information.
In some embodiments, the user may set different trigger scenarios or automated linkages through an Application (APP) of the terminal device 400. As one manner, the terminal device 400 may upload the scenario configuration information or the automation scheme to the server 300, so that when the trigger condition of the trigger scenario or the automation is reached, the server 300 may find a device corresponding to an execution action in the scenario configuration information or the automation scheme according to the stored scenario configuration information or the automation scheme, so as to notify the device to perform the execution action to meet the execution result of the trigger scenario or the automation. Alternatively, the server 300 may also send the scenario configuration information or the automation scheme to the gateway 100, and the gateway 100 finds a device corresponding to an execution action in the scenario configuration information or the automation scheme according to the stored scenario configuration information or the automation scheme. Meanwhile, the gateway 100 may feed back the device's execution back to the server 300.
Embodiments in the present application will be described in detail below with reference to the accompanying drawings.
Fig. 2 is a schematic flow chart of a communication method according to an embodiment of the present application. It should be noted that the communication method in the embodiment of the present application is not limited by fig. 2 and the following specific sequence, and it should be understood that, in other embodiments, the sequence of some steps in the communication method of the present application may be interchanged according to actual needs, or some steps in the communication method may be omitted or deleted. The communication method can be applied to the gateway 100 described above, and the specific flow shown in fig. 2 will be described in detail below.
Step S201, after a channel is distributed to the home equipment which requests to access the network, a time slot serial number is distributed to the home equipment; and different household devices on the same channel correspond to different time slot serial numbers.
In this embodiment, a channel may be defined by frequency bins and spreading factors, for example, the channel may be (470.4MHz, SF9), where 470.4MHz is the frequency bin and SF9 is the spreading factor. The gateway 100 performs frequency point scanning during networking, and combines a plurality of scanned target frequency points with a plurality of preset spreading factors to obtain a plurality of channels. In one embodiment, the frequency point may be scanned within a range of 470MHz to 510MHz, and the spreading factor may be selected within a range of 5 to 12. When receiving the network access request instruction of the home device 200, the gateway 100 selects one channel from the multiple channels obtained by scanning the frequency point to allocate to the home device 200, and allocates the corresponding time slot serial number to the home device 200.
In this embodiment, when the gateway 100 allocates the timeslot numbers to the home devices 200, it needs to ensure that timeslot numbers allocated to different home devices 200 on the same channel are different. For example, if there are three home devices 200 on a certain channel, the timeslot numbers allocated to the three home devices 200 by the gateway 100 should be guaranteed to be different.
Step S202, a channel and a time slot sequence number allocated by the home equipment are sent to the home equipment, so that the home equipment determines a first recovery delay time according to a spreading factor and the time slot sequence number of the channel, and replies a non-unicast instruction according to the first recovery delay time under the condition that the non-unicast instruction sent by the gateway is received.
In this embodiment, after completing the allocation of the channel and the timeslot number, the gateway 100 sends the allocated channel and timeslot number to the home device 200 requesting for network access by issuing network information, and the home device 200 completes network access based on the channel allocated by the gateway 100 and then calculates the first recovery delay time according to the spreading factor corresponding to the channel and the allocated timeslot number. When the home device 200 receives the non-unicast instruction sent by the gateway 100 on the channel, the non-unicast instruction may be replied according to the calculated first reply delay time. That is to say, after the gateway 100 sends the non-unicast instruction on a certain channel, all the home devices 200 that receive the non-unicast instruction on the channel do not reply to the non-unicast instruction immediately, but determine the time for replying the non-unicast instruction according to the respective calculated first reply delay time.
Optionally, each home device 200 receiving the non-unicast instruction may start timing by using a time when the non-unicast instruction is received as an initial time, and may send a reply packet to the gateway 100 when the calculated first reply delay time is reached. Therefore, the time when each household device 200 replies the non-unicast instruction is the starting time plus the first reply delay time.
In an example, after the home device 200 enters the network, according to the spreading factor of the channel allocated by the gateway 100 and the allocated Timeslot number, the formula timeslottn ═ n × step × (2) may be calculated by delaying(SF-k)+ n x 10 calculating the first recovery delay time; wherein k is a reference spreading factor, and the value range of k may be 5-12, for example, k is set to 7; step can be understood as the corresponding time step under the reference spreading factor, which is a fixed value, and the specific value is determined according to the actually selected reference spreading factor; SF denotes a spreading factor of a channel allocated to the home device 200, and n denotes a time slot number allocated to the home device 200. The home device 200 starts timing when receiving the non-unicast instruction on the channel allocated by the gateway 100, and sends a reply message to the gateway 100 when the calculated first reply delay time Timeslot n is reached. For example, when n is equal to 0, the calculated first reply delay time is 0, which indicates that the home device 200 replies to the gateway 100 immediately without waiting after receiving the non-unicast instruction.
As shown in fig. 3, the schematic diagram is that after the gateway 100 sends the non-unicast instruction, the multiple home devices 200 (i.e., the sub-device d1, the sub-device d2, the sub-device …, and the sub-device dn) reply to the non-unicast instruction according to the respective calculated first reply delay time, and replies to the non-unicast instruction by each sub-device are ordered and are not likely to collide.
According to the communication method provided by the embodiment of the application, after the gateway 100 sends the non-unicast instruction on a certain channel, a plurality of different home devices 200 will receive the non-unicast instruction on the channel, and when the gateway 100 allocates the time slot serial numbers to the home devices 200, different time slot serial numbers will be allocated to different home devices 200 on the same channel, so that different home devices 200 on the same channel can determine different first reply delay times according to the spreading factor of the channel and the allocated time slot serial numbers, and then reply to the non-unicast instruction according to the different first reply delay times, thereby avoiding that the non-unicast instruction is replied by the home devices 200 at the same time, effectively reducing the situation of channel congestion, preventing collision from occurring among the home devices 200, and reducing the packet loss rate.
Optionally, the timeslot number in this embodiment may include a broadcast timeslot number, referring to fig. 4, the step S201 may specifically include the following sub-steps:
and a substep S2011 of selecting an idle broadcast time slot serial number in the broadcast time slot range corresponding to the channel after the channel is allocated to the home equipment requesting to access the network, and allocating the idle broadcast time slot serial number to the home equipment.
In this embodiment, the broadcast time slot range corresponding to the channel may be set to [0, N]Where N represents a maximum capacity value of the channel, N may be calculated according to a spreading factor of the channel, and a specific calculation formula may be that N is 2(13-SF)And SF denotes a spreading factor of a channel. The gateway 100 may be in [0, N ] after allocating channels to the home devices 200 requesting to access the network]The idle broadcast time slot sequence number is searched within the range and allocated to the home device 200, and the value range of the broadcast time slot sequence number allocated to the home device 200 is actually the broadcast time slot range [0, N ] corresponding to the channel]。
In this embodiment, the gateway 100 may allocate a corresponding broadcast timeslot sequence number to the home devices 200 according to whether other home devices 200 exist on the channel allocated to the home device 200 that requests to access the network.
Specifically, if there is no other home appliance 200 on the channel to which the home appliance 200 is allocated, a preset broadcast slot number is allocated to the home appliance 200, and the preset broadcast slot number may be any value in the broadcast slot range [0, N ], for example, the preset broadcast slot number may be "0". If other home devices 200 exist on the channel allocated to the home device 200, selecting an idle broadcast time slot serial number within the broadcast time slot range, and allocating the idle broadcast time slot serial number to the home device 200. When the gateway 100 selects the idle broadcast time slot serial number, the idle broadcast time slot serial number may be searched according to a set sequence. For example, the gateway 100 may start with the minimum value in the broadcast slot range (i.e., the minimum broadcast slot number "0"), and incrementally search for a free broadcast slot number within the range [0, N ]; the search for free broadcast slot sequence numbers may also be decremented within a 0, N range, starting from the maximum value in the broadcast slot range (i.e., the maximum broadcast slot sequence number "N"). Of course, the present application does not limit the specific manner of searching for the idle broadcast slot number.
That is, after allocating a channel to the home device 200 requesting network entry, the gateway 100 may first determine whether there are other home devices 200 on the channel, that is, whether the channel is allocated to other home devices 200, and if there are no other home devices 200 on the channel, it indicates that the home device 200 requesting network entry is the home device 200 that is first allocated to the channel, and at this time, allocates a preset broadcast time slot sequence number to the home device 200. If there are other home devices 200 on the channel, it indicates that the other home devices 200 have been allocated broadcast time slot sequence numbers prior to the home device 200 requesting to access the network, and at this time, the gateway 100 may select an idle broadcast time slot sequence number in the broadcast time slot range corresponding to the channel to allocate to the home device 200 requesting to access the network.
According to the communication method provided by the embodiment of the application, after the gateway 100 allocates the channel to the home equipment 200 requesting to access the network, the idle broadcast time slot serial number is selected in the broadcast time slot range corresponding to the channel, and the idle broadcast time slot serial number is allocated to the home equipment 200 requesting to access the network, so that different broadcast time slot serial numbers allocated to different home equipment 200 on the same channel are ensured to be different, different home equipment 200 on the same channel can determine different broadcast reply delay times according to the spreading factor of the channel and the allocated broadcast time slot serial number, and further, the broadcast instructions of the gateway 100 are sequentially replied according to the different broadcast reply delay times, so that collision is not easy to occur, and compared with a random delay reply mode, the utilization rate of the channel can be improved.
In practical applications, the home devices 200 may have a requirement for establishing a multicast group, and for the home devices 200 in the multicast group, when the gateway 100 allocates a channel, the home devices 200 belonging to one multicast group need to be allocated to the same channel, and when allocating a time slot number to the home device 200, in addition to allocating a broadcast time slot number, a multicast time slot number also needs to be allocated, so the time slot number may also include a multicast time slot number. Of course, the present embodiment does not limit the sequence of allocating the broadcast timeslot number and the multicast timeslot number. Referring to fig. 5, the step S201 may further include the following sub-steps:
and a substep S2012, if the home equipment has a corresponding multicast group, after allocating a channel to the home equipment requesting to access the network, selecting an idle multicast time slot serial number in the multicast time slot range corresponding to the multicast group, and allocating the idle multicast time slot serial number to the home equipment.
In this embodiment, when determining that the household device 200 requesting to access the network belongs to a certain multicast group, the gateway 100 further determines whether there is a household device 200 already accessing the network in the multicast group, that is, whether there is a household device 200 accessing the network in the multicast group before the household device requesting to access the network. If the networked home devices 200 exist in the multicast group, directly allocating channels allocated to the networked home devices 200 to the home devices 200 requesting to access the network; if there is no home device 200 that has accessed to the network in the multicast group, one channel may be selected from the multiple channels obtained through the scanning frequency points and allocated to the home device 200 that requests to access to the network.
After the channel allocation is completed, the gateway 100 selects an idle multicast timeslot number within the multicast timeslot range corresponding to the multicast group to allocate to the home device 200 requesting to access the network, so as to ensure that the multicast timeslot numbers allocated to all the home devices 200 in the multicast group are different. Wherein, the multicast time slot range corresponding to the multicast group can be set as [0, M ]]. As one manner, M may be determined according to the number of the home devices 200 in the current multicast group, for example, if there are 3 home devices 200 in the multicast group, M may be determined to be 2; alternatively, M may be determined according to the maximum capacity value N of the channel in which the multicast group is located, that is, M-N-2(13-SF)And SF denotes a spreading factor of a channel. After the gateway 100 allocates the channel to the home device 200 requesting to access the network, the channel may be set to [0, M ]]The idle multicast timeslot number is searched within the range and allocated to the home device 200, and the value range of the multicast timeslot number allocated to the home device 200 is actually the multicast timeslot range corresponding to the multicast group of [0, M]。
In this embodiment, the gateway 100 may allocate a corresponding multicast timeslot number to the home device 200 that requests to access the network according to whether there is a home device 200 that has already accessed the network in the multicast group.
Specifically, if there is no networked home device 200 in the multicast group, a preset multicast timeslot number is allocated to the home device 200, where the preset multicast timeslot number may be any value in the multicast timeslot range [0, M ], for example, the preset multicast timeslot number may be "0". If the home equipment 200 which has accessed the network exists in the multicast group, selecting an idle multicast time slot serial number in the multicast time slot range, and allocating the idle multicast time slot serial number to the home equipment 200. When the gateway 100 selects the idle multicast timeslot number, the idle multicast timeslot number may also be searched according to a set sequence. For example, the gateway 100 may start from the minimum value in the multicast slot range (i.e., the minimum multicast slot number "0"), and incrementally search for a free multicast slot number within the range of [0, M ]; starting from the maximum value in the multicast time slot range (i.e. the maximum multicast time slot sequence number "M"), the idle multicast time slot sequence number can be searched in the range of [0, N ] in a descending manner. Of course, the present application does not limit the specific manner of searching for the idle multicast slot number.
In the communication method provided in the embodiment of the present application, after determining that the home device 200 requesting to access the network belongs to a multicast group and allocating a corresponding channel to the home device 200 requesting to access the network, by selecting an idle multicast time slot serial number in the multicast time slot range corresponding to the multicast group, and the idle multicast time slot serial numbers are distributed to the household equipment 200, so that the multicast time slot serial numbers distributed to different household equipment 200 in the same multicast group on the channel are different, thus, different home devices 200 in the same multicast group can determine different multicast reply delay times according to the spreading factor of the channel and the serial number of the assigned multicast time slot, and then carry on the ordered reply to the multicast order of the gateway 100 according to different multicast and reply the delay time, difficult to conflict, compare with the way of replying in random delay, can also improve the utilization factor of the signal channel.
During the operation of the smart home system 10, the following situations may occur: 1. when the channels allocated to the home devices 200 interfere with each other, the home devices 200 disconnect communication, and the like, the home devices 200 often need to perform a re-networking operation, so as to switch to other channels to work; 2. the home devices 200 do not have a corresponding multicast group when requesting to access the network, and need to establish a multicast group with other home devices 200 (i.e. a new multicast group is established after accessing the network) after accessing the network due to a change in user requirements; 3. when the home device 200 requests to access the network, a corresponding multicast group is present, and after the network is accessed, a new multicast group is established with other home devices 200 (i.e., the multicast group is replaced after the network is accessed) due to the change of the user requirement. Based on this, referring to fig. 6, the communication method provided in the embodiment of the present application may further include the following steps:
step S301, the time slot sequence number is reallocated for the home equipment under the condition that the channel is switched after the home equipment is accessed to the network or the multicast group is established with other home equipment after the home equipment is accessed to the network.
In this embodiment, the gateway 100 has a timeslot management capability for all the home devices 200, and after the home devices 200 are networked, if it is detected that the home devices 200 switch channels after the home devices 200 are networked, the gateway 100 may allocate a broadcast timeslot sequence number to the home devices 200 according to the channels reallocated by the home devices 200, and further determine whether the home devices 200 have a corresponding multicast group on the reallocated channels, and if there is a corresponding multicast group, allocate a multicast timeslot sequence number to the home devices 200.
If the home devices 200 need to establish a multicast group with other home devices 200 after accessing the network (i.e., newly establishing a multicast group or replacing a multicast group after the home devices 200 access the network), first determining whether all the home devices 200 that need to establish the multicast group work on the same channel, if not, the gateway 100 needs to select a channel with the largest spreading factor in channels corresponding to the home devices 200 in the multicast group as a target channel, re-accessing all the home devices 200 in the multicast group to the selected target channel, and allocating a multicast address and a multicast timeslot number to each home device 200 in the multicast group; if the number of the household devices 200 in the multicast group exceeds the maximum capacity value of the target channel, no re-networking operation is performed. For the home devices 200 that have channel switching in the multicast group, the gateway 100 may allocate corresponding broadcast timeslot numbers to the home devices 200 according to the target channel.
It should be noted that, the content of the foregoing embodiment may be referred to for a specific allocation manner of the broadcast timeslot number and the multicast timeslot number, and details are not described here again.
In the communication method provided in the embodiment of the present application, when the channel switching occurs after the home device 200 is networked, or when the home device 200 establishes a multicast group with another home device 200 after being networked, the time slot management of all the home devices 200 by the gateway 100 is implemented by reallocating the broadcast time slot number and/or the multicast time slot number to the home device 200, that is, the time slot can be dynamically adjusted according to the network condition, so as to ensure that the home device 200 switches the channel, or the home device 200 can still reply the broadcast instruction or the multicast instruction of the gateway 100 in order after a multicast group is newly established or replaced, so that the network is more robust.
Optionally, in this embodiment, the gateway 100 may send a non-unicast instruction (a broadcast instruction or a multicast instruction) to the home devices 200, and may also send a unicast instruction to the home devices 200. Referring to fig. 7, the communication method provided in the embodiment of the present application may further include the following steps:
step S401, sending a unicast instruction to the household equipment; the unicast command carries the unicast time slot serial number, so that the home equipment determines second reply delay time according to the unicast time slot serial number and the spread spectrum factor of the channel, and replies the unicast command according to the second reply delay time.
In this embodiment, the unicast slot sequence number may be allocated by the gateway 100, and when the gateway 100 sends a unicast instruction to the home equipment 200, the unicast instruction carries the unicast slot sequence number; the home device 200 receiving the unicast instruction calculates a second reply delay time according to the unicast time slot number and the spreading factor of the channel, and replies the unicast instruction according to the second reply delay time. The formula for calculating the second recovery delay time may refer to the formula for calculating the first recovery delay time, and is not described herein again.
In the communication method provided in the embodiment of the present application, when the gateway 100 sends the unicast instruction to the home equipment 200, the unicast instruction carries the unicast slot number, so that the home equipment 200 that receives the unicast instruction can calculate the second reply delay time according to the unicast slot number and the spreading factor of the channel, and then reply to the unicast instruction according to the second reply delay time, thereby implementing flexible control on the time for the home equipment 200 to reply to the unicast instruction.
Optionally, referring to fig. 8, the communication method provided in the embodiment of the present application may further include the following steps:
step S501, after sending the unicast command or the non-unicast command, calculates the reply waiting time.
Step S502, receiving a reply message corresponding to the unicast instruction or the non-unicast instruction within the reply waiting time, and determining the home equipment which does not reply after exceeding the reply waiting time as the home equipment with overtime reply.
In this embodiment, after the gateway 100 sends the unicast instruction, the corresponding target time slot sequence number may be determined according to the unicast time slot sequence number allocated to the home device 200, and then the corresponding reply waiting time may be calculated according to the target time slot sequence number; wherein, the target time slot sequence number is greater than the unicast time slot sequence number. After the gateway 100 sends the broadcast instruction, the corresponding target time slot serial number may be determined according to the maximum broadcast time slot serial number allocated to the home device 200 on the channel, and then the corresponding reply waiting time may be calculated according to the target time slot serial number; wherein, the target time slot sequence number is greater than the maximum broadcast time slot sequence number. After the gateway 100 sends the multicast instruction, it may determine the corresponding target timeslot serial number according to the maximum multicast timeslot serial number allocated to the home devices 200 in the multicast group, and then calculate the corresponding reply waiting time according to the target timeslot serial number; wherein, the target time slot serial number is larger than the maximum multicast time slot serial number.
Taking the example that 1 is added on the basis of the unicast slot number, the multicast slot number, or the broadcast slot number as the target slot number, after the gateway 100 sends the unicast instruction on the channel, if the unicast slot number carried in the unicast instruction is u, the corresponding target slot number is determined to be u +1, and the delay time (which can be obtained according to the above-mentioned delay calculation formula) corresponding to the target slot number is taken as the reply waiting time after sending the unicast instruction. After the gateway 100 sends the broadcast instruction on the channel, it queries the maximum broadcast timeslot number in the broadcast timeslot numbers of the home devices 200 on the channel, and if the maximum broadcast timeslot number is bmaxThen determine the corresponding target timeslot serial number as bmax+1, and using the delay time (which can be obtained according to the above-mentioned delay calculation formula) corresponding to the target timeslot number as the reply waiting time after the broadcast instruction is sent. After sending a multicast command to a multicast address, the gateway 100 queries the maximum multicast timeslot number in the multicast timeslot numbers of the home devices 200 in the multicast group, and if the maximum multicast timeslot number is mmaxThen, the corresponding target time slot sequence number is determined to be mmax+1, then using the delay time (obtained according to the above-mentioned delay calculation formula) corresponding to the target time slot serial number as the reply waiting time after sending the multicast commandAnd (3) removing the solvent.
In the communication method provided in the embodiment of the present application, after the gateway 100 sends the unicast instruction or the non-unicast instruction, the gateway determines a target time slot sequence number based on the unicast time slot sequence number or the maximum broadcast time slot sequence number or the maximum multicast time slot sequence number, calculates the corresponding reply waiting time according to the target time slot sequence number, and waits for the reply of the home equipment 200 within the reply waiting time, where the home equipment 200 that has not replied after exceeding the reply waiting time is regarded as a reply timeout. For the home devices 200 that reply to the timeout, the gateway 100 may resend the corresponding instruction. Since the reply waiting time is determined according to the target time slot sequence number, and the target time slot sequence number is greater than the unicast time slot sequence number, the maximum broadcast time slot sequence number or the maximum multicast time slot sequence number, the gateway 100 can theoretically receive all reply messages sent by the home equipment 200 according to the reply instruction of the first reply delay time or the second reply delay time; for the home devices 200 that do not reply within the reply waiting time, the gateway 100 does not continue to wait for the reply, so that the time that the gateway 100 waits for the home devices 200 to reply is prevented from being too long, and the channel utilization rate is effectively improved.
It should be understood that, in this embodiment, communication rates on channels corresponding to different spreading factors are different, a length of a reply frame when the home devices 200 reply to the gateway 100 is fixed, a specific delay time duration corresponding to a time slot is also fixed, and a time slot corresponds to different delay times under different spreading factors, which is a common identification between the gateway 100 and all home devices 200, so that a beacon frame is not needed to synchronize the time of the home devices 200 and the gateway 100. The starting time of the time slot is calculated from the time when the home devices 200 receive the broadcast or multicast instruction, and after the gateway 100 sends the broadcast instruction or the multicast instruction, the time points when all the home devices 200 receive the broadcast instruction or the multicast instruction are the same.
Fig. 9 is a flowchart of another communication method according to an embodiment of the present application. The communication method may be applied to the household equipment 200, as shown in fig. 9, and includes:
step S601, receiving channel and time slot sequence number distributed by the gateway; different pieces of household equipment on the same channel correspond to different time slot serial numbers.
In this embodiment, after the home devices 200 initiate a network access request to the gateway 100, the gateway 100 allocates channels and timeslot numbers to the home devices 200 requesting network access, and sends the timeslot numbers of the allocated channels to the home devices 200. When the gateway 100 allocates the time slot sequence numbers to the home devices 200, different time slot sequence numbers will be allocated to different home devices 200 on the same channel, and the content of allocating the channel and the time slot sequence numbers to the gateway 100 may refer to the content of the method embodiments corresponding to fig. 2 to 6, which is not described herein again.
Step S602, determining a first recovery delay time according to the spreading factor and the timeslot number of the channel.
In this embodiment, after receiving the channel and the timeslot number allocated by the gateway 100, the home device 200 completes network access based on the channel allocated by the gateway 100, and calculates the first recovery delay time according to the spreading factor corresponding to the channel and the timeslot number allocated.
Step S603, when the non-unicast instruction sent by the gateway is received, replying the non-unicast instruction according to the first reply delay time.
In this embodiment, the home device 200 may receive a non-unicast instruction sent by the gateway 100 on a channel allocated by the gateway 100, and determine a time for replying the non-unicast instruction according to the calculated first reply delay time. For example, the home device 200 may start timing by using a time when the non-unicast instruction is received as a starting time, and may send a reply packet to the gateway 100 when the calculated first reply delay time is reached. Therefore, the time when each home device 200 replies to the non-unicast instruction may be the starting time + the first reply delay time.
In the communication method provided in the embodiment of the present application, the home device 200 determines the first recovery delay time by receiving the channel and the timeslot number allocated by the gateway 100 and according to the spreading factor and the timeslot number of the channel, and when a non-unicast instruction sent by the gateway 100 is received on the channel allocated by the gateway 100, replies to the non-unicast instruction according to the calculated first recovery delay time. When the gateway 100 allocates the time slot sequence numbers to the home devices 200, different home devices 200 on the same channel will be allocated with different time slot sequence numbers, so that different home devices 200 on the same channel can determine different first recovery delay times according to the spreading factor of the channel and the allocated time slot sequence numbers, and then reply to the non-unicast instruction according to the different first recovery delay times, thereby avoiding that a plurality of home devices 200 reply to the non-unicast instruction at the same time, effectively reducing the channel congestion, preventing collision among home devices 200, and reducing the packet loss rate.
Optionally, in practical application, the gateway 100 may allocate a corresponding broadcast timeslot signal to the home device 200 requesting to access the network, and if the home device 200 also forms a multicast group with other home devices 200, the gateway 100 needs to allocate a multicast timeslot number in addition to a broadcast timeslot number. Therefore, the timeslot signal sent by the gateway 100 to the home device 200 may or may not include the multicast timeslot number. For the two cases, the step S602 may specifically include: if the time slot serial number comprises a broadcast time slot serial number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot serial number; if the time slot serial number comprises a broadcast time slot serial number and a multicast time slot serial number, determining the broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot serial number, and determining the multicast reply delay time according to the spreading factor of the channel and the multicast time slot serial number.
For example, if the Timeslot number allocated to the home device 200 by the gateway 100 includes a broadcast Timeslot number, and the broadcast Timeslot number is b, the home device 200 may use a delay calculation formula Timeslot b-step 2 according to the spreading factor SF and the broadcast Timeslot number b of the allocated channel(SF-k)+ b 10 calculates the broadcast reply delay time Timeslot b. If the timeslot number allocated to the home device 200 by the gateway 100 includes a broadcast timeslot number and a multicast timeslot number, where the broadcast timeslot number is b and the multicast timeslot number is m, the home device 200 may allocate the spreading factor SF and the broadcast timeslot number according to the allocated channelb, using time delay calculation formula Timeslot b ═ b step ×. 2(SF-k)+ b 10 calculates the broadcast reply delay time timeslott b, and according to the spreading factor SF and the multicast slot number m of the allocated channel, the formula timeslott m-step 2 is calculated by using the delay(SF-k)+ m 10 calculates the multicast reply delay time Timeslot m.
When receiving the non-unicast instruction sent by the gateway 100, the home device 200 needs to determine which time slot (i.e., broadcast time slot or multicast time slot) should be observed according to the type of the non-unicast instruction, and then reply the non-unicast instruction according to the corresponding reply delay time. Therefore, the step S603 may specifically include: if the non-unicast instruction is a broadcast instruction, replying the broadcast instruction according to the broadcast reply delay time; and if the non-unicast instruction is the multicast instruction, replying the multicast instruction according to the multicast reply delay time.
That is to say, under the condition that the received non-unicast instruction is determined to be a broadcast instruction, the home device 200 may start timing from when the broadcast instruction is received, and send a reply message to the gateway 100 after the broadcast reply delay time Timeslot b is reached, so as to implement reply to the broadcast instruction; under the condition that the received non-unicast instruction is judged to be the multicast instruction, timing is started when the multicast instruction is received, and after the multicast reply delay time Timeslot m is reached, a reply message is sent to the gateway 100, so that the reply to the multicast instruction is realized.
According to the communication method provided by the embodiment of the application, the home device 200 may calculate the broadcast reply delay time according to the broadcast time slot number allocated by the gateway 100 and the spreading factor of the channel, may also calculate the multicast reply delay time according to the multicast time slot number allocated by the gateway 100 and the spreading factor of the channel, and when receiving the non-unicast instruction sent by the gateway 100, determines whether to reply to the non-unicast instruction according to the broadcast reply delay time or the multicast delay time according to the specific type of the non-unicast instruction. For each household device 200 that receives the broadcast instruction sent by the gateway 100, the respective corresponding broadcast reply delay time is different, so that each household device 200 can reply the broadcast instruction in order according to the respective broadcast reply delay time, and collision is not easy to occur; similarly, for each household device 200 that receives the multicast instruction sent by the gateway 100, the respective corresponding multicast reply delay time is also different, so that each household device 200 can reply to the multicast instruction in order according to the respective multicast reply delay time, and collision is not likely to occur.
Optionally, referring to fig. 10, the communication method may further include:
step S701, under the condition that a unicast instruction sent by the gateway is received, determining second reply delay time according to the unicast time slot sequence number carried in the unicast instruction and the spread spectrum factor of the channel distributed by the gateway, and replying the unicast instruction according to the second reply delay time.
In this embodiment, when the gateway 100 sends the unicast instruction to the home device 200, the unicast instruction may carry a unicast slot number, and after receiving the unicast instruction, the home device 200 uses a time delay calculation formula timeslotto u _ step 2 according to the unicast slot number u carried in the unicast instruction and the spreading factor SF of the channel allocated by the gateway 100(SF-k)+ u × 10 calculates the unicast reply delay time Timeslot m. The home device 200 starts timing from receiving the unicast instruction, and after reaching the unicast reply delay time Timeslot m, the home device 200 replies to the unicast instruction. In practical application, the unicast command may not carry the unicast slot number, and in this case, the home device 200 may default the unicast slot number to 0, that is, immediately reply to the unicast command without waiting.
In the communication method provided in the embodiment of the present application, because the unicast command sent by the gateway 100 carries the unicast slot number, the home device 200 that receives the unicast command can calculate the second reply delay time according to the unicast slot number and the spreading factor of the channel, and then reply to the unicast command according to the second reply delay time, thereby implementing flexible control over the time for the home device 200 to reply to the unicast command.
Fig. 11 is a functional block diagram of a communication device according to an embodiment of the present application. The communication apparatus can be applied to the gateway 100 described above, and includes a timeslot allocating module 810 and an information transceiving module 820.
The time slot allocating module 810 is configured to allocate a time slot sequence number to the home equipment 200 after allocating a channel to the home equipment 200 requesting to access the network; different pieces of home equipment 200 on the same channel correspond to different time slot serial numbers.
It is understood that the timeslot assignment module 810 may perform the step S201.
The information transceiving module 820 is configured to send the channel and the timeslot sequence number allocated to the home device 200, so that the home device 200 determines a first recovery delay time according to the spreading factor and the timeslot sequence number of the channel, and replies the non-unicast instruction according to the first recovery delay time when receiving the non-unicast instruction sent by the gateway 100.
It is understood that the information transceiver module 820 can perform the step S202.
Optionally, the time slot sequence number includes a broadcast time slot sequence number, and the time slot allocating module 810 is specifically configured to, after allocating a channel to the home device 200 that requests to access the network, select an idle broadcast time slot sequence number within a broadcast time slot range corresponding to the channel, and allocate the idle broadcast time slot sequence number to the home device 200.
It is to be understood that the timeslot assignment module 810 may perform the sub-step S2011 described above.
Optionally, the time slot sequence number further includes a multicast time slot sequence number, and the time slot allocation module 810 is further specifically configured to, if the home device 200 has a corresponding multicast group, select an idle multicast time slot sequence number within a multicast time slot range corresponding to the multicast group after allocating a channel to the home device 200 requesting to access the network, and allocate the idle multicast time slot sequence number to the home device 200.
It is understood that the timeslot assignment module 810 may perform substep S2012 described above.
Optionally, the timeslot allocation module 810 is further configured to reallocate the timeslot number for the home device 200 when the home device 200 switches channels after accessing the network, or when the home device 200 establishes a multicast group with another home device 200 after accessing the network.
It is understood that the timeslot assignment module 810 may also perform the step S301.
Optionally, the information transceiver module 820 may be further configured to send a unicast instruction to the home device 200; the unicast command carries the unicast time slot sequence number, so that the home equipment 200 determines a second reply delay time according to the unicast time slot sequence number and the spreading factor of the channel, and replies the unicast command according to the second reply delay time.
It is understood that the information transceiver module 820 may also perform the step S401.
Optionally, the information transceiver module 820 may be further configured to calculate a reply waiting time after sending the unicast instruction or the non-unicast instruction; and receiving a reply message corresponding to the unicast instruction or the non-unicast instruction within the reply waiting time, and determining the household equipment 200 which does not reply after exceeding the reply waiting time as the household equipment 200 which replies overtime.
It is understood that the information transceiver module 820 may perform the above steps S501 to S502.
In the communication apparatus provided in this embodiment of the application, the time slot allocating module 810 allocates a time slot sequence number to the home equipment 200 after allocating a channel to the home equipment 200 requesting to access the network, and the information transceiver module 820 sends the channel and the time slot sequence number allocated to the home equipment 200, so that the home equipment 200 determines a first recovery delay time according to a spreading factor of the channel and the time slot sequence number, and replies to a non-unicast instruction according to the first recovery delay time when receiving the non-unicast instruction sent by the gateway 100. Because the time slot allocating module 810 allocates different time slot serial numbers to different home devices 200 on the same channel, different home devices 200 on the same channel can determine different first recovery delay times according to the spreading factor of the channel and the allocated time slot serial numbers, and then reply to the non-unicast instruction according to the different first recovery delay times, so that multiple home devices 200 are prevented from replying to the non-unicast instruction at the same time, the channel congestion is effectively reduced, collision among home devices 200 is not easy to occur, and the packet loss rate is reduced.
Fig. 12 is a functional block diagram of another communication apparatus according to an embodiment of the present application. The communication device can be applied to the aforementioned home equipment 200, and includes a data receiving module 910, a delay time determining module 920 and a command replying module 930.
The data receiving module 910 is configured to receive a channel and a timeslot number allocated by the gateway 100; different pieces of home equipment 200 on the same channel correspond to different time slot serial numbers.
It is understood that the data receiving module 910 can perform the step S601.
The delay time determining module 920 is configured to determine a first recovery delay time according to the spreading factor and the timeslot number of the channel.
It is understood that the delay time determination module 920 may perform the step S602.
The instruction replying module 930 is configured to reply the non-unicast instruction according to the first reply delay time when the non-unicast instruction sent by the gateway 100 is received.
It is understood that the instruction reply module 930 may perform the step S603.
Optionally, the delay time determining module 920 is specifically configured to determine the broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot number if the time slot number includes the broadcast time slot number; if the time slot serial number comprises a broadcast time slot serial number and a multicast time slot serial number, determining the broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot serial number, and determining the multicast reply delay time according to the spreading factor of the channel and the multicast time slot serial number.
Optionally, the instruction reply module 930 is specifically configured to reply to the broadcast instruction according to the broadcast reply delay time if the non-unicast instruction is the broadcast instruction; and if the non-unicast instruction is the multicast instruction, replying the multicast instruction according to the multicast reply delay time.
Optionally, the delay time determining module 920 may be further configured to determine, when a unicast instruction sent by the gateway 100 is received, a second reply delay time according to the unicast slot sequence number carried in the unicast instruction and the spreading factor of the channel allocated by the gateway 100, and reply the unicast instruction according to the second reply delay time.
It is understood that the delay time determination module 920 may also perform the step S701.
In the communication apparatus provided in this embodiment of the present application, the data receiving module 910 receives a channel and a timeslot number allocated by the gateway 100, the delay time determining module 920 determines a first recovery delay time according to a spreading factor and the timeslot number of the channel, and the instruction recovering module 930 recovers the non-unicast instruction according to the first recovery delay time when receiving the non-unicast instruction sent by the gateway 100. When the gateway 100 allocates the time slot sequence numbers to the home devices 200, different home devices 200 on the same channel will be allocated with different time slot sequence numbers, so that different home devices 200 on the same channel can determine different first recovery delay times according to the spreading factor of the channel and the allocated time slot sequence numbers, and then reply to the non-unicast instruction according to the different first recovery delay times, thereby avoiding that a plurality of home devices 200 reply to the non-unicast instruction at the same time, effectively reducing the channel congestion, preventing collision among home devices 200, and reducing the packet loss rate.
The electronic device provided by the embodiments of the present application may include a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the communication method provided by the above-mentioned method embodiments.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
Fig. 13 is a block diagram of an exemplary hardware structure of an electronic device that may implement a gateway 100 and a home device 200 according to an embodiment of the present application. As shown in fig. 13, the electronic device may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 111 (the processor 111 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 113 for storing data, and one or more storage media 112 (e.g., one or more mass storage devices) for storing applications 1123 or data 1122. The memory 113 and the storage medium 112 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 112 may include one or more modules, each of which may include a sequence of instructions operating on an electronic device. Further, the processor 111 may be arranged to communicate with the storage medium 112 to execute a series of instruction operations in the storage medium 112 on the electronic device. The electronic device may also include one or more power supplies 116, one or more wired or wireless network interfaces 115, one or more input-output interfaces 114, and/or one or more operating systems 1121, such as windows server, MacOSXTM, unix, linux, FreeBSDTM, and the like.
The input output interface 114 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the electronic device. In one example, the input/output interface 114 includes a network adapter (NIC) that can be connected to other network devices through a base station to communicate with the internet. In one example, the input/output interface 114 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
It will be understood by those skilled in the art that the structure shown in fig. 13 is only an illustration, and does not limit the structure of the gateway 100. For example, gateway 100 may also include more or fewer components than shown in fig. 13, or have a different configuration than shown in fig. 13.
According to the gateway 100 provided by the embodiment of the application, after a channel is allocated to a home device 200 requesting to access a network, a time slot serial number is allocated to the home device 200, wherein different home devices 200 on the same channel correspond to different time slot serial numbers, and the channel and the time slot serial number allocated to the home device 200 are sent to the home device 200; the home device 200 determines a first recovery delay time according to the spreading factor and the timeslot number of the channel, and replies the non-unicast instruction according to the first recovery delay time when receiving the non-unicast instruction sent by the gateway 100. When the gateway 100 allocates the time slot sequence numbers to the home devices 200, different home devices 200 on the same channel will be allocated with different time slot sequence numbers, so that different home devices 200 on the same channel can determine different first recovery delay times according to the spreading factor of the channel and the allocated time slot sequence numbers, and then reply to the non-unicast instruction according to the different first recovery delay times, thereby avoiding that a plurality of home devices 200 reply to the non-unicast instruction at the same time, effectively reducing the channel congestion, preventing collision among home devices 200, and reducing the packet loss rate.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the processes of the communication method embodiment, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It is noted that, herein, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a gateway, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (14)
1. A communication method, applied to a gateway, the method comprising:
after a channel is allocated to the household equipment which requests to access the network, a time slot serial number is allocated to the household equipment; different household devices on the same channel correspond to different time slot serial numbers;
and sending the channel and the time slot sequence number allocated to the home equipment so that the home equipment determines a first recovery delay time according to the spreading factor of the channel and the time slot sequence number, and replying a non-unicast instruction according to the first recovery delay time under the condition of receiving the non-unicast instruction sent by the gateway.
2. The method according to claim 1, wherein the timeslot sequence number includes a broadcast timeslot sequence number, and the step of allocating the timeslot sequence number to the home devices after allocating channels to the home devices requesting network entry includes:
after a channel is allocated to the home equipment which requests to access the network, an idle broadcast time slot serial number is selected in a broadcast time slot range corresponding to the channel, and the idle broadcast time slot serial number is allocated to the home equipment.
3. The method according to claim 1, wherein the timeslot sequence number further includes a multicast timeslot sequence number, and the step of allocating the timeslot sequence number to the home device after allocating the channel to the home device that requests network entry further includes:
if the home equipment has the corresponding multicast group, after a channel is allocated to the home equipment requesting to access the network, a free multicast time slot serial number is selected in the multicast time slot range corresponding to the multicast group, and the free multicast time slot serial number is allocated to the home equipment.
4. The method of claim 1, further comprising:
and under the condition that the channel is switched after the household equipment is connected to the network or a multicast group is established between the household equipment and other household equipment after the household equipment is connected to the network, the time slot serial number is reallocated for the household equipment.
5. The method of claim 1, further comprising:
sending a unicast instruction to the household equipment; the unicast instruction carries a unicast time slot sequence number, so that the home equipment determines a second reply delay time according to the unicast time slot sequence number and the spread spectrum factor of the channel, and replies the unicast instruction according to the second reply delay time.
6. The method according to any one of claims 1-5, further comprising:
after a unicast instruction or a non-unicast instruction is sent, calculating reply waiting time;
and receiving a reply message corresponding to the unicast instruction or the non-unicast instruction within the reply waiting time, and determining the home equipment which does not reply after exceeding the reply waiting time as the home equipment with overtime reply.
7. A communication method is applied to household equipment, the household equipment is communicated with a gateway, and the method comprises the following steps:
receiving the channel and time slot sequence number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
determining a first return delay time according to the spreading factor of the channel and the time slot sequence number;
and under the condition of receiving a non-unicast instruction sent by the gateway, replying the non-unicast instruction according to the first reply delay time.
8. The method of claim 7, wherein the step of determining the first recovery delay time according to the spreading factor of the channel and the slot number comprises:
if the time slot serial number comprises a broadcast time slot serial number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot serial number;
if the time slot serial number comprises a broadcast time slot serial number and a multicast time slot serial number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot serial number, and determining multicast reply delay time according to the spreading factor of the channel and the multicast time slot serial number.
9. The method according to claim 8, wherein the step of replying to the non-unicast command according to the first reply delay time when receiving the non-unicast command sent by the gateway comprises:
if the non-unicast instruction is a broadcast instruction, replying the broadcast instruction according to the broadcast reply delay time;
and if the non-unicast instruction is a multicast instruction, replying the multicast instruction according to the multicast reply delay time.
10. The method of claim 7, further comprising:
and under the condition of receiving a unicast instruction sent by the gateway, determining second reply delay time according to the unicast time slot sequence number carried in the unicast instruction and the spreading factor of the channel allocated by the gateway, and replying the unicast instruction according to the second reply delay time.
11. A communication apparatus, applied to a gateway, the apparatus comprising:
the time slot allocation module is used for allocating a time slot serial number to the household equipment after allocating a channel to the household equipment which requests to access the network; different household devices on the same channel correspond to different time slot serial numbers;
and the information transceiving module is used for sending the channel and the time slot sequence number allocated to the home equipment so that the home equipment determines a first recovery delay time according to the spreading factor of the channel and the time slot sequence number, and replies the non-unicast instruction according to the first recovery delay time under the condition of receiving the non-unicast instruction sent by the gateway.
12. A communication device is characterized in that the communication device is applied to household equipment, the household equipment is communicated with a gateway, and the device comprises:
the data receiving module is used for receiving the channel and the time slot serial number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
a delay time determining module, configured to determine a first recovery delay time according to the spreading factor of the channel and the timeslot number;
and the instruction reply module is used for replying the non-unicast instruction according to the first reply delay time under the condition of receiving the non-unicast instruction sent by the gateway.
13. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the communication method as claimed in any one of claims 1 to 6 or any one of claims 7 to 10.
14. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the communication method according to any one of claims 1 to 6 or any one of claims 7 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011389569.3A CN114584424B (en) | 2020-12-01 | 2020-12-01 | Communication method, communication device, electronic apparatus, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011389569.3A CN114584424B (en) | 2020-12-01 | 2020-12-01 | Communication method, communication device, electronic apparatus, and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114584424A true CN114584424A (en) | 2022-06-03 |
CN114584424B CN114584424B (en) | 2024-01-02 |
Family
ID=81767984
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011389569.3A Active CN114584424B (en) | 2020-12-01 | 2020-12-01 | Communication method, communication device, electronic apparatus, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114584424B (en) |
Citations (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1901748A (en) * | 2006-07-25 | 2007-01-24 | 华为技术有限公司 | Time slot format configuration method based on physical random cut-in channel frame |
CN101360339A (en) * | 2008-09-28 | 2009-02-04 | 熊猫电子集团有限公司 | Access control method fusing TD-SCDMA cell phone network and self-organizing network |
US20090268692A1 (en) * | 2005-12-16 | 2009-10-29 | Jacobus Cornelis Haartsen | Method and device for communicating a signal |
CN102215573A (en) * | 2010-04-07 | 2011-10-12 | 鼎桥通信技术有限公司 | Distribution method for SPS (Semi-Persistent Scheduling) E-PUCH (Enhanced-Physical Uplink Channel) signature sequence group |
CN102378309A (en) * | 2010-08-12 | 2012-03-14 | 华为技术有限公司 | Network access method and system thereof |
CN106162844A (en) * | 2016-06-03 | 2016-11-23 | 西安电子科技大学 | Implementation method based on the MAC protocol for wireless sensor networks of LoRa |
CN108173685A (en) * | 2017-12-26 | 2018-06-15 | 金卡智能集团股份有限公司 | Upgrade method, system and corresponding terminal device and server based on LoRa communications |
CN109195195A (en) * | 2018-08-13 | 2019-01-11 | 锐捷网络股份有限公司 | LoRa network channel cut-in method, terminal, gateway, server and system |
CN109362106A (en) * | 2018-09-29 | 2019-02-19 | 上海海洋大学 | A kind of wireless communication system and wireless communications method towards large area aquaculture |
CN109451536A (en) * | 2018-08-31 | 2019-03-08 | 深圳市亿兆互联技术有限公司 | A method of it reducing LoRa and communicates packet loss |
US20190312959A1 (en) * | 2018-04-04 | 2019-10-10 | Mark Hall | Normalization of Communication between Devices |
CN110535925A (en) * | 2019-08-20 | 2019-12-03 | 深圳柚石物联技术有限公司 | A kind of Internet of Things control method, device, system and computer readable storage medium |
CN110572481A (en) * | 2019-10-15 | 2019-12-13 | 广西交通科学研究院有限公司 | intelligent electromechanical equipment data interaction method and system based on LoRa communication |
CN111194073A (en) * | 2019-09-24 | 2020-05-22 | 腾讯科技(深圳)有限公司 | Data receiving or transmitting method, device, terminal and readable storage medium |
CN111432494A (en) * | 2020-03-27 | 2020-07-17 | 瑞兴恒方网络(深圳)有限公司 | Automatic time slot allocation method and device |
CN111541508A (en) * | 2020-04-21 | 2020-08-14 | 中山大学 | LoRaWAN spread spectrum factor distribution method based on short-term DER and optimal load |
CN111741515A (en) * | 2020-06-18 | 2020-10-02 | 大唐半导体科技有限公司 | Gateway and terminal ad hoc network data transmission method based on LoRa technology |
CN111835626A (en) * | 2019-04-23 | 2020-10-27 | 深圳长城开发科技股份有限公司 | LoRa communication method, LoRa server gateway and readable storage medium |
CN111918394A (en) * | 2019-05-09 | 2020-11-10 | 深圳长城开发科技股份有限公司 | LoRa terminal uplink data method, LoRa terminal, LoRa network and storage medium |
-
2020
- 2020-12-01 CN CN202011389569.3A patent/CN114584424B/en active Active
Patent Citations (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090268692A1 (en) * | 2005-12-16 | 2009-10-29 | Jacobus Cornelis Haartsen | Method and device for communicating a signal |
CN1901748A (en) * | 2006-07-25 | 2007-01-24 | 华为技术有限公司 | Time slot format configuration method based on physical random cut-in channel frame |
CN101360339A (en) * | 2008-09-28 | 2009-02-04 | 熊猫电子集团有限公司 | Access control method fusing TD-SCDMA cell phone network and self-organizing network |
CN102215573A (en) * | 2010-04-07 | 2011-10-12 | 鼎桥通信技术有限公司 | Distribution method for SPS (Semi-Persistent Scheduling) E-PUCH (Enhanced-Physical Uplink Channel) signature sequence group |
CN102378309A (en) * | 2010-08-12 | 2012-03-14 | 华为技术有限公司 | Network access method and system thereof |
CN106162844A (en) * | 2016-06-03 | 2016-11-23 | 西安电子科技大学 | Implementation method based on the MAC protocol for wireless sensor networks of LoRa |
CN108173685A (en) * | 2017-12-26 | 2018-06-15 | 金卡智能集团股份有限公司 | Upgrade method, system and corresponding terminal device and server based on LoRa communications |
US20190312959A1 (en) * | 2018-04-04 | 2019-10-10 | Mark Hall | Normalization of Communication between Devices |
CN109195195A (en) * | 2018-08-13 | 2019-01-11 | 锐捷网络股份有限公司 | LoRa network channel cut-in method, terminal, gateway, server and system |
CN109451536A (en) * | 2018-08-31 | 2019-03-08 | 深圳市亿兆互联技术有限公司 | A method of it reducing LoRa and communicates packet loss |
CN109362106A (en) * | 2018-09-29 | 2019-02-19 | 上海海洋大学 | A kind of wireless communication system and wireless communications method towards large area aquaculture |
CN111835626A (en) * | 2019-04-23 | 2020-10-27 | 深圳长城开发科技股份有限公司 | LoRa communication method, LoRa server gateway and readable storage medium |
CN111918394A (en) * | 2019-05-09 | 2020-11-10 | 深圳长城开发科技股份有限公司 | LoRa terminal uplink data method, LoRa terminal, LoRa network and storage medium |
CN110535925A (en) * | 2019-08-20 | 2019-12-03 | 深圳柚石物联技术有限公司 | A kind of Internet of Things control method, device, system and computer readable storage medium |
CN111194073A (en) * | 2019-09-24 | 2020-05-22 | 腾讯科技(深圳)有限公司 | Data receiving or transmitting method, device, terminal and readable storage medium |
CN110572481A (en) * | 2019-10-15 | 2019-12-13 | 广西交通科学研究院有限公司 | intelligent electromechanical equipment data interaction method and system based on LoRa communication |
CN111432494A (en) * | 2020-03-27 | 2020-07-17 | 瑞兴恒方网络(深圳)有限公司 | Automatic time slot allocation method and device |
CN111541508A (en) * | 2020-04-21 | 2020-08-14 | 中山大学 | LoRaWAN spread spectrum factor distribution method based on short-term DER and optimal load |
CN111741515A (en) * | 2020-06-18 | 2020-10-02 | 大唐半导体科技有限公司 | Gateway and terminal ad hoc network data transmission method based on LoRa technology |
Non-Patent Citations (4)
Title |
---|
""R1-00-0422"", 3GPP TSG_RAN\\WG1_RL1 * |
""R1-1719777_Discussion on TRS"", 3GPP TSG_RAN\\WG1_RL1 * |
DIMITRIOS ZORBAS ET AL: ""Offline Scheduling Algorithms for Time-Slotted LoRa-based Bulk Data Transmission"", 《2019 IEEE 5TH WORLD FORUM ON INTERNET OF THINGS (WF-IOT)》 * |
楼佳嘉: ""TD-Femto系统OVSF码资源管理研究与实现"", 中国优秀硕士学位论文全文数据库, no. 06 * |
Also Published As
Publication number | Publication date |
---|---|
CN114584424B (en) | 2024-01-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7564804B2 (en) | Method of assigning addresses to a plurality of devices on a network and a network system therefor | |
CN109462652B (en) | Terminal gateway load distribution method based on Hash algorithm in intelligent home system | |
US7136928B2 (en) | Communication device and communication control method using efficient Echonet address determination scheme | |
CN110636483A (en) | Network distribution method and system | |
CN105959906B (en) | Network equipment communication method and device and network equipment communication method and device | |
CN1460214A (en) | System for dynamic process assignment in local area network and method therefor | |
CN108770045B (en) | Network access method, related equipment and network system | |
CN105338014A (en) | Subscription mechanism-based communication method and subject server | |
CN104883656A (en) | Method for establishing steady state piconet based on bluetooth and system for establishing steady state piconet based on bluetooth | |
CN111913397A (en) | Device control method, device, storage medium, and electronic apparatus | |
CN107124337A (en) | Equipment configuration method, device, system and centralized control terminal | |
CN114585052B (en) | LoRa-based networking method, device, gateway and storage medium | |
CN111585801A (en) | ZigBee device upgrading method and related device | |
CN106537955B (en) | Data transmission method and device | |
US9066352B2 (en) | Wireless network connection method of electronic device and electronic device thereof | |
CN113206862B (en) | Network distribution method and device for Internet of things equipment | |
CN107005464B (en) | Method and device for processing service flow data packet | |
CN114584424A (en) | Communication method, communication device, electronic equipment and computer-readable storage medium | |
CN106851685B (en) | Method and system for controlling bandwidth of mobile terminal | |
CN113452763A (en) | Smart home service registration method and device and smart home system | |
CN114584414B (en) | Device control method, device, electronic device, and computer-readable storage medium | |
CN112769658A (en) | Terminal control system, method, device, gateway device and storage medium | |
CN105682173A (en) | Network access method and equipment | |
CN113452586B (en) | Method and device for registering edge computing node and intelligent home system | |
CN110611589A (en) | Control method and device of regional control system and air conditioning system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |