CN113133010B - Wireless networking method, device, terminal equipment and storage medium - Google Patents
Wireless networking method, device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN113133010B CN113133010B CN202010046831.8A CN202010046831A CN113133010B CN 113133010 B CN113133010 B CN 113133010B CN 202010046831 A CN202010046831 A CN 202010046831A CN 113133010 B CN113133010 B CN 113133010B
- Authority
- CN
- China
- Prior art keywords
- equipment
- instruction
- level
- networking
- current
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W16/00—Network planning, e.g. coverage or traffic planning tools; Network deployment, e.g. resource partitioning or cells structures
- H04W16/18—Network planning tools
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application is applicable to the technical field of communication, and provides a wireless networking method, a wireless networking device, terminal equipment and a storage medium. The embodiment of the application acquires a networking instruction sent by a superior device; when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment; sending the equipment information of the current-stage equipment to a gateway; when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment; the method comprises the steps of obtaining a silence instruction sent by a gateway, finishing networking operation according to the silence instruction, and improving the efficiency of wireless networking among a plurality of devices.
Description
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a wireless networking method, apparatus, terminal device, and storage medium.
Background
In the prior art, in the local area network wireless networking, networking is mainly performed by using a code scanning adding mode, equipment ID is printed out and attached to a product when the equipment is produced, the equipment ID is associated with a gateway in a code scanning mode when networking is performed, and the gateway performs data transmission according to an established logical relation table during data communication. According to the method, the only ID label with the identification is printed on each type of equipment in the actual product production process, so that the production process is complex to control, the production cost is high, and even errors are easy to occur in installation due to wrong label pasting or fuzzy label pasting, so that the overall wireless networking efficiency is low.
Disclosure of Invention
The embodiment of the application provides a wireless networking method, a wireless networking device, terminal equipment and a storage medium, and can solve the problem of low wireless networking efficiency among a plurality of pieces of equipment.
In a first aspect, an embodiment of the present application provides a wireless networking method, including:
acquiring a networking instruction sent by the upper-level equipment;
when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment;
sending the equipment information of the current-stage equipment to a gateway;
when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment;
and acquiring a silence instruction sent by the gateway, and finishing networking operation according to the silence instruction.
Optionally, before the networking instruction sent by the upper-level device is obtained, the method includes:
acquiring a grading instruction;
obtaining the equipment grade of the current-stage equipment according to the grading instruction;
generating identification information of the current-stage equipment;
and adding the identification information of the current-stage equipment into the grading instruction and sending the grading instruction to the next-stage equipment.
Optionally, obtaining the device class of the current-level device according to the classification instruction includes:
receiving a grading instruction which is sent by a previous-level device and carries identification information of the previous-level device;
and obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment.
Optionally, before obtaining the device class of the current-stage device according to the classification instruction sent by the previous-stage device, the method includes:
acquiring a signal strength value between current-stage equipment and previous-stage equipment;
obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment, wherein the equipment grade comprises the following steps:
and when the signal intensity value between the current-stage equipment and the previous-stage equipment is greater than or equal to a preset threshold value, obtaining the equipment grade of the current-stage equipment according to a grading instruction sent by the previous-stage equipment.
Optionally, after the step of obtaining the hierarchical instruction, the step of:
and if the grading instruction is acquired, entering a step of acquiring a networking instruction sent by the upper-level equipment.
Optionally, when the device class of the current-stage device does not conform to the networking instruction, after sending the networking instruction to the next-stage device, the method includes:
when the equipment level of the next-level equipment accords with the networking instruction, acquiring equipment information of the next-level equipment;
and delaying the equipment information of the next-level equipment by one clock cycle and then sending the equipment information to the previous-level equipment.
Optionally, when the device level of the next device conforms to the networking instruction, after obtaining the device information of the next device, the method includes:
and if the path information in the equipment information of the next-level equipment conforms to the ID information in the equipment information of the current-level equipment, sending the equipment information of the next-level equipment to the previous-level equipment.
In a second aspect, an embodiment of the present application provides a wireless networking apparatus, including:
the first acquisition module is used for acquiring a networking instruction sent by the upper-level equipment;
the second acquisition module is used for acquiring the equipment information of the current-stage equipment when the equipment level of the current-stage equipment conforms to the networking instruction;
a first sending module, configured to send the device information of the current-level device to a gateway;
the second sending module is used for sending the networking instruction to the next-level equipment when the equipment level of the current-level equipment does not accord with the networking instruction;
and the ending module is used for acquiring the silence instruction sent by the gateway and ending the networking operation according to the silence instruction.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any one of the foregoing wireless networking methods when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of any one of the above-mentioned wireless networking methods
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on a terminal device, causes the terminal device to execute the wireless networking method according to any one of the above first aspects.
The embodiment of the application acquires a networking instruction sent by a superior device; when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment; sending the equipment information of the current-stage equipment to a gateway; when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment; and acquiring a silence instruction sent by the gateway, and finishing networking operation according to the silence instruction. According to the method and the device, the networking instruction sent by the previous-stage device is obtained, if the device level of the current-stage device accords with the networking instruction, the device information of the current-stage device is sent to the gateway for networking, the process is simple, the networking efficiency is improved, if the device level of the current-stage device does not accord with the networking instruction, the networking instruction is sent to the next-stage device until the networking instruction accords with the device level of the device, the risk that the device is omitted due to weakening of signal strength of the gateway is avoided through transmission of the first-stage device, after the device sends the device information to the gateway, the gateway sends out the silence instruction about the sent device information device, after the device receives the silence instruction, networking operation is finished, repeated networking operation of the device which finishes networking again due to receiving the instruction is avoided, the whole process is simple to control, the production cost is low, and the wireless networking efficiency among a plurality of devices is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a first flowchart of a wireless networking method according to an embodiment of the present application;
fig. 2 is a second flowchart of a wireless networking method according to an embodiment of the present application;
fig. 3 is a third flowchart of a wireless networking method according to an embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a wireless networking method according to an embodiment of the present application;
fig. 5 is a fifth flowchart of a wireless networking method according to an embodiment of the present application;
fig. 6 is a device networking schematic diagram of a wireless networking method provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a wireless networking apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
As shown in fig. 1, a wireless networking method provided in an embodiment of the present application includes the following steps performed by a current-stage device:
and S101, acquiring a networking instruction sent by the superior equipment.
In specific application, the current-level device can perform subsequent networking operation only after acquiring a networking instruction sent by the previous-level device, wherein the networking instruction is an instruction for notifying local area network equipment to upload own equipment information, and the networking instruction can be distinguished according to different levels of the local area network equipment; the above-mentioned superior device can be local area network device of each grade after distinguishing, and can also be the gateway, and the gateway is used for sending the networking order that it sent out to the nearest one-level device of it, its quantity can be one, can also be more than two; the number of the current-stage devices may be one, or two or more. It can be understood that the networking command is sent by the gateway, and then transmitted one level according to different levels of the command.
By way of specific example and not limitation, when networking operation is performed on the 0-level device, the networking instruction may be named "networking instruction 0", when networking operation is performed on the 1-level device, the networking instruction may be named "networking instruction 1", and so on, how many types of networking instructions may be provided for how many levels of devices.
And S102, when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment.
In a specific application, if the equipment level of the current-stage equipment meets the networking instruction sent by the previous-stage equipment, it is proved that the equipment level of the gateway currently performing networking is the level of the current-stage equipment, the equipment information of the current-stage equipment is acquired, and then the subsequent operation is performed. The device class is a class of a current-level device, and may be, for example, a class 0 device, a class 1 device, a class 2 device, etc., where the class of the device is determined by a variety of factors, including but not limited to, a distribution status of the current local area network device, etc.; the device information includes, but is not limited to, some data information such as ID information of the device, path information of the device, and the like, and the path information refers to ID information of a preset number of previous devices having the largest signal strength when communicating with the current device, and may improve efficiency when uploading information to the gateway.
And step S103, sending the equipment information of the current-stage equipment to a gateway.
In a specific application, after the device information of the current-stage device is acquired, the current-stage device sends the acquired device information to the gateway one stage at a time, and knows to send the information to the gateway.
Optionally, after the current-stage device acquires the device information of itself according to the networking instruction, the acquired device information of itself may be uploaded to the previous-stage device according to a preset logic sequence, and finally, the device information of the current-stage device is sent to the gateway through sending of the first-stage device, and the gateway sequentially stores the device information of the devices according to the uploaded sequence. The preset logic sequence may be that ID information in the device information of each device in the current stage device is taken, and one number in the ID information, for example, the last number in each device ID information, is sequentially uploaded in descending order according to a certain time sequence.
Optionally, if two or more numbers of ID information of the current stage device that are evaluated are identical, networking of the device with the repeated numbers may be completed by repeating networking operations, for example, if ID information in device information of 0-level device 0-1 and 0-level device 0-2 is identical, networking of 0-level device 0-1 may be completed by a first networking operation, and then networking of 0-level device 0-2 may be completed by performing a networking operation.
By way of specific example and not limitation, after the gateway sends a "networking instruction 0", the 0-level device receives the "networking instruction 0", sequentially sends the device information of each device in the 0-level device to the gateway according to the preset logic in sequence, and the gateway sequentially stores the device information of the devices; after the gateway sends a networking instruction 1, the 0-level equipment receives the networking instruction 1, the 0-level equipment sequentially forwards the networking instruction 1 according to the preset logic sequence, wherein the 0-level equipment is only used for forwarding the instruction and does not perform analysis, after the 1-level equipment receives the networking instruction 1, the 1-level equipment sequentially sends equipment information of each piece of 1-level equipment to the 0-level equipment according to the preset logic sequence, the 0-level equipment sequentially forwards the equipment information according to the logic sequence, and the gateway sequentially stores the equipment information of the equipment; when a gateway sends a networking instruction 2, a 0-level device receives the networking instruction 2, the 0-level device sequentially forwards the networking instruction 2 according to the preset logic sequence, wherein the 0-level device is only used for forwarding the instruction and does not perform analysis, when the 1-level device receives the networking instruction 2, the 1-level device sequentially forwards the networking instruction 2 according to the preset logic sequence, the 1-level device is only used for forwarding the instruction and does not perform analysis, when the 2-level device receives the networking instruction 2, the 2-level device sequentially sends the device information of each device in the 2-level device to the 1-level device according to the preset logic sequence, the 1-level device sequentially forwards the commands according to the logic sequence, the 0-level device sequentially receives the commands and sequentially forwards the device information, finally the gateway receives the device information and sequentially stores the device information of the device, wherein the analysis is used for judging whether the received command of the current-level device is a command required to be processed by the current-level device.
And step S104, when the equipment level of the current-level equipment does not accord with the networking instruction, sending the networking instruction to the next-level equipment.
In specific application, after the current-stage device receives a networking instruction, if the device level of the current-stage device is judged not to conform to the received networking instruction, the received networking instruction is sent to the next-stage device, and the operation of sending the networking instruction to the next-stage device is not continued until the device level of the received networking instruction conforms to the networking instruction. Wherein, the number of the next-stage equipment can be one, or two or more; the forwarding of the networking instruction is to sequence each device in the current-stage device and then sequentially forward the instructions.
And S105, acquiring a silence instruction sent by the gateway, and finishing networking operation according to the silence instruction.
In a specific application, when the gateway stores the acquired device information and sends a silent instruction about the device, the device ends networking operation according to the silent instruction. The silence instruction includes ID information of a device in which the gateway currently stores device information, and it can be understood that when the device receives the silence instruction, networking operation is ended, and in the current state, if the device receives the networking instruction again, only instruction forwarding or forwarding of device information sent by a next-stage device is performed, and no analysis operation is performed.
In one embodiment, as shown in fig. 2, before step S101, the method includes:
step S201, a grading instruction is obtained.
In a specific application, after the installation of the gateway and the device is completed, the gateway sends a "grading command" in a certain manner, for example, the grading command is transmitted to the current-stage device in a broadcast manner, and then the current-stage device acquires the grading command sent by the previous-stage device. For example, a device that directly receives the hierarchical instruction sent by the gateway may be defined as a level 0 device, a device that needs the level 0 device to forward the hierarchical instruction to receive the hierarchical instruction may be defined as a level 1 device, and so on, where the definition of the device name is not limited to the above manner.
Optionally, when the classification instruction is received, the current-stage device may be clock-synchronized, that is, each device in the current-stage device receives the classification instruction at the same time, and all devices that receive the classification instruction at the current time start timing, that is, start of a clock, so as to complete clock synchronization. After clock synchronization is completed, the current-level devices can be sequenced according to the ID information in each piece of device information, and sequentially forward the instructions in a preset sequence, so that channel congestion caused by simultaneous instruction forwarding is avoided, for example, when the 0-level device 0-1 forwards the hierarchical instruction 0, the 0-level device 0-2, the 0-level device 0-3 and the like do not forward the hierarchical instruction 0.
Alternatively, the device could be theoretically classified into an infinite number of stages by the classification instruction, but the classification into 10 stages is approximate according to the actual operation and the test effect, because the classification into 10 stages is a relatively large system.
In one embodiment, after step S201, the method includes:
and if the grading instruction is acquired, entering a step of acquiring a networking instruction sent by the upper-level equipment.
In a specific application, if the current-stage device has obtained the grading instruction, it indicates that the device has obtained its own device grade, and the step of obtaining the networking instruction sent by the previous-stage device may be performed, and if the grading instruction is obtained again, the processing operation is not performed.
By way of specific example and not limitation, when the level 1 device 1-1 receives the "hierarchical instruction 0" forwarded by the level 0 device 0-1 and parses the instruction, the generated generic identifier of the level 1 device is added, and after the "hierarchical instruction 1" is forwarded to the level 2 device, and the level 1 device 1-1 receives the "hierarchical instruction 0" sent by the level 0 device 0-2 again, the level 1 device 1-1 does not perform any processing operation on the same instruction.
And S202, obtaining the equipment grade of the current-stage equipment according to the grading instruction.
In a specific application, after the current-stage device obtains a classification instruction sent by the gateway, the device class of the current-stage device may be obtained according to the classification instruction, for example, if the current-stage device receives the classification instruction sent by the gateway, the current-stage device is a 0-stage device, that is, a batch of devices relatively closest to the gateway, and the classification instruction received by the 0-stage device is not forwarded; if the current stage device receives the grading instruction sent by the 0 stage device, the current stage device is a 1 stage device, that is, a batch of devices relatively closest to the gateway except the 0 stage device.
Step S203, generating identification information of the current stage device.
In a specific application, after the current-stage device determines the device class, the identification information is generated based on the device class of the current-stage device, and when the instruction is forwarded, the next-stage device determines the device class to which the instruction is sent, so as to determine the class of the next-stage device.
And step S204, adding the identification information of the current-level equipment into the grading instruction and sending the grading instruction to next-level equipment.
In a specific application, the current-stage device sends the identification information generated by the current-stage device to the next-stage device in cooperation with the grading instruction, so as to determine the device grade of the next-stage device.
Optionally, all wireless devices in the local area network may perform a hierarchical operation, and each device itself may also remember the current level, and if a new device is added later, the related operations of networking need to be performed again.
In one embodiment, as shown in fig. 3, step S202 includes:
step S301, receiving a grading instruction which is sent by the previous-level equipment and carries the identification information of the previous-level equipment.
Step S302, obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment.
In a specific application, after the current-stage device receives a classification instruction carrying identification information of a previous-stage device, the device level of the current-stage device is obtained according to the classification instruction sent by the previous-stage device. For example, if the current stage device receives "level command 0", the current stage device is a level 1 device.
In one embodiment, as shown in fig. 4, before step S302, the method includes:
step S401, acquiring a signal strength value between the current stage device and the previous stage device.
Obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment, wherein the equipment grade comprises the following steps:
step S402, when the signal intensity value between the current-stage equipment and the previous-stage equipment is greater than or equal to a preset threshold value, the equipment grade of the current-stage equipment is obtained according to the grading instruction sent by the previous-stage equipment.
In a specific application, after receiving a grading instruction, a previous device obtains a signal strength value during communication with a previous device, where the previous device is a device that sends the grading instruction to the current device. If the signal strength value between the current-stage equipment and the previous-stage equipment is greater than or equal to the preset threshold value, the equipment grade of the current-stage equipment is obtained according to the grading instruction sent by the previous-stage equipment, and it can be understood that if the signal strength value between the current-stage equipment and the previous-stage equipment is less than the preset threshold value, the communication between the current-stage equipment and the previous-stage equipment is considered to be weak, the communication can be considered to be invalid, because if the signal strength between the current-stage equipment and the previous-stage equipment is too low, the communication is likely to be unsuccessful in the next communication.
By way of specific example and not limitation, after a "classification instruction" sent by a gateway is received by a 0-level device, each of the 0-level devices judges whether the device is in a 0 level according to a signal intensity value during communication with the gateway, when the signal intensity value is greater than or equal to a preset threshold value, the device is in the 0 level, a general identifier is generated, then the general identifier of the 0-level device is added into the "classification instruction" and forwarded to a 1-level device, at this time, the "classification instruction" is changed into the "classification instruction 0", when the 1-level device receives the "classification instruction 0", each of the 1-level devices judges whether the device is in the 1 level according to the signal intensity during communication with the gateway, when the signal intensity is greater than or equal to the preset threshold value, the device is judged to be in the 1 level, the general identifier of the 1-level device is regenerated into the "classification instruction 0", and forwarded to the 2 level, at this time, the "classification instruction 0" is changed into the "classification instruction 1", and the classification instruction may be a classification instruction 01", and the naming of the classification instruction is not limited to the above two modes.
In one embodiment, as shown in fig. 5, after step S104, the method includes:
and S501, when the equipment level of the next-level equipment accords with the networking instruction, acquiring equipment information of the next-level equipment.
And step S502, delaying the equipment information of the next-level equipment by one clock cycle and then sending the equipment information to the previous-level equipment.
In specific application, if the device level of the next-level device conforms to the networking instruction, the current-level device acquires the device information sent by the next-level device, and sends the device information of the next-level device to the previous-level device with a delay of one clock cycle by taking the received device information as a starting point. Wherein, the clock period is the time for the device to forward the device information.
Optionally, when the previous device forwards the networking instruction or the classification instruction, it may delay a clock cycle to forward the networking instruction or the classification instruction to the current device.
Optionally, at most 256 devices can be currently supported by each stage, that is, if a stage instruction is currently executed, the duration consumed by each stage is about 256 clock cycles. For example, there are three devices in the current level 0: 0-level equipment 0-1, 0-level equipment 0-2 and 0-level equipment 0-3, when the equipment forwards the hierarchical instruction 0, the 0-level equipment 0-1 forwards the hierarchical instruction, then the 0-level equipment 0-2 forwards the hierarchical instruction, and finally the 0-level equipment 0-3 forwards the hierarchical instruction; this corresponds to three clock cycles required for the level 0 device to forward the "level 0" instruction.
In one embodiment, after step S501, the method includes:
and if the path information in the equipment information of the next-level equipment conforms to the ID information in the equipment information of the current-level equipment, sending the equipment information of the next-level equipment to the previous-level equipment.
In a specific application, if the device class of the next-stage device conforms to the networking instruction, the current-stage device will acquire the device information sent by the next-stage device, and if the path information in the device information conforms to the ID information in the device information of the current-stage device, the acquired device information of the next-stage device is sent to the previous-stage device.
Optionally, as shown in fig. 6, a schematic diagram of device networking is shown, including: a gateway, a level 0 device, a level 1 device, and a level 2 device. Taking transmission of a grading instruction as an example, after a grading instruction is sent by a gateway, 0-level equipment 0-1, 0-level equipment 0-2 and 0-level equipment 0-3 \8230, 0-level equipment 0-n simultaneously receives the grading instruction and processes the received grading instruction to obtain the grading instruction 0, the 0-level equipment is sequenced in a certain sequence and then sequentially sends the grading instruction 0 to 1-level equipment 1-1, 1-level equipment 1-2 and 1-level equipment 1-3 \8230, 1-level equipment 1-n and 1-level equipment receive the grading instruction 0 and then processes to obtain the grading instruction 1, the 1-level equipment is sequenced in a certain sequence and then sequentially sends the grading instruction 1 to 2-level equipment 2-1, 2-level equipment 2, 2-3 \8230and2-level equipment 2-n.
The embodiment of the application acquires a networking instruction sent by a superior device; when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment; sending the equipment information of the current-stage equipment to a gateway; when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment; and acquiring a silence instruction sent by the gateway, and finishing networking operation according to the silence instruction. According to the method and the device, the networking instruction sent by the previous stage device is obtained, if the device level of the current stage device accords with the networking instruction, the device information of the current stage device is sent to the gateway for networking, the process is simple, the networking efficiency is improved, if the device level of the current stage device does not accord with the networking instruction, the networking instruction is sent to the next stage device until the networking instruction accords with the device level of the device, the risk that the device is omitted due to weakening of signal strength of the gateway is avoided through transmission of the first stage, after the device sends the device information to the gateway, the gateway sends the silent instruction about the sent device information device, after the device receives the silent instruction, networking operation is finished, repeated networking operation of the device which is finished networking is carried out again due to receiving the instruction is avoided, the whole process is simple in process control, the production cost is low, and the wireless networking efficiency among a plurality of devices is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 7 shows a block diagram of a wireless networking device 7 provided in the embodiment of the present application, corresponding to a wireless networking method described in the foregoing embodiment, and only the relevant parts of the embodiment of the present application are shown for convenience of description.
Referring to fig. 7, the apparatus includes:
the first obtaining module 701 is configured to obtain a networking instruction sent by a previous device.
A second obtaining module 702, configured to obtain the device information of the current-stage device when the device level of the current-stage device meets the networking instruction.
A first sending module 703, configured to send the device information of the current stage device to a gateway.
A second sending module 704, configured to send the networking instruction to a next-stage device when the device class of the current-stage device does not conform to the networking instruction.
An ending module 705, configured to obtain a silence instruction sent by the gateway, and end the networking operation according to the silence instruction.
Optionally, the wireless networking apparatus includes:
and the second acquisition module is used for acquiring the grading instruction.
And the first obtaining module is used for obtaining the equipment grade of the current-stage equipment according to the grading instruction.
And the generation module is used for generating the identification information of the current-stage equipment.
And the adding module is used for adding the identification information of the current-stage equipment into the grading instruction and sending the grading instruction to the next-stage equipment.
Optionally, the wireless networking apparatus includes:
and the receiving module is used for receiving the grading instruction which is sent by the upper-level equipment and carries the identification information of the upper-level equipment.
And the second obtaining module is used for obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment.
Optionally, the wireless networking apparatus includes:
and the third acquisition module is used for acquiring the signal intensity value between the current stage equipment and the previous stage equipment.
Obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment, wherein the equipment grade comprises the following steps:
and the third obtaining module is used for obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment when the signal intensity value between the current-stage equipment and the previous-stage equipment is greater than or equal to a preset threshold value.
Optionally, the wireless networking apparatus includes:
and the entry module is used for entering the step of acquiring the networking instruction sent by the upper-level equipment if the grading instruction is acquired.
Optionally, the wireless networking apparatus includes:
and the fourth acquisition module is used for acquiring the equipment information of the next-level equipment when the equipment level of the next-level equipment conforms to the networking instruction.
And the delay module is used for delaying the equipment information of the next-level equipment by one clock cycle and then sending the equipment information to the previous-level equipment.
Optionally, the wireless networking apparatus includes:
and a third sending module, configured to send the device information of the next device to the previous device if the path information in the device information of the next device matches the ID information in the device information of the current device.
The embodiment of the application acquires a networking instruction sent by a superior device; when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment; sending the equipment information of the current-stage equipment to a gateway; when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment; and acquiring a silence instruction sent by the gateway, and finishing networking operation according to the silence instruction. According to the method and the device, the networking instruction sent by the previous-stage device is obtained, if the device level of the current-stage device accords with the networking instruction, the device information of the current-stage device is sent to the gateway for networking, the process is simple, the networking efficiency is improved, if the device level of the current-stage device does not accord with the networking instruction, the networking instruction is sent to the next-stage device until the networking instruction accords with the device level of the device, the risk that the device is omitted due to weakening of signal strength of the gateway is avoided through transmission of the first-stage device, after the device sends the device information to the gateway, the gateway sends out the silence instruction about the sent device information device, after the device receives the silence instruction, networking operation is finished, repeated networking operation of the device which finishes networking again due to receiving the instruction is avoided, the whole process is simple to control, the production cost is low, and the wireless networking efficiency among a plurality of devices is improved.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, modules and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal device 8 of this embodiment includes: at least one processor 800 (only one shown in fig. 8), a memory 801 connected to the processor 800, and a computer program 802, such as a wireless networking program, stored in the memory 801 and executable on the at least one processor 800. The processor 800, when executing the computer program 802, implements the steps in any of the various wireless networking method embodiments described above, such as the steps S101 to S105 shown in fig. 1. Alternatively, the processor 800, when executing the computer program 802, implements the functions of the modules in the above device embodiments, for example, the functions of the modules 701 to 705 shown in fig. 7.
Illustratively, the computer program 802 may be partitioned into one or more modules that are stored in the memory 801 and executed by the processor 800 to accomplish the present application. The one or more modules may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of the computer program 802 in the terminal device 8. For example, the computer program 802 may be divided into a first obtaining module 701, a second obtaining module 702, a first sending module 703, a second sending module 704, and an ending module 705, where the specific functions of the modules are as follows:
a first obtaining module 701, configured to obtain a networking instruction sent by a previous device;
a second obtaining module 702, configured to obtain device information of a current-level device when a device level of the current-level device meets the networking instruction;
a first sending module 703, configured to send the device information of the current-stage device to a gateway;
a second sending module 704, configured to send the networking instruction to a next-stage device when the device class of the current-stage device does not conform to the networking instruction;
the ending module 705 is configured to acquire a silence instruction sent by a gateway, and end networking operation according to the silence instruction.
The terminal device 8 may include, but is not limited to, a processor 800, a memory 801. Those skilled in the art will appreciate that fig. 8 is merely an example of the terminal device 8, and does not constitute a limitation of the terminal device 8, and may include more or less components than those shown, or some of the components may be combined, or different components may be included, such as an input output device, a network access device, a bus, etc.
The memory 801 may in some embodiments be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. The memory 801 may also be an external storage device of the terminal device 8 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 801 may include both an internal storage unit and an external storage device of the terminal device 8. The memory 801 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer programs. The memory 801 may also be used to temporarily store data that has been output or is to be output.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one type of logical function division, and other division manners may be available in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-drive, a removable hard drive, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (9)
1. A method for wireless networking, comprising:
acquiring a networking instruction sent by a superior device, wherein the networking instruction is distinguished according to different levels of local area network devices;
when the equipment level of the current-level equipment accords with the networking instruction, acquiring equipment information of the current-level equipment;
sending the equipment information of the current-stage equipment to a gateway;
when the equipment level of the current-level equipment does not accord with the networking instruction, the networking instruction is sent to the next-level equipment;
acquiring a silence instruction sent by a gateway, and finishing networking operation according to the silence instruction;
before obtaining a networking instruction sent by a superior device, the method comprises the following steps:
acquiring a grading instruction;
obtaining the equipment grade of the current-stage equipment according to the grading instruction;
generating identification information of the current stage equipment;
and adding the identification information of the current-level equipment into the grading instruction and sending the grading instruction to the next-level equipment.
2. The wireless networking method of claim 1, wherein obtaining the device class of the current stage device according to the classification command comprises:
receiving a grading instruction which is sent by a previous-level device and carries identification information of the previous-level device;
and obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment.
3. The wireless networking method of claim 2, wherein obtaining the device class of the current device according to the classification command sent by the previous device comprises:
acquiring a signal intensity value between current stage equipment and previous stage equipment;
obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment, wherein the equipment grade comprises the following steps:
and when the signal intensity value between the current-stage equipment and the previous-stage equipment is greater than or equal to a preset threshold value, obtaining the equipment grade of the current-stage equipment according to the grading instruction sent by the previous-stage equipment.
4. The wireless networking method of claim 2 or 3, wherein obtaining the ranking instructions comprises:
and if the grading instruction is acquired, entering a step of acquiring a networking instruction sent by the upper-level equipment.
5. The wireless networking method of claim 1, wherein after sending the networking command to a next device when the device class of the current device does not conform to the networking command, the method comprises:
when the equipment level of the next-level equipment accords with the networking instruction, acquiring equipment information of the next-level equipment;
and delaying the equipment information of the next-level equipment by one clock cycle and then sending the equipment information to the previous-level equipment.
6. The wireless networking method of claim 5, wherein when the device class of the next device conforms to the networking instruction, after obtaining the device information of the next device, the method comprises:
and if the path information in the equipment information of the next-level equipment conforms to the ID information in the equipment information of the current-level equipment, sending the equipment information of the next-level equipment to the previous-level equipment.
7. A wireless networking apparatus, comprising:
the first acquisition module is used for acquiring a networking instruction sent by the upper-level equipment, wherein the networking instruction is distinguished according to different levels of the local area network equipment;
the second acquisition module is used for acquiring the equipment information of the current-stage equipment when the equipment level of the current-stage equipment conforms to the networking instruction;
the first sending module is used for sending the equipment information of the current-stage equipment to a gateway;
the second sending module is used for sending the networking instruction to the next-level equipment when the equipment level of the current-level equipment does not accord with the networking instruction;
the end module is used for acquiring a silence instruction sent by the gateway and ending networking operation according to the silence instruction;
the second obtaining module is also used for obtaining a grading instruction;
a first obtaining module for obtaining the equipment grade of the current-stage equipment according to the grading instruction,
a generation module for generating identification information of a current stage device,
and the adding module is used for adding the identification information of the current-stage equipment into the grading instruction and sending the grading instruction to the next-stage equipment.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010046831.8A CN113133010B (en) | 2020-01-16 | 2020-01-16 | Wireless networking method, device, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010046831.8A CN113133010B (en) | 2020-01-16 | 2020-01-16 | Wireless networking method, device, terminal equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113133010A CN113133010A (en) | 2021-07-16 |
CN113133010B true CN113133010B (en) | 2023-01-03 |
Family
ID=76771692
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010046831.8A Active CN113133010B (en) | 2020-01-16 | 2020-01-16 | Wireless networking method, device, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113133010B (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009026739A1 (en) * | 2007-08-24 | 2009-03-05 | Alcatel Shanghai Bell Co., Ltd. | Method for scheduling resource, network element and user equipment |
CN104254128A (en) * | 2013-06-25 | 2014-12-31 | 掌通万维(北京)科技有限公司 | Networking method and equipment in Internet of things |
CN103713608B (en) * | 2013-12-27 | 2017-03-15 | 广东康宝电器股份有限公司 | Wireless Internet of Things house system hierarchical network framework and its group-net communication method |
CN103957143B (en) * | 2014-04-30 | 2017-08-04 | 广东瑞德智能科技股份有限公司 | A kind of transmission method of household electrical appliances LAN |
WO2017035806A1 (en) * | 2015-09-02 | 2017-03-09 | 华为技术有限公司 | Method for transmitting data, forward transmission device and cascaded networking |
CN107786598A (en) * | 2016-08-26 | 2018-03-09 | 深圳市中兴微电子技术有限公司 | A kind of method, apparatus and server of remote control of domestic equipment for surfing the net |
CN107509206B (en) * | 2017-08-25 | 2021-11-02 | 北京建筑技术发展有限责任公司 | Data networking method for intelligent lighting system |
-
2020
- 2020-01-16 CN CN202010046831.8A patent/CN113133010B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113133010A (en) | 2021-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109417691B (en) | Bluetooth cluster online upgrading method and device | |
CN103416035B (en) | There is the microcontroller of CAN module and auto-speed detection | |
CN110392381B (en) | Multi-channel wireless communication method and device for nuclear power station and terminal equipment | |
CN111338662A (en) | Firmware upgrading method and device for slave station and terminal | |
CN112803950A (en) | Data compression method, device and equipment and computer storage medium | |
CN112152825B (en) | Multi-stage module upgrading method and device for household appliance and electronic equipment | |
CN115277671A (en) | OTA (over the air) upgrading method and device for vehicle, vehicle and storage medium | |
CN111315026B (en) | Channel selection method, device, gateway and computer readable storage medium | |
CN109995548B (en) | Device management method and system, data transmission method and system and terminal device | |
CN112596447B (en) | Method and device for determining length of ECU (electronic control Unit) flash data, electronic equipment and medium | |
CN113133010B (en) | Wireless networking method, device, terminal equipment and storage medium | |
CN109788065B (en) | Off-line message transmission method and off-line message transmission device based on Beidou system | |
CN116846705A (en) | Communication method, system, master node, slave node, and computer storage medium | |
CN115242687B (en) | Node activity detection method, device, equipment and medium | |
CN116232891A (en) | Whole-vehicle OTA parallel refreshing upgrading method, device, equipment and storage medium | |
CN113542360B (en) | Information association method, association device, electronic equipment and readable storage medium | |
CN112688870B (en) | Routing method, routing device and node equipment | |
CN114326673A (en) | Vehicle remote diagnosis method and device, connector and storage medium | |
CN113141579B (en) | Wireless communication method, device and system | |
CN115297126B (en) | Information transmission method, device, terminal and storage medium based on block chain | |
CN113806069B (en) | Nuclear power station system interaction method and device, peripheral system and storage medium | |
CN114885393B (en) | Control method and device for network access of equipment and terminal equipment | |
CN111953384B (en) | Communication address sending method and device, electric energy meter and storage medium | |
CN1354919A (en) | Comparator and methods for voting therewith | |
CN112788778B (en) | Data sending method and device |
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 |