CN114584424B - Communication method, communication device, electronic apparatus, and computer-readable storage medium - Google Patents

Communication method, communication device, electronic apparatus, and computer-readable storage medium Download PDF

Info

Publication number
CN114584424B
CN114584424B CN202011389569.3A CN202011389569A CN114584424B CN 114584424 B CN114584424 B CN 114584424B CN 202011389569 A CN202011389569 A CN 202011389569A CN 114584424 B CN114584424 B CN 114584424B
Authority
CN
China
Prior art keywords
time slot
sequence number
channel
unicast
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.)
Active
Application number
CN202011389569.3A
Other languages
Chinese (zh)
Other versions
CN114584424A (en
Inventor
刘宁可
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lumi United Technology Co Ltd
Original Assignee
Lumi United Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Lumi United Technology Co Ltd filed Critical Lumi United Technology Co Ltd
Priority to CN202011389569.3A priority Critical patent/CN114584424B/en
Publication of CN114584424A publication Critical patent/CN114584424A/en
Application granted granted Critical
Publication of CN114584424B publication Critical patent/CN114584424B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2807Exchanging configuration information on appliance services in a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/283Processing of data at an internetworking point of a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/04Wireless resource allocation
    • H04W72/044Wireless resource allocation based on the type of the allocated resource
    • H04W72/0446Resources in time domain, e.g. slots or frames

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 a 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 conveniently determine the first reply delay time according to the spreading factor of the channel and the time slot sequence number, and further reply to the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received. Because different home devices on the same channel correspond to different time slot serial numbers, different home devices on the same channel can determine different first reply delay time according to the spreading factor and the time slot serial numbers of the channel, and reply to the non-unicast instruction according to the different first reply delay time, so that the situation of channel congestion is effectively reduced, collision is not easy to occur among the home devices, and the packet loss rate is reduced.

Description

Communication method, communication device, electronic apparatus, and computer-readable storage medium
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 current narrow-band personal area network star networking, after a gateway sends a broadcast message or a multicast message, home equipment reply confirmation is needed, when the number of home equipment accessed to the network or the number of home equipment in the multicast group is large, channel congestion is easily generated when a plurality of home equipment reply the broadcast message or the multicast message, collision is easily generated among the devices, and the packet loss rate is high.
Disclosure of Invention
The embodiment of the application provides a communication method, a device, electronic equipment and a computer readable storage medium, which are used for solving the problems that channel congestion is easy to generate when a plurality of home devices reply a gateway broadcast or multicast message in the prior art, and collision is easy to occur among the devices, so that the packet loss rate is high.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, the present application provides a communication method, applied to a gateway, the method including:
after a channel is allocated to the household equipment requesting network access, a time slot sequence 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 household equipment so that the household equipment can determine a first reply delay time according to the spreading factor of the channel and the time slot sequence number, and replying the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received.
In a second aspect, the present application provides a communication method applied to a home device, where the home device communicates with a gateway, the method including:
receiving the channel and time slot serial numbers distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
determining a first reply delay time according to the spreading factor of the channel and the time slot sequence number;
and under the condition that a non-unicast instruction sent by the gateway is received, replying the non-unicast instruction according to the first reply delay time.
In a third aspect, the present application provides a communication device for use in a gateway, the device comprising:
the time slot allocation module is used for allocating time slot serial numbers to the household equipment after allocating channels to the household equipment requesting network access; different household devices on the same channel correspond to different time slot serial numbers;
And the information receiving and transmitting module is used for transmitting the channel and the time slot serial number allocated by the household equipment to the household equipment so that the household equipment can determine a first reply delay time according to the spreading factor of the channel and the time slot serial number, and reply the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction transmitted by the gateway is received.
In a fourth aspect, the present application provides a communication apparatus for use in a home device, the home device being in communication with a gateway, the apparatus comprising:
the data receiving module is used for receiving the channel and the time slot sequence number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
the delay time determining module is used for determining a first reply delay time according to the spreading factor of the channel and the time slot sequence number;
and the instruction reply module is used for replying the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received.
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, the computer program implementing the steps of the communication method according to any of the preceding embodiments when executed by the processor.
In a sixth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, 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 the gateway allocates the channel to the home equipment requesting to access the network, the gateway allocates the time slot serial number to the home equipment, and sends the channel and the time slot serial number allocated to the home equipment, so that the home equipment can conveniently determine the first reply delay time according to the spreading factor of the channel and the time slot serial number, and further reply the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received. Because different home devices on the same channel correspond to different time slot serial numbers, different home devices on the same channel can determine different first reply delay time according to the spreading factor and the time slot serial numbers of the channel, and reply to the non-unicast instruction according to the different first reply delay time, so that the situation of channel congestion is effectively reduced, collision is not easy to occur among the home devices, and the packet loss rate is reduced.
In order to make the above 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 needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a schematic diagram of an application environment suitable for use in embodiments of the present application;
fig. 2 is a schematic flow chart of a communication method applied to a gateway according to an embodiment of the present application;
fig. 3 is a schematic diagram showing a plurality of home devices replying to a non-unicast command after a gateway sends the non-unicast command;
fig. 4 is a schematic flow chart of another communication method applied to a gateway according to an embodiment of the present application;
fig. 5 shows a further flowchart of a communication method applied to a gateway according to an embodiment of the present application;
Fig. 6 shows a further flowchart of a communication method applied to a gateway according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another communication method applied to a gateway according to an embodiment of the present application;
fig. 8 is a schematic flow chart of a communication method applied to a gateway according to an embodiment of the present application;
fig. 9 is a schematic flow chart of a communication method applied to a home device according to an embodiment of the present application;
fig. 10 is a schematic flow chart of another communication method applied to a home device according to an embodiment of the present application;
FIG. 11 is a functional block diagram of a communication device 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 home apparatus according to an embodiment of the present application;
fig. 13 is a block diagram of an exemplary hardware structure of an electronic device of a gateway and a home device, where the concept of the application may be implemented according to an embodiment of the present application.
Icon: 10-an intelligent home system; a 100-gateway; 200-household equipment; 300-a server; 400-terminal equipment; 500-a router; a 111-processor; 112-a storage medium; 113-a memory; 114-input-output interface; 115-a wired or wireless network interface; 116-power supply; 1121—an operating system; 1122-data; 1123-an application; 810-a slot allocation module; 820-an information transceiving module; 910-a data receiving module; 920-a delay time determination module; 930-instruction reply module.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 is a schematic view of an application environment suitable for the embodiments 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 gateways 100 may be at least one, and the number of home devices 200 may be at least one. In addition, when the number of gateways 100 is plural, communication connection may be performed between different gateways 100.
In this embodiment, the gateway 100 may be an intelligent gateway for controlling smart home, and may implement functions of system information collection, information input, information output, centralized control, remote control, coordinated control, and the like. Gateway 100 may be responsible for specific security alarms, home appliance control, and power usage information collection. The gateway 100 may also interact with products such as intelligent interaction terminals in a wireless manner. Gateway 100 also has wireless routing functionality, good wireless performance, network security, and coverage area.
The home appliance 200 may include various intelligent home appliances, sensing devices, detection devices, etc. disposed in an indoor space, such as a smart tv, a smart refrigerator, a smart air conditioner, a temperature and humidity sensor, a pressure sensor, a smoke sensor, a human body sensor, a door and window sensor, a smart switch, a socket, an electric lamp, an infrared emitting device, a camera device, etc. The home device 200 connected to the gateway 100 can exchange information and instructions with the gateway 100. Gateway 100 and home device 200 may be connected by LoRa communication.
In this embodiment, the server 300 may be a local server, a cloud server, or the like, and the specific server type may not be limited in this embodiment of the present application. The server 300 connected to the gateway 100 may perform information interaction with the gateway 100 through a wireless manner. 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, but is not limited to, a personal computer (personal computer, PC), a tablet computer, a smart phone, a personal digital assistant (personal digital assistant, PDA), and the like. The terminal device 400 can interact with the server 300 in a wireless manner such as 2G/3G/4G/5G/WiFi. Of course, the connection manner 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 to interact with a user, so that the user may wirelessly communicate with the gateway 100 via the router 500 via the terminal device 400. In addition, the user may add one account information to the gateway 100 and the terminal device 400 at the same time, and information synchronization of the gateway 100 and the terminal device 400 is achieved 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 way, the terminal device 400 may upload the scene configuration information or the automation scheme to the server 300, so that when the trigger condition of the trigger scene or the automation is reached, the server 300 may find a device corresponding to the execution action in the scene configuration information or the automation scheme according to the stored scene configuration information or the automation scheme, so as to notify the device to execute the execution action to meet the execution result of the trigger scene or the automation. Alternatively, the server 300 may send the scenario configuration information or the automation scheme to the gateway 100, and the gateway 100 may find a device corresponding to the execution action in the scenario configuration information or the automation scheme according to the stored scenario configuration information or automation scheme. Meanwhile, the gateway 100 may feed back the execution of the device to the server 300.
Embodiments of 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 order, and it should be understood that, in other embodiments, the order 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 may be applied to the gateway 100 described above, and the detailed flow shown in fig. 2 will be described in detail.
Step S201, after allocating channels to the home devices requesting network access, allocating time slot serial numbers to the home devices; different household devices on the same channel correspond to different time slot serial numbers.
In this embodiment, a channel may be defined by the frequency point and the spreading factor together, for example, the channel may be (470.4 MHz, sf9), where 470.4MHz is the frequency point and SF9 is the spreading factor. The gateway 100 performs frequency point scanning during networking, and combines a plurality of target frequency points obtained by scanning with a plurality of preset spread spectrum factors to obtain a plurality of channels. In one embodiment, the scanning range of the frequency point may be 470MHz to 510MHz, and the selection range of the spreading factor may be 5 to 12. When the gateway 100 receives the network access request instruction of the home device 200, one channel is selected from a plurality of channels obtained by scanning the frequency points, and allocated to the home device 200, and a corresponding time slot sequence number is allocated to the home device 200.
In this embodiment, when allocating slot numbers to home devices 200, the gateway 100 needs to ensure that slot numbers allocated to different home devices 200 on the same channel are different. For example, if there are three home devices 200 on a channel, the time slot numbers allocated by the gateway 100 to the three home devices 200 should be guaranteed to be different.
Step S202, a channel and a time slot sequence number allocated to the home equipment are sent to the home equipment, so that the home equipment can determine a first reply delay time according to the spreading factor and the time slot sequence number of the channel, and reply to the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received.
In this embodiment, after the gateway 100 completes the allocation of the channel and the slot sequence number, the allocated channel and slot sequence number are sent to the home device 200 requesting to access the network by sending network information, and the home device 200 completes the access to the network based on the channel allocated by the gateway 100, and then calculates the first reply delay time according to the spreading factor corresponding to the channel and the allocated slot sequence number. When the home device 200 receives the non-unicast command sent by the gateway 100 on the channel, the non-unicast command can be replied according to the calculated first reply delay time. That is, after the gateway 100 sends the non-unicast command on a certain channel, all home devices 200 that receive the non-unicast command on the channel do not reply to the non-unicast command immediately, but determine the time to reply to the non-unicast command according to the respective calculated first reply delay time.
Optionally, each home device 200 that receives the non-unicast command may start timing with the time when the non-unicast command is received as the starting time, and when the calculated first reply delay time is reached, may send a reply message to the gateway 100. Therefore, the time when each home device 200 replies to the non-unicast command is the starting time plus the first reply delay time.
In one 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 slot number, the delay calculation formula of Timeslot n=n×step×2 may be used (SF-k) Calculating a first recovery delay time by +n×10; wherein k is a reference spreading factor, and the value range of k can be 5-12, for example, k=7 is set; step can be understood as a fixed value corresponding to the time step under the reference spreading factor, and the specific value is determined according to the actually selected reference spreading factor; SF indicates a spreading factor of a channel allocated to the home device 200, and n indicates a slot number allocated to the home device 200. The home device 200 starts timing when receiving a non-unicast command on a channel allocated by the gateway 100, and when reaching the calculated first reply delay time Timeslot, sends a reply message to the gateway 100. For example, when n=0, the calculated first reply delay time is 0, which indicates that the home device 200 replies to the gateway 100 immediately after receiving the non-unicast command without waiting.
As shown in fig. 3, after the gateway 100 sends the non-unicast command, the home devices 200 (i.e., the sub-device d1, the sub-devices d2, …, and the sub-device dn) reply the non-unicast command according to the calculated first reply delay time, and the replies of the sub-devices to the non-unicast command are orderly and are not easy to collide.
According to the communication method provided by the embodiment of the invention, after the gateway 100 sends the non-unicast command on a certain channel, a plurality of different home devices 200 receive the non-unicast command on the channel, and as the gateway 100 allocates different time slot serial numbers to different home devices 200 on the same channel when allocating the time slot serial numbers to the home devices 200, the 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 reply the non-unicast command according to the different first reply delay times, so that the situation that the plurality of home devices 200 reply the non-unicast command at the same time is effectively reduced, the situation of channel congestion is not easy to occur, and the packet loss rate is reduced.
Optionally, in this embodiment, the timeslot number may include a broadcast timeslot number, referring to fig. 4, and step S201 described above may specifically include the following sub-steps:
In the substep S2011, after allocating a channel to the home device requesting to access the network, an idle broadcast time slot sequence number is selected in a broadcast time slot range corresponding to the channel, and the idle broadcast time slot sequence number is allocated to the home device.
In this embodiment, the broadcasting time slot range corresponding to the channel may be set to be [0, n ]]Wherein N represents the maximum capacity value of the channel, N can be calculated according to the spreading factor of the channel, and the specifically adopted calculation formula can be n=2 (13-SF) SF denotes the spreading factor of the channel. Gateway 100 may be configured to allocate channels to home devices 200 requesting access to the network after the network has been established between [0, n]The broadcasting time slot serial number which searches for the free in the range is allocated to the home device 200, so that the value range of the broadcasting time slot serial number allocated by the home device 200 is actually the broadcasting time slot range [0, N ] corresponding to the channel]。
In this embodiment, the gateway 100 may allocate a corresponding broadcasting timeslot number to the home device 200 according to whether other home devices 200 exist on the channel allocated by the home device 200 requesting to access the network.
Specifically, if no other home device 200 exists on the channel allocated by the home device 200, a preset broadcast slot number is allocated to the home device 200, where 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 by the home device 200, an idle broadcast time slot sequence number is selected in the broadcast time slot range, and the idle broadcast time slot sequence number is allocated to the home device 200. When the gateway 100 selects the idle broadcast slot sequence number, the gateway may search for the idle broadcast slot sequence number according to a set order. For example, gateway 100 may incrementally search for free broadcast slot numbers within the [0, n ] range starting from the minimum value in the broadcast slot range (i.e., the minimum broadcast slot number "0"); the free broadcast slot sequence numbers may also be looked up in a decreasing range of [0, N ], starting with the maximum value in the broadcast slot range (i.e. the maximum broadcast slot sequence number "N"). Of course, the specific manner of searching for the idle broadcast slot sequence number is not limited in this application.
That is, after allocating a channel to the home device 200 requesting to access the network, the gateway 100 may first determine whether other home devices 200 exist on the channel, that is, whether the channel is allocated to other home devices 200, and if no other home devices 200 exist on the channel, it indicates that the home device 200 requesting to access the network is the first home device 200 allocated to the channel, and at this time, a preset broadcasting timeslot number is allocated to the home device 200. If other home devices 200 exist on the channel, it indicates that other home devices 200 have been assigned to the broadcast slot number prior to the home device 200 requesting network access, and at this time, the gateway 100 may select an idle broadcast slot number within the broadcast slot range corresponding to the channel to be assigned to the home device 200 requesting network access.
According to the communication method provided by the embodiment of the invention, after the gateway 100 allocates the channel to the home equipment 200 requesting network access, the gateway 100 selects the idle broadcast time slot sequence number in the broadcast time slot range corresponding to the channel, and allocates the idle broadcast time slot sequence number to the home equipment 200 requesting network access, so that different broadcast time slot sequence numbers allocated to different home equipment 200 on the same channel are different, different broadcast reply delay times can be determined by different home equipment 200 on the same channel according to the spreading factor of the channel and the allocated broadcast time slot sequence number, further, the broadcast instructions of the gateway 100 are sequentially replied according to the different broadcast reply delay times, and the conflict 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 allocating channels, the gateway 100 needs to allocate the home devices 200 belonging to one multicast group to the same channel, and when allocating a time slot sequence number to the home devices 200, besides allocating a broadcast time slot sequence number, it also needs to allocate a multicast time slot sequence number, so the time slot sequence number may also include a multicast time slot sequence number. Of course, the present embodiment does not limit the sequence of allocating the broadcast slot number and the multicast slot number. Referring to fig. 5, the step S201 may specifically further include the following sub-steps:
in sub-step S2012, if the home device has a corresponding multicast group, after allocating a channel to the home device requesting to access the network, selecting an idle multicast time slot sequence number in a multicast time slot range corresponding to the multicast group, and allocating the idle multicast time slot sequence number to the home device.
In this embodiment, when determining that the home device 200 requesting network access belongs to a certain multicast group, the gateway 100 further determines whether the home device 200 already accessing the network exists in the multicast group, that is, determines whether the home device 200 requesting network access is accessing the network in the multicast group before the home device requesting network access. If the multicast group has the network-connected home equipment 200, directly distributing the channel distributed by the network-connected home equipment 200 to the home equipment 200 requesting network connection; if the multicast group does not have the home device 200 that has been connected to the network, a channel may be selected from the plurality of channels obtained by scanning the frequency points and allocated to the home device 200 that has requested to be connected to the network.
After the allocation of the channels is completed, the gateway 100 selects an idle multicast time slot sequence number from the multicast time slot range corresponding to the multicast group to allocate to the home devices 200 requesting to access the network, so as to ensure that all the home devices 200 in the multicast group have different allocated multicast time slot sequence numbers. Wherein, the multicast time slot range corresponding to the multicast group can be set as [0, M]. As one way, M may be determined according to the number of home devices 200 in the current multicast group, e.g., if there are 3 home devices 200 in the multicast group, then m=2 may be determined; alternatively, M may be determined according to the maximum capacity value N of the channel in which the multicast group is located, i.e., m=n=2 (13-SF) SF denotes the spreading factor of the channel. Gateway 100 may be configured to allocate channels to home devices 200 requesting access to the network after the network has been established between [0, M ]]The multicast time slot serial number which is found to be free in the range is allocated to the home device 200, so that the value range of the multicast time slot serial number allocated by the home device 200 is actually that the multicast time slot range corresponding to the multicast group is [0, M]。
In this embodiment, the gateway 100 may allocate a corresponding multicast timeslot number to the home device 200 requesting to access the network according to whether the home device 200 having accessed the network exists in the multicast group.
Specifically, if the network-connected home device 200 does not exist 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 network-accessed home equipment 200 exists in the multicast group, an idle multicast time slot sequence number is selected in the multicast time slot range, and the idle multicast time slot sequence number is distributed to the home equipment 200. When the gateway 100 selects the idle multicast slot sequence number, the idle multicast slot sequence number may be searched according to a set order. For example, gateway 100 may incrementally search for an idle multicast slot sequence number within the [0, m ] range starting from the minimum value in the multicast slot range (i.e., the minimum multicast slot sequence number "0"); the free multicast slot sequence numbers may also be looked up in a decreasing range of [0, n ] starting from the maximum value in the multicast slot range (i.e., the maximum multicast slot sequence number "M"). Of course, the specific manner of searching for the idle multicast slot sequence number is not limited in the present application.
According to the communication method provided by the embodiment of the invention, after the gateway 100 determines that the home equipment 200 requesting network access belongs to a certain multicast group and allocates a corresponding channel to the home equipment 200 requesting network access, an idle multicast time slot sequence number is selected in a multicast time slot range corresponding to the multicast group, and the idle multicast time slot sequence number is allocated to the home equipment 200, so that different multicast reply delay time can be determined by different home equipment 200 in the same multicast group according to the spreading factor of the channel and the allocated multicast time slot sequence number, further, the multicast instruction of the gateway 100 is sequentially replied according to the different multicast reply delay time, and the conflict is not easy to occur, compared with a random delay reply mode, and the utilization rate of the channel can be improved.
During operation of the smart home system 10, the following may occur: 1. when the channel allocated to the home equipment 200 is interfered, the home equipment 200 is disconnected from communication, and the like, the home equipment 200 is often required to be re-network-connected, so that the operation of switching to other channels is performed; 2. the home equipment 200 does not have a corresponding multicast group when requesting to access the network, and the multicast group is required to be established with other home equipment 200 after accessing the network due to the change of the user demand (i.e. the multicast group is newly established after accessing the network); 3. when the home device 200 requests to access the network, a corresponding multicast group exists, and a new multicast group is established with other home devices 200 after the network access due to the change of the user demand (i.e. the multicast group is replaced after the network access). 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, under the condition that the channel is switched after the home equipment is accessed to the network, or a multicast group is established with other home equipment after the home equipment is accessed to the network, the time slot serial numbers are reassigned to the home equipment.
In this embodiment, the gateway 100 has a timeslot management capability for all home devices 200, after the gateway 100 accesses the network of the home device 200, if it detects that the home device 200 switches channels, it can allocate a broadcast timeslot number to the home device 200 according to the channel reassigned by the home device 200, further determine whether the home device 200 has a corresponding multicast group on the reassigned channel, and if so, allocate a multicast timeslot number to the home device 200.
If the home device 200 needs to establish a multicast group with other home devices 200 after being connected to the network (i.e. the home device 200 is newly built after being connected to the network or the multicast group is replaced), firstly judging whether all the home devices 200 needing 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 the channels corresponding to all the home devices 200 in the multicast group as a target channel, re-connecting all the home devices 200 in the multicast group to the selected target channel, and distributing a multicast address and a multicast time slot sequence number for all the home devices 200 in the multicast group; if the number of home 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 in the multicast group that have channel switching, the gateway 100 may allocate a corresponding broadcast timeslot number to each home device 200 according to the target channel.
It should be noted that, the specific allocation manner of the broadcast slot sequence number and the multicast slot sequence number may refer to the content of the foregoing embodiment, and will not be described herein again.
According to the communication method provided by the embodiment of the invention, under the condition that channel switching occurs after the home equipment 200 is connected to the network, or a multicast group is established between the home equipment 200 and other home equipment 200 after the home equipment 200 is connected to the network, the gateway 100 can manage the time slots of all the home equipment 200 by reallocating the broadcast time slot sequence numbers and/or the multicast time slot sequence numbers to the home equipment 200, namely, the time slots can be dynamically adjusted according to the network condition, the channel switching of the home equipment 200 is ensured, or the broadcasting instructions or the multicast instructions of the gateway 100 can be orderly replied after the home equipment 200 newly builds the multicast group or replaces the multicast group, so that the network is more robust.
Alternatively, in the present embodiment, the gateway 100 may send not only a non-unicast instruction (broadcast instruction or multicast instruction) to the home apparatus 200, but also a unicast instruction to the home apparatus 200. Referring to fig. 7, the communication method provided in the embodiment of the present application may further include the following steps:
step S401, a unicast instruction is sent to household equipment; the unicast command carries a unicast time slot sequence number, so that the home equipment determines 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.
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 device 200, the unicast instruction carries the unicast slot sequence number; the home device 200 that receives the unicast command calculates a second reply delay time according to the unicast slot sequence number and the spreading factor of the channel, and replies the unicast command according to the second reply delay time. The calculation formula of the second reply delay time may refer to the calculation formula of the first reply delay time, which is not described herein.
According to the communication method provided by the embodiment of the invention, when the gateway 100 sends the unicast command to the home device 200, the unicast time slot sequence number is carried in the unicast command, so that the home device 200 receiving the unicast command can calculate the second reply delay time according to the unicast time slot sequence number and the spreading factor of the channel, and then reply the unicast command according to the second reply delay time, thereby realizing flexible control of the time of replying the unicast command to the home device 200.
Optionally, referring to fig. 8, the communication method provided in the embodiment of the present application may further include the following steps:
in step S501, after sending the unicast command or the non-unicast command, the reply waiting time is calculated.
Step S502, receiving a reply message corresponding to the unicast command or the non-unicast command within the reply waiting time, and determining the home equipment which is not replied beyond the reply waiting time as the home equipment with overtime reply.
In this embodiment, after the gateway 100 sends the unicast command, 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 sequence number can be determined according to the maximum broadcast time slot sequence number allocated to the home device 200 on the channel, and then the corresponding reply waiting time is calculated according to the target time slot sequence 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, a corresponding target time slot sequence number can be determined according to the maximum multicast time slot sequence number allocated to the home device 200 in the multicast group, and then a corresponding reply waiting time is calculated according to the target time slot sequence number; wherein the target time slot sequence number is greater than the maximum multicast time slot sequence number.
Taking the example that 1 is added as the target time slot sequence number on the basis of the unicast time slot sequence number or the multicast time slot sequence number or the broadcast time slot sequence number, after the gateway 100 sends the unicast command on the channel, if the unicast time slot sequence number carried in the unicast command is u, the corresponding target time slot sequence number is determined to be u+1, and the delay time (which can be obtained according to the delay calculation formula) corresponding to the target time slot sequence number is used as the reply waiting time after the unicast command is sent. After the gateway 100 transmits the broadcast command on the channel, it queries the maximum broadcast time slot number in the broadcast time slot numbers of the home devices 200 on the channel, if the maximum broadcast time slot number is b max Then the corresponding target time slot sequence number is determined to be b max +1, and taking the delay time (which can be obtained according to the delay calculation formula) corresponding to the target time slot sequence number as the reply waiting time after the broadcast command is sent. After sending a multicast command to a certain multicast address, gateway 100 queries the maximum multicast time slot sequence number in the multicast time slot sequence numbers of home devices 200 in the multicast group, if the maximum multicast time slot sequence number is m max Determining the corresponding target time slot sequence number as m max +1, and then taking the delay time (which can be obtained according to the delay calculation formula) corresponding to the target time slot sequence number as the reply waiting time after the multicast instruction is sent.
According to the communication method provided by the embodiment of the application, after sending a unicast command or a non-unicast command, the gateway 100 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 corresponding reply waiting time according to the target time slot sequence number, waits for the reply of the home device 200 within the reply waiting time, and considers that the home device 200 which is not replied beyond the reply waiting time is overtime. For home device 200 to reply with a timeout, gateway 100 may resend the corresponding instruction. Because 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 devices 200 according to the first reply delay time or the second reply delay time reply command; for the home device 200 that does not reply within the reply waiting time, the gateway 100 does not continue to wait for the reply, so that the gateway 100 can be prevented from waiting for the home device 200 to reply too long, and the channel utilization rate is effectively improved.
It should be understood that in this embodiment, the communication rates on the channels corresponding to the different spreading factors are different, the reply frame length when the home device 200 replies to the gateway 100 is fixed, the specific delay time corresponding to the time slot is also fixed, and the time slot corresponds to the different delay time under the condition of the different spreading factors, which is the consensus of the gateway 100 and all the home devices 200, so that the beacon frame is not needed to synchronize the time of the home device 200 and the gateway 100. The starting time of the time slot is the same as the time point when all home devices 200 receive the broadcast or multicast instruction after the gateway 100 transmits the broadcast or multicast instruction since the home devices 200 receive the broadcast or multicast instruction.
Fig. 9 is a flow chart of another communication method according to an embodiment of the present application. The communication method may be applied to the above-mentioned home device 200, as shown in fig. 9, and includes:
step S601, receiving a channel and a time slot sequence number allocated by a gateway; different household devices on the same channel correspond to different time slot serial numbers.
In this embodiment, after the home device 200 initiates a network access request to the gateway 100, the gateway 100 allocates a channel and a time slot sequence number to the home device 200 requesting network access, and sends the time slot sequence number of the allocated channel to the home device 200. When the gateway 100 allocates the timeslot numbers to the home devices 200, for different home devices 200 on the same channel, different timeslot numbers will be allocated to the same channel, and the relevant content of the gateway 100 allocated the channel and the timeslot numbers 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 reply delay time according to the spreading factor and the time slot sequence number of the channel.
In this embodiment, after receiving the channel and the timeslot serial 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 reply delay time according to the spreading factor corresponding to the channel and the allocated timeslot serial number.
Step S603, when receiving the non-unicast command sent by the gateway, replying to the non-unicast command according to the first reply delay time.
In this embodiment, the home device 200 may receive a non-unicast command sent by the gateway 100 on a channel allocated by the gateway 100, and determine a time for replying to the non-unicast command according to the calculated first reply delay time. For example, the home device 200 may start timing with the time when the non-unicast command is received as the starting time, and when the calculated first reply delay time is reached, may send a reply message to the gateway 100. Thus, the time at which each home device 200 replies with a non-unicast command may be the start time+the first reply delay time.
According to the communication method provided by the embodiment of the application, the home equipment 200 receives the channel and the time slot serial number allocated by the gateway 100, determines the first reply delay time according to the spreading factor and the time slot serial number of the channel, and replies the non-unicast command according to the calculated first reply delay time after receiving the non-unicast command sent by the gateway 100 on the channel allocated by the gateway 100. Because the gateway 100 allocates different time slot serial numbers to different home devices 200 on the same channel when allocating the time slot serial numbers to the home devices 200, 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 reply to the non-unicast command according to the different first reply delay times, so that the plurality of home devices 200 reply to the non-unicast command at the same time is avoided, the situation of channel congestion is effectively reduced, collision is not easy to occur between the home devices 200, and the packet loss rate is reduced.
Optionally, in practical application, for a home device 200 requesting to access to the network, the gateway 100 allocates a corresponding broadcast timeslot signal to the home device, and if the home device 200 and other home devices 200 also form a multicast group, the gateway 100 needs to allocate a multicast timeslot number in addition to the broadcast timeslot number. Therefore, the time slot signal issued by the gateway 100 to the home device 200 may or may not include the multicast time slot number. For both cases, the step S602 may specifically include: if the time slot sequence number comprises the broadcast time slot sequence number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot sequence number; if the time slot sequence number comprises a broadcast time slot sequence number and a multicast time slot sequence number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot sequence number, and determining multicast reply delay time according to the spreading factor of the channel and the multicast time slot sequence number.
For example, if the Timeslot number allocated by the gateway 100 to the home device 200 includes a broadcast Timeslot number, and the broadcast Timeslot number is b, the home device 200 may utilize a delay calculation formula of Timeslot b=b×step×2 according to the spreading factor SF of the allocated channel and the broadcast Timeslot number b (SF-k) And +b.10, calculating the broadcast reply delay time Timeslot b. If the time slot sequence number allocated to the home device 200 by the gateway 100 includes a broadcast time slot sequence number and a multicast time slot sequence number, where the broadcast time slot sequence number is b and the multicast time slot sequence number is m, the home device 200 may utilize a delay calculation formula of time slot b=b×step×2 according to the spreading factor SF of the allocated channel and the broadcast time slot sequence number b (SF-k) +b.10 calculating broadcast reply delay timeTimeslot b, and using a delay calculation formula Timeslot m=m step 2 according to the spreading factor SF of the allocated channel and the multicast slot sequence number m (SF-k) And (5) calculating the multicast reply delay time Timeslot m by +m10.
When receiving the non-unicast command 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 complied with according to the type of the non-unicast command, and then replies the non-unicast command 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; if the non-unicast command is a multicast command, replying the multicast command according to the multicast reply delay time.
That is, when the home device 200 determines that the received non-unicast command is a broadcast command, it may start timing from when the broadcast command is received, and send a reply message to the gateway 100 after reaching the broadcast reply delay time slot b, so as to realize the reply to the broadcast command; when the received non-unicast command is judged to be a multicast command, timing is started from the time of receiving the multicast command, 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 command is realized.
According to the communication method provided by the embodiment of the application, the home device 200 can calculate the broadcast reply delay time according to the broadcast time slot sequence number and the channel spread factor allocated by the gateway 100, and can calculate the multicast reply delay time according to the multicast time slot sequence number and the channel spread factor allocated by the gateway 100, and when receiving the non-unicast command sent by the gateway 100, the non-unicast command is reply according to the broadcast reply delay time or the multicast delay time according to the specific type of the non-unicast command. For each home device 200 that receives the broadcast command sent by the gateway 100, the corresponding broadcast reply delay time is different, so that each home device 200 can reply the broadcast command orderly according to the corresponding broadcast reply delay time, and collision is not easy to happen; similarly, for each home device 200 that receives the multicast instruction sent by the gateway 100, the corresponding multicast reply delay time is also different, so that each home device 200 can reply the multicast instruction in order according to the corresponding multicast reply delay time, and collision is not easy to occur.
Optionally, referring to fig. 10, the communication method may further include:
in step S701, under the condition that the unicast command sent by the gateway is received, determining a second reply delay time according to the unicast slot sequence number carried in the unicast command and the spreading factor of the channel allocated by the gateway, and replying the unicast command according to the second reply delay time.
In this embodiment, when the gateway 100 sends a unicast command to the home device 200, the unicast command may carry a unicast slot sequence number, and after the home device 200 receives the unicast command, according to the unicast slot sequence number u carried in the unicast command and the spreading factor SF of the channel allocated by the gateway 100, the delay calculation formula Timeslot u=u×step×2 is used (SF-k) And (5) calculating unicast reply delay time Timeslot m by +u.10. The home equipment 200 starts timing after receiving the unicast command, and after reaching the unicast reply delay time Timeslot m, the home equipment 200 replies the unicast command. In practical applications, the unicast command may not carry a unicast slot number, in which case, the home device 200 may default the unicast slot number to 0, i.e. reply to the unicast command immediately without waiting.
According to the communication method provided by the embodiment of the invention, because the unicast command sent by the gateway 100 carries the unicast time slot sequence number, the home device 200 receiving the unicast command can calculate the second reply delay time according to the unicast time slot sequence number and the spreading factor of the channel, and then reply the unicast command according to the second reply delay time, thereby realizing flexible control of the time of the home device 200 replying 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 device may be applied to the gateway 100 described above, and includes a slot allocation module 810 and an information transceiving module 820.
The timeslot allocation module 810 is configured to allocate a timeslot number to the home device 200 after allocating a channel to the home device 200 requesting access to the network; wherein different home devices 200 on the same channel correspond to different time slot numbers.
It is understood that the slot allocation module 810 may perform the above step S201.
The information transceiver module 820 is configured to send the channel and the time slot serial number allocated to the home device 200, so that the home device 200 determines a first reply delay time according to the spreading factor and the time slot serial number of the channel, and replies the non-unicast command according to the first reply delay time when receiving the non-unicast command sent by the gateway 100.
It is understood that the information transceiver module 820 may perform the above step S202.
Optionally, the time slot sequence number includes a broadcast time slot sequence number, and the time slot allocation module 810 is specifically configured to, after allocating a channel to the home device 200 requesting access to the network, select an idle broadcast time slot sequence number in 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 understood that the slot allocation module 810 may perform the above-described sub-step S2011.
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 slot allocation module 810 may perform the above-described substep S2012.
Optionally, the timeslot allocation module 810 is further configured to reallocate the timeslot number to the home device 200 in a case where the channel is switched after the home device 200 is connected to the network, or a multicast group is established between the home device 200 and other home devices 200 after the home device 200 is connected to the network.
It is understood that the time slot allocation module 810 may also perform the above 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 a unicast time slot sequence number, so that the home device 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 above step S401.
Optionally, the information transceiver module 820 may be further configured to calculate a reply latency after sending the unicast command or the non-unicast command; 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 200 which is not replied beyond the reply waiting time as the home equipment 200 with the overtime reply.
It is understood that the information transceiver module 820 may perform steps S501 to S502 described above.
In the communication device provided in this embodiment of the present application, after allocating a channel to a home device 200 requesting to access the network, the timeslot allocation module 810 allocates a timeslot serial number to the home device 200, and the information transceiver module 820 sends the channel and the timeslot serial number allocated to the home device 200, so that the home device 200 determines a first reply delay time according to the spreading factor of the channel and the timeslot serial number, and replies to the non-unicast instruction according to the first reply delay time when receiving the non-unicast instruction sent by the gateway 100. Because the timeslot allocation module 810 allocates different timeslot numbers to different home devices 200 on the same channel, 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 timeslot numbers, and reply to the non-unicast command according to the different first reply delay times, so that the plurality of home devices 200 are prevented from replying to the non-unicast command at the same time, the situation of channel congestion is effectively reduced, collision is not easy to occur between the home devices 200, and the packet loss rate is reduced.
Fig. 12 is a functional block diagram of another communication device according to an embodiment of the present application. The communication device may be applied to the aforementioned home appliance 200, and includes a data receiving module 910, a delay time determining module 920, and an instruction replying module 930.
The data receiving module 910 is configured to receive a channel and a slot sequence number allocated by the gateway 100; wherein different home devices 200 on the same channel correspond to different time slot numbers.
It is understood that the data receiving module 910 may perform the above step S601.
The delay time determining module 920 is configured to determine a first reply delay time according to a spreading factor and a timeslot serial number of the channel.
It is understood that the delay time determining module 920 may perform the above step S602.
The instruction reply module 930 is configured to reply to the non-unicast instruction according to the first reply delay time when receiving the non-unicast instruction sent by the gateway 100.
It is understood that the instruction reply module 930 may perform the step S603 described above.
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 slot number if the slot number includes the broadcast slot number; if the time slot sequence number comprises a broadcast time slot sequence number and a multicast time slot sequence number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot sequence number, and determining multicast reply delay time according to the spreading factor of the channel and the multicast time slot sequence 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; if the non-unicast command is a multicast command, replying the multicast command according to the multicast reply delay time.
Optionally, the delay time determining module 920 may be further configured to determine, when receiving the unicast command sent by the gateway 100, a second reply delay time according to the unicast slot sequence number carried in the unicast command and the spreading factor of the channel allocated by the gateway 100, and reply the unicast command according to the second reply delay time.
It is understood that the delay time determining module 920 may also perform the step S701 described above.
In the communication device provided in this embodiment of the present application, the data receiving module 910 receives the channel and the timeslot serial number allocated by the gateway 100, the delay time determining module 920 determines a first reply delay time according to the spreading factor of the channel and the timeslot serial number, and the instruction reply module 930 replies the non-unicast instruction according to the first reply delay time when receiving the non-unicast instruction sent by the gateway 100. Because the gateway 100 allocates different time slot serial numbers to different home devices 200 on the same channel when allocating the time slot serial numbers to the home devices 200, 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 reply to the non-unicast command according to the different first reply delay times, so that the plurality of home devices 200 reply to the non-unicast command at the same time is avoided, the situation of channel congestion is effectively reduced, collision is not easy to occur between the home devices 200, and the packet loss rate is reduced.
An electronic device provided by an embodiment of the present application may include a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a communication method as provided by the method embodiment described above.
The memory may be used to store software programs and modules that the processor executes to perform various functional applications and data processing by executing the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the device, etc. In addition, 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 access to the memory by the processor.
Fig. 13 is a block diagram of an exemplary hardware structure of an electronic device of gateway 100 and home device 200, which may implement the concepts of the present application, provided in an embodiment of the present application. As shown in fig. 13, the electronic device may vary considerably in configuration or performance and may include one or more processors (ProcessingUnits, CPU) 111 (the processor 111 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 113 for storing data, one or more storage mediums 112 (e.g., one or more mass storage devices) for storing applications 1123 or data 1122. Wherein the memory 113 and the storage medium 112 may be transitory or persistent storage. The program stored on the storage medium 112 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Still further, the processor 111 may be configured to communicate with the storage medium 112 and execute a series of instruction operations in the storage medium 112 on an 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 WindowsServerTM, macOSXTM, unixTM, linuxTM, freeBSDTM, etc.
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 (NetworkInterfaceController, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the input-output interface 114 may be a radio frequency (RadioFrequency, RF) module for communicating with the internet wirelessly.
It will be appreciated by those of ordinary skill in the art that the structure shown in fig. 13 is merely illustrative and is not intended to limit the structure of gateway 100 described above. 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.
After allocating a channel to a home device 200 requesting network access, the gateway 100 provided in the embodiment of the present application allocates a time slot sequence number to the home device 200, where different home devices 200 on the same channel correspond to different time slot sequence numbers, and sends the channel and the time slot sequence number allocated to the home device 200; the home device 200 determines a first reply delay time according to the spreading factor and the time slot sequence number of the channel, and replies the non-unicast command according to the first reply delay time when receiving the non-unicast command sent by the gateway 100. Because the gateway 100 allocates different time slot serial numbers to different home devices 200 on the same channel when allocating the time slot serial numbers to the home devices 200, 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 reply to the non-unicast command according to the different first reply delay times, so that the plurality of home devices 200 reply to the non-unicast command at the same time is avoided, the situation of channel congestion is effectively reduced, collision is not easy to occur between the home devices 200, and the packet loss rate is reduced.
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 processes of the foregoing communication method embodiment are implemented, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here. Wherein, the computer readable storage medium is Read-only memory (ROM), random Access Memory (RAM), magnetic disk or optical disk, etc.
It should be noted that in this document, relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal (which may be a mobile phone, a computer, a gateway, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (14)

1. A method of communication, for use with a gateway, the method comprising:
after a channel is allocated to the household equipment requesting network access, a time slot sequence number is allocated to the household equipment; different household devices on the same channel correspond to different time slot serial numbers;
transmitting the channel and the time slot sequence number allocated to the home equipment, so that the home equipment determines a first reply 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 reply delay time under the condition that the non-unicast instruction transmitted by the gateway is received; and the time when each home device replies the non-unicast command is the time when the non-unicast command is received plus the first reply delay time.
2. The method of claim 1, wherein the slot sequence number comprises a broadcast slot sequence number, and wherein the step of assigning a slot sequence number to a home device requesting access after assigning a channel to the home device comprises:
after a channel is allocated to the home equipment requesting network access, an idle broadcasting time slot sequence number is selected from a broadcasting time slot range corresponding to the channel, and the idle broadcasting time slot sequence number is allocated to the home equipment.
3. The method of claim 1, wherein the slot sequence number further comprises a multicast slot sequence number, and wherein the step of assigning the slot sequence number to the home device after assigning the channel to the home device requesting access to the network further comprises:
if the home equipment has a corresponding multicast group, after a channel is allocated to the home equipment requesting network access, selecting an idle multicast time slot sequence number in a multicast time slot range corresponding to the multicast group, and allocating the idle multicast time slot sequence number to the home equipment.
4. The method according to claim 1, wherein the method further comprises:
and under the condition that the channel is switched after the home equipment is accessed to the network, or a multicast group is established with other home equipment after the home equipment is accessed to the network, the time slot sequence numbers are reassigned to the home equipment.
5. The method according to claim 1, wherein the method further comprises:
sending a unicast instruction to the home equipment; the unicast command carries a unicast time slot sequence number, so that the home equipment determines 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.
6. The method according to any one of claims 1-5, further comprising:
after sending a unicast instruction or a non-unicast instruction, 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 is not replied after exceeding the reply waiting time as the home equipment with overtime reply.
7. A communication method, applied to a home device, the home device being in communication with a gateway, the method comprising:
receiving the channel and time slot serial numbers distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
determining a first reply delay time according to the spreading factor of the channel and the time slot sequence number;
under the condition that a non-unicast instruction sent by the gateway is received, replying the non-unicast instruction according to the first reply delay time; and the time when each home device replies the non-unicast command is the time when the non-unicast command is received plus the first reply delay time.
8. The method of claim 7 wherein said step of determining a first reply delay time based on a spreading factor of said channel and said slot sequence number comprises:
If the time slot sequence number comprises a broadcast time slot sequence number, determining broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot sequence number;
if the time slot sequence number comprises a broadcast time slot sequence number and a multicast time slot sequence number, determining a broadcast reply delay time according to the spreading factor of the channel and the broadcast time slot sequence number, and determining a multicast reply delay time according to the spreading factor of the channel and the multicast time slot sequence 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 in the case of 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, wherein the method further comprises:
under the condition that a unicast instruction sent by the gateway is received, determining second reply delay time according to a unicast time slot sequence number carried in the unicast instruction and a spreading factor of a channel allocated by the gateway, and replying the unicast instruction according to the second reply delay time.
11. A communication device for use with a gateway, the device comprising:
the time slot allocation module is used for allocating time slot serial numbers to the household equipment after allocating channels to the household equipment requesting network access; different household devices on the same channel correspond to different time slot serial numbers;
the information receiving and transmitting module is used for transmitting the channel and the time slot sequence number allocated to the household equipment so that the household equipment can determine first reply delay time according to the spreading factor of the channel and the time slot sequence number, and reply the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction transmitted by the gateway is received; and the time when each home device replies the non-unicast command is the time when the non-unicast command is received plus the first reply delay time.
12. A communication apparatus for use with a home device in communication with a gateway, the apparatus comprising:
the data receiving module is used for receiving the channel and the time slot sequence number distributed by the gateway; different household devices on the same channel correspond to different time slot serial numbers;
The delay time determining module is used for determining a first reply delay time according to the spreading factor of the channel and the time slot sequence number;
the instruction reply module is used for replying the non-unicast instruction according to the first reply delay time under the condition that the non-unicast instruction sent by the gateway is received; and the time when each home device replies the non-unicast command is the time when the non-unicast command is received plus the first reply delay time.
13. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the communication method of any one of claims 1 to 6 or any one of claims 7 to 10.
14. A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the communication method according to any one of claims 1 to 6 or any one of claims 7 to 10.
CN202011389569.3A 2020-12-01 2020-12-01 Communication method, communication device, electronic apparatus, and computer-readable storage medium Active CN114584424B (en)

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 CN114584424A (en) 2022-06-03
CN114584424B true 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 (17)

* Cited by examiner, † Cited by third party
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
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1798863A1 (en) * 2005-12-16 2007-06-20 Telefonaktiebolaget LM Ericsson (publ) Method and device for communicating signals over first and second channel types with counteraction of interference during time periods when simultaneous transmission of the first and second channel types is predicted
US10827043B2 (en) * 2018-04-04 2020-11-03 Hall Labs Llc Normalization of communication between devices

Patent Citations (17)

* Cited by examiner, † Cited by third party
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
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
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)

* Cited by examiner, † Cited by third party
Title
"Offline Scheduling Algorithms for Time-Slotted LoRa-based Bulk Data Transmission";Dimitrios Zorbas et al;《2019 IEEE 5th World Forum on Internet of Things (WF-IoT)》;全文 *
"R1-00-0422".3GPP tsg_ran\WG1_RL1.2000,全文. *
"R1-1719777_Discussion on TRS".3GPP tsg_ran\wg1_rl1.2017,全文. *
"TD-Femto系统OVSF码资源管理研究与实现";楼佳嘉;中国优秀硕士学位论文全文数据库(第06期) *

Also Published As

Publication number Publication date
CN114584424A (en) 2022-06-03

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
CN103512159B (en) Air-conditioning and air-conditioner control system
US20070091908A1 (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
JP2006314009A (en) Radio communication system, device and method for access point management, device and method for radio communication, and computer program
CN111913397B (en) Device control method, device, storage medium, and electronic apparatus
US10051561B2 (en) Methods and nodes for M2M communication
CN112469055A (en) Equipment network distribution method, related equipment and storage medium
CN103888522A (en) Application recommending method and electronic equipment
CN105827443A (en) Network device discovery method and device
CN114585052A (en) Networking method, networking device, networking gateway and storage medium based on LoRa
CN202630316U (en) Air conditioner and air conditioner control system
CN114584424B (en) Communication method, communication device, electronic apparatus, and computer-readable storage medium
US11765749B2 (en) Distributed transmission resource allocation
EP1892928B1 (en) Remote management apparatus and method of setting IP address
CN103701952A (en) Downlink transmission method of business data and grouped data gateway
CN114615099A (en) Gateway, intelligent device distribution network processing method, electronic device and storage medium
GB2498706A (en) Finding a transmission opportunity window in a wireless mesh network with fairness provision
KR101823040B1 (en) Method for simultaneously transmitting data in heterogeneous network
CN114584414A (en) Device control method, device, electronic device and computer-readable storage medium
CN113206862B (en) Network distribution method and device for Internet of things equipment
CN116367355A (en) Networking method and system of electrical equipment, terminal equipment and readable storage medium
CN111294979B (en) Communication method and related equipment
KR101681941B1 (en) Method for simultaneously transmitting data in heterogeneous network

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